예제 #1
0
     /**
      * The payment can be submitted by sending a PaymentRequest 
      * to the authorise action of the web service, the request should 
      * contain the following variables:
      * - merchantAccount: The merchant account the payment was processed with.
      * - amount: The amount of the payment
      * 	- currency: the currency of the payment
      * 	- amount: the amount of the payment
      * - reference: Your reference
      * - shopperIP: The IP address of the shopper (optional/recommended)
      * - shopperEmail: The e-mail address of the shopper 
      * - shopperReference: The shopper reference, i.e. the shopper ID
      * - fraudOffset: Numeric value that will be added to the fraud score (optional)
      * - paymentRequest.additionalData.card.encrypted.json: The encrypted card catched by the POST variables.
      */
     $result = $client->authorise(array("paymentRequest" => array("merchantAccount" => "YourMerchantAccount", "amount" => array("currency" => "EUR", "value" => "199"), "reference" => "TEST-PAYMENT-" . date("Y-m-dH:i:s"), "shopperIP" => "ShopperIPAddress", "shopperEmail" => "TheShopperEmailAddress", "shopperReference" => "YourReference", "fraudOffset" => "0", "additionalData" => array("entry" => new SoapVar(array("key" => new SoapVar("card.encrypted.json", XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema", "key", "http://payment.services.adyen.com"), "value" => new SoapVar($_POST['adyen-encrypted-data'], XSD_STRING, "string", "http://www.w3.org/2001/XMLSchema", "value", "http://payment.services.adyen.com")), SOAP_ENC_OBJECT, "")))));
     /**
      * If the payment passes validation a risk analysis will be done and, depending on the
      * outcome, an authorisation will be attempted. You receive a
      * payment response with the following fields:
      * - pspReference: The reference we assigned to the payment;
      * - resultCode: The result of the payment. One of Authorised, Refused or Error;
      * - authCode: An authorisation code if the payment was successful, or blank otherwise;
      * - refusalReason: If the payment was refused, the refusal reason.
      */
     print_r($result);
 } catch (SoapFault $ex) {
     print "<pre>";
     print $ex;
     print "</pre>";
 }
예제 #2
0
     /**
      * The payment can be submitted by sending a PaymentRequest 
      * to the authorise action of the web service, the request should 
      * contain the following variables:
      * - merchantAccount: The merchant account the payment was processed with.
      * - amount: The amount of the payment
      * 	- currency: the currency of the payment
      * 	- amount: the amount of the payment
      * - reference: Your reference
      * - shopperIP: The IP address of the shopper (optional/recommended)
      * - shopperEmail: The e-mail address of the shopper 
      * - shopperReference: The shopper reference, i.e. the shopper ID
      * - fraudOffset: Numeric value that will be added to the fraud score (optional)
      * - paymentRequest.additionalData.card.encrypted.json: The encrypted card catched by the POST variables.
      */
     $result = $client->authorise(array("paymentRequest" => array("merchantAccount" => "YourMerchantAccount", "amount" => array("currency" => "EUR", "value" => "199"), "reference" => "TEST-PAYMENT-" . date("Y-m-dH:i:s"), "shopperIP" => "ShopperIPAddress", "shopperEmail" => "TheShopperEmailAddress", "shopperReference" => "YourReference", "fraudOffset" => "0", "additionalData" => array(array("key" => "card.encrypted.json", "value" => $_POST['adyen-encrypted-data'])))));
     /**
      * If the payment passes validation a risk analysis will be done and, depending on the
      * outcome, an authorisation will be attempted. You receive a
      * payment response with the following fields:
      * - pspReference: The reference we assigned to the payment;
      * - resultCode: The result of the payment. One of Authorised, Refused or Error;
      * - authCode: An authorisation code if the payment was successful, or blank otherwise;
      * - refusalReason: If the payment was refused, the refusal reason.
      */
     print_r($result);
 } catch (SoapFault $ex) {
     print "<pre>";
     print $ex;
     print "</pre>";
 }
예제 #3
0
 *     - number                : The card number.
 *     - cvc                   : The card validation code, which is the CVC2 (MasterCard),
 *                               CVV2 (Visa) or CID (American Express).
 *     - billingAddress (recommended)
 *         - street            : The street name.
 *         - houseNumberOrName : The house number (or name).
 *         - city              : The city.
 *         - postalCode        : The postal/zip code.
 *         - stateOrProvince   : The state or province.
 *         - country           : The country in ISO 3166-1 alpha-2 format (e.g. NL).
 * - browserInfo
 *     - userAgent             : The user agent string of the shopper's browser (required).
 *     - acceptHeader          : The accept header string of the shopper's browser (required).
 */
try {
    $result = $client->authorise(array("paymentRequest" => array("merchantAccount" => "YourMerchantAccount", "amount" => array("currency" => "EUR", "value" => "199"), "reference" => "TEST-3D-SECURE-PAYMENT-" . date("Y-m-dH:i:s"), "shopperIP" => "ShopperIPAddress", "shopperEmail" => "TheShopperEmailAddress", "shopperReference" => "YourReference", "fraudOffset" => "0", "card" => array("expiryMonth" => "06", "expiryYear" => "2016", "holderName" => "The Holder Name Here", "number" => "5212345678901234", "cvc" => "737", "billingAddress" => array("street" => "Simon Carmiggeltstraat", "postalCode" => "1011 DJ", "city" => "Amsterdam", "houseNumberOrName" => "6-50", "stateOrProvince" => "", "country" => "NL")), "browserInfo" => array("userAgent" => $_SERVER['HTTP_USER_AGENT'], "acceptHeader" => $_SERVER['HTTP_ACCEPT']))));
    /**
     * Once your account is confgured for 3-D Secure, the Adyen system performs a directory
     * inquiry to verify that the card is enrolled in the 3-D Secure programme.
     * If it is not enrolled, the response is the same as a normal API authorisation.
     * If, however, it is enrolled, the response contains these fields:
     * 
     * - paRequest     : The 3-D request data for the issuer.
     * - md            : The payment session.
     * - issuerUrl     : The URL to direct the shopper to.
     * - resultCode    : The resultCode will be RedirectShopper.
     *
     * The paRequest and md fields should be included in an HTML form, which needs to be submitted
     * using the HTTP POST method to the issuerUrl. You must also include a termUrl parameter
     * in this form, which contains the URL on your site that the shopper will be returned to
     * by the issuer after authentication. In this example we are redirecting to another example
 * 	- cvc: The card validation code. This is the the CVC2 code (for MasterCard), CVV2 (for Visa) or CID (for American Express).
 */
$paymentRequest = array("paymentRequest" => array("merchantAccount" => "GuangmianKung", "amount" => array("currency" => "EUR", "value" => "199"), "reference" => "Test Travel Data SOAP API PAYMENT-" . date("Y-m-dH:i:s"), "shopperIP" => "1.1.1.1", "shopperEmail" => "[merchant account]", "shopperReference" => "Test travel shopper 001", "fraudOffset" => "0", "card" => array("billingAddress" => array("street" => "Simon Carmiggeltstraat", "postalCode" => "1011 DJ", "city" => "Amsterdam", "houseNumberOrName" => "6-50", "stateOrProvince" => "", "country" => "NL"), "expiryMonth" => "06", "expiryYear" => "2016", "holderName" => "Test Recurr Person SOAP API", "number" => "4111111111111111", "cvc" => "737")));
/*Start of travel data code*/
$additionalDataArray = array("airline.passenger_name" => "Kate Winslet", "airline.ticket_number" => "XC123", "airline.airline_code" => "111", "airline.travel_agency_code" => "000000", "airline.travel_agency_name" => "UNKNOWN", "airline.customer_reference_number" => "******5837", "airline.ticket_issue_address" => "YREWX08AA", "airline.boarding_fee" => "12", "airline.airline_designator_code" => "AA", "airline.agency_plan_name" => "AA", "airline.agency_invoice_number" => "222", "airline.flight_date" => "2015-02-19 00:00", "airline.passenger1.first_name" => "Kate", "airline.passenger1.last_name" => "Winslet", "airline.passenger1.traveller_type" => "ADT", "airline.passenger1.date_of_birth" => "1980-05-02", "airline.passenger1.phone_number" => "0031641212345", "airline.passenger2.first_name" => "Peter", "airline.passenger2.last_name" => "Pan", "airline.passenger2.traveller_type" => "ADT", "airline.passenger2.date_of_birth" => "1980-05-02", "airline.passenger2.phone_number" => "0031641212345", "airline.leg1.depart_airport" => "HKG", "airline.leg1.flight_number" => "364", "airline.leg1.carrier_code" => "AA", "airline.leg1.fare_base_code" => "E", "airline.leg1.class_of_travel" => "E", "airline.leg1.stop_over_code" => "0", "airline.leg1.destination_code" => "AMS", "airline.leg1.date_of_travel" => "2015-02-19 00:00", "airline.leg1.depart_tax" => "396.00", "airline.leg2.depart_airport" => "PVG", "airline.leg2.flight_number" => "369", "airline.leg2.carrier_code" => "AA", "airline.leg2.fare_base_code" => "E", "airline.leg2.class_of_travel" => "E", "airline.leg2.stop_over_code" => "0", "airline.leg2.destination_code" => "LTN", "airline.leg2.date_of_travel" => "2015-02-20 00:00", "airline.leg2.depart_tax" => "0.00", "lodging.checkInDate" => "20150607", "lodging.checkOutDate" => "20150607", "lodging.folioNumber" => "1234", "lodging.specialProgramCode" => "1", "lodging.renterName" => "Peter Pan", "lodging.numberOfRoomRates" => "2", "lodging.room1.rate" => "1220", "lodging.room1.numberOfNights" => "4", "lodging.room2.rate" => "1220", "lodging.room2.numberOfNights" => "2");
$x = 0;
$entry = array();
foreach ($additionalDataArray as $key => $val) {
    $entry[$x]->key = new SoapVar("{$key}", XSD_STRING, NULL, $namespace, 'key', $namespace);
    $entry[$x]->value = new SoapVar("{$val}", XSD_STRING, NULL, $namespace, 'value', $namespace);
    $x = $x + 1;
}
$paymentRequest['paymentRequest']['additionalData'] = $entry;
/* End of travel data code */
try {
    $result = $client->authorise($paymentRequest);
    /**
     * If the payment passes validation a risk analysis will be done and, depending on the
     * outcome, an authorisation will be attempted. You receive a
     * payment response with the following fields:
     * - pspReference: The reference we assigned to the payment;
     * - resultCode: The result of the payment. One of Authorised, Refused or Error;
     * - authCode: An authorisation code if the payment was successful, or blank otherwise;
     * - refusalReason: If the payment was refused, the refusal reason.
     */
    print_r($result);
} catch (SoapFault $ex) {
    print "<pre>";
    print $ex;
    print "<pre>";
}
예제 #5
0
 * - card
 * 	- billingAddress: we advice you to submit billingAddress data if available for risk checks;
 * 		- street: The street name
 * 		- postalCode: The postal/zip code.
 * 		- city: The city
 * 		- houseNumberOrName:
 * 		- stateOrProvince: The house number
 * 		- country: The country
 * 	- expiryMonth: The expiration date's month written as a 2-digit string, padded with 0 if required (e.g. 03 or 12).
 * 	- expiryYear: The expiration date's year written as in full. e.g. 2016.
 * 	- holderName: The card holder's name, aas embossed on the card.
 * 	- number: The card number.
 * 	- cvc: The card validation code. This is the the CVC2 code (for MasterCard), CVV2 (for Visa) or CID (for American Express).
 */
try {
    $result = $client->authorise(array("paymentRequest" => array("merchantAccount" => "YourMerchantAccount", "amount" => array("currency" => "EUR", "value" => "199"), "reference" => "TEST-PAYMENT-" . date("Y-m-dH:i:s"), "shopperIP" => "ShopperIPAddress", "shopperEmail" => "TheShopperEmailAddress", "shopperReference" => "YourReference", "fraudOffset" => "0", "card" => array("billingAddress" => array("street" => "Simon Carmiggeltstraat", "postalCode" => "1011 DJ", "city" => "Amsterdam", "houseNumberOrName" => "6-50", "stateOrProvince" => "", "country" => "NL"), "expiryMonth" => "06", "expiryYear" => "2016", "holderName" => "The Holder Name Here", "number" => "5555444433331111", "cvc" => "737"))));
    /**
     * If the payment passes validation a risk analysis will be done and, depending on the
     * outcome, an authorisation will be attempted. You receive a
     * payment response with the following fields:
     * - pspReference: The reference we assigned to the payment;
     * - resultCode: The result of the payment. One of Authorised, Refused or Error;
     * - authCode: An authorisation code if the payment was successful, or blank otherwise;
     * - refusalReason: If the payment was refused, the refusal reason.
     */
    print_r($result);
} catch (SoapFault $ex) {
    print "<pre>";
    print $ex;
    print "<pre>";
}