diff --git a/CHANGELOG.md b/CHANGELOG.md index e4d073e..3acf914 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,13 @@ -* 4.52 (2017-10-16) +* 4.53 (2018-01-10) + * new deliveryCharge attribute in order object + * new registrationToken attribute in payment object + * new object subMerchant + * new method isRegistered + * new subMerchant parameter for doAuthorization, doWebPayment, doCredit, doDebit, doImmediateWalletPayment, doScheduledWalletPayment + * new miscData parameter for doWebPayment + * new returnUrl parameter for verifyEnrollment + + * 4.52 (2017-10-16) * new avs child node in transaction object * 4.51 (2017-08-11) diff --git a/src/Payline/Order.php b/src/Payline/Order.php index eb1831a..35a7665 100644 --- a/src/Payline/Order.php +++ b/src/Payline/Order.php @@ -1,42 +1,44 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Order -{ - - public $ref; - - public $origin; - - public $country; - - public $taxes; - - public $amount; - - public $currency; - - public $date; - - public $quantity; - - public $comment; - - public $details; - - public $deliveryTime; - - public $deliveryMode; - - public $deliveryExpectedDate; - - public $deliveryExpectedDelay; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Order +{ + + public $ref; + + public $origin; + + public $country; + + public $taxes; + + public $amount; + + public $currency; + + public $date; + + public $quantity; + + public $comment; + + public $details; + + public $deliveryTime; + + public $deliveryMode; + + public $deliveryExpectedDate; + + public $deliveryExpectedDelay; + + public $deliveryCharge; } \ No newline at end of file diff --git a/src/Payline/PaylineSDK.php b/src/Payline/PaylineSDK.php index 0362f52..48db720 100644 --- a/src/Payline/PaylineSDK.php +++ b/src/Payline/PaylineSDK.php @@ -36,12 +36,12 @@ class PaylineSDK /** * Payline release corresponding to this version of the package */ - const SDK_RELEASE = 'PHP SDK 4.52.1'; + const SDK_RELEASE = 'PHP SDK 4.53'; /** * WSDL file name */ - const WSDL = 'v4.52.wsdl'; + const WSDL = 'v4.53.wsdl'; /** * development environment flag @@ -177,6 +177,11 @@ class PaylineSDK * SOAP name of recurring object */ const SOAP_RECURRING = 'recurring'; + + /** + * SOAP name of subMerchant object + */ + const SOAP_SUBMERCHANT = 'subMerchant'; /** * web services endpoint in development environment @@ -761,6 +766,26 @@ protected function recurring(array $array) } return new \SoapVar($recurring, SOAP_ENC_OBJECT, PaylineSDK::SOAP_RECURRING, PaylineSDK::PAYLINE_NAMESPACE); } + + /** + * build SubMerchant instance from $array and make SoapVar object for subMerchant + * + * @param array $array + * the array keys are listed in SubMerchant CLASS. + * @return SoapVar representation of SubMerchant instance + */ + protected function subMerchant(array $array) + { + $subMerchant = new SubMerchant(); + if ($array) { + foreach ($array as $k => $v) { + if (array_key_exists($k, $subMerchant) && (strlen($v))) { + $subMerchant->$k = $v; + } + } + } + return new \SoapVar($subMerchant, SOAP_ENC_OBJECT, PaylineSDK::SOAP_SUBMERCHANT, PaylineSDK::PAYLINE_NAMESPACE); + } /** * Hide characters in a string @@ -905,6 +930,12 @@ private static function formatRequest(&$array) if (!isset($array['merchantName'])) { $array['merchantName'] = null; } + if (!isset($array['miscData'])) { + $array['miscData'] = null; + } + if (!isset($array['subMerchant'])) { + $array['subMerchant'] = array(); + } } /** @@ -1241,6 +1272,14 @@ protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI $response = PaylineSDK::responseToArray($client->doBankTransfer($WSRequest)); $logResponse['transaction.id'] = $response['transaction']['id']; break; + case 'isRegistered': + $logRequest = array( + 'order.ref' => $array['order']['ref'], + 'payment.contractNumber' => $array['payment']['contractNumber'] + ); + $response = PaylineSDK::responseToArray($client->isRegistered($WSRequest)); + $logResponse['token'] = $response['token']; + break; } $logResponse['result.code'] = $response['result']['code']; $this->logger->addInfo($Method . 'Request', $logRequest); @@ -1348,7 +1387,8 @@ public function doAuthorization(array $array) 'owner' => $this->owner($array['owner'], $array['ownerAddress']), 'privateDataList' => $this->privateData, 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), - 'bankAccountData' => $this->bankAccountData($array['bankAccountData']) + 'bankAccountData' => $this->bankAccountData($array['bankAccountData']), + 'subMerchant' => $this->subMerchant($array['subMerchant']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doAuthorization'); } @@ -1403,7 +1443,8 @@ public function doDebit(array $array) 'privateDataList' => $this->privateData, 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), - 'authorization' => $this->authorization($array['authorization']) + 'authorization' => $this->authorization($array['authorization']), + 'subMerchant' => $this->subMerchant($array['subMerchant']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doDebit'); } @@ -1457,7 +1498,8 @@ public function doCredit(array $array) 'buyer' => $this->buyer($array['buyer'], $array['shippingAddress'], $array['billingAddress']), 'privateDataList' => $this->privateData, 'order' => $this->order($array['order']), - 'comment' => $array['comment'] + 'comment' => $array['comment'], + 'subMerchant' => $this->subMerchant($array['subMerchant']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doCredit'); } @@ -1585,7 +1627,8 @@ public function doImmediateWalletPayment(array $array) 'cardInd' => $array['cardInd'], 'cvx' => $array['walletCvx'], 'privateDataList' => $this->privateData, - 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']) + 'authentication3DSecure' => $this->authentication3DSecure($array['3DSecure']), + 'subMerchant' => $this->subMerchant($array['subMerchant']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doImmediateWalletPayment'); } @@ -1607,7 +1650,8 @@ public function doScheduledWalletPayment(array $array) 'walletId' => $array['walletId'], 'cardInd' => $array['cardInd'], 'order' => $this->order($array['order']), - 'privateDataList' => $this->privateData + 'privateDataList' => $this->privateData, + 'subMerchant' => $this->subMerchant($array['subMerchant']) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doScheduledWalletPayment'); } @@ -1682,7 +1726,8 @@ public function verifyEnrollment(array $array) 'mdFieldValue' => $array['mdFieldValue'], 'walletId' => $array['walletId'], 'walletCardInd' => $array['walletCardInd'], - 'merchantName' => $array['merchantName'] + 'merchantName' => $array['merchantName'], + 'returnURL' => $array['returnURL'] ); if (isset($array['generateVirtualCvx'])) { $WSRequest['generateVirtualCvx'] = $array['generateVirtualCvx']; @@ -1861,6 +1906,24 @@ public function doBankTransfer(array $array) ); return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'doBankTransfer'); } + + /** + * calls isRegistered web service + * + * @param array $array + * associative array containing isRegistered parameters + */ + public function isRegistered(array $array) + { + $this->formatRequest($array); + $WSRequest = array( + 'payment' => $this->payment($array['payment']), + 'order' => $this->payment($array['order']), + 'privateDataList' => $this->privateData, + 'buyer' => $this->payment($array['buyer']) + ); + return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'isRegistered'); + } /* * ************************************************************************* @@ -1895,7 +1958,9 @@ public function doWebPayment(array $array) 'owner' => $this->owner($array['owner'], $array['ownerAddress']), 'securityMode' => $array['securityMode'], 'contractNumberWalletList' => $array['walletContracts'], - 'merchantName' => $array['merchantName'] + 'merchantName' => $array['merchantName'], + 'subMerchant' => $this->subMerchant($array['subMerchant']), + 'miscData' => $array['miscData'] ); if (isset($array['payment']['mode'])) { diff --git a/src/Payline/Payment.php b/src/Payline/Payment.php index 9f0125a..dd7d6a7 100644 --- a/src/Payline/Payment.php +++ b/src/Payline/Payment.php @@ -1,32 +1,34 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ -namespace Payline; - -class Payment -{ - - public $amount; - - public $currency; - - public $action; - - public $mode; - - public $method; - - public $contractNumber; - - public $differedActionDate; - - public $softDescriptor; - - public $cardBrand; + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class Payment +{ + + public $amount; + + public $currency; + + public $action; + + public $mode; + + public $method; + + public $contractNumber; + + public $differedActionDate; + + public $softDescriptor; + + public $cardBrand; + + public $registrationToken; } \ No newline at end of file diff --git a/src/Payline/SubMerchant.php b/src/Payline/SubMerchant.php new file mode 100644 index 0000000..8e591b9 --- /dev/null +++ b/src/Payline/SubMerchant.php @@ -0,0 +1,38 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ +namespace Payline; + +class SubMerchant +{ + + public $subMerchantId; + + public $subMerchantName; + + public $subMerchantMCC; + + public $subMerchantSIRET; + + public $subMerchantTaxCode; + + public $subMerchantStreet; + + public $subMerchantCity; + + public $subMerchantZipCode; + + public $subMerchantCountry; + + public $subMerchantState; + + public $subMerchantEmailAddress; + + public $subMerchantPhoneNumber; +} \ No newline at end of file diff --git a/src/Payline/v4.53.wsdl b/src/Payline/v4.53.wsdl new file mode 100644 index 0000000..19261c7 --- /dev/null +++ b/src/Payline/v4.53.wsdl @@ -0,0 +1,3499 @@ + + + + + + + + + + This element is the request for the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + This element is the reponse from the + getWebPayment + method + + + + + + + + + + + + + This element is the reponse from the + doWebPayment + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthorization + method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthorization method + + + + + + + + + + + + + + + + + + This element is the request for the + doCapture method + + + + + + + + + + + + + + + + + This element is the reponse from the + doCapture + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doRefund + method + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRefund method + + + + + + + + + + + + + This element is the request for the doReset + method + + + + + + + + + + + + + + + This element is the reponse from the doReset + method + + + + + + + + + + + + + This element is the request for the doCredit + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doCredit method + + + + + + + + + + + + + + + This element is the request for the + createWallet + method + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWallet + method + + + + + + + + + + + + + + + + This element is the request for the + updateWallet + method + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWallet + method + + + + + + + + + + + + + + + This element is the request for the + getWallet method + + + + + + + + + + + + + + + + This element is the reponse from the + getWallet + method + + + + + + + + + + + + + + + + + + + + This element is the request for the + getCards method + + + + + + + + + + + + + + + This element is the reponse from the + getCards method + + + + + + + + + + + + + + + This element is the request for the + disableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + disableWallet + method + + + + + + + + + + + + + This element is the request for the + enableWallet + method + + + + + + + + + + + + + + This element is the reponse from the + enableWallet + method + + + + + + + + + + + + This element is the request for the + doImmediateWalletPayment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doImmediateWalletPayment method + + + + + + + + + + + + + + This element is the request for the + doScheduledWalletPayment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doScheduledWalletPayment method + + + + + + + + + + + + + This element is the request for the + doRecurrentWalletPayment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + doRecurrentWalletPayment method + + + + + + + + + + + + + + This element is the request for the + getPaymentRecord method + + + + + + + + + + + + + + This element is the reponse from the + getPaymentRecord method + + + + + + + + + + + + + + + + + + + This element is the request for the + disablePaymentRecord method + + + + + + + + + + + + + This element is the reponse from the + disablePaymentRecord method + + + + + + + + + + + + This element is the request for the + manageWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + manageWebWallet method + + + + + + + + + + + + + + This element is the request for the + createWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + createWebWallet method + + + + + + + + + + + + + + This element is the request for the + updateWebWallet + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + updateWebWallet method + + + + + + + + + + + + + + This element is the request for the + getWebWallet + method + + + + + + + + + + + + + This element is the reponse from the + getWebWallet + method + + + + + + + + + + + + + + + + + + + This element is the request for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + This element is the response for the + getTransactionDetails method + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + transactionsSearch method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the response for the + transactionsSearch method + + + + + + + + + + + + + This element is the request for the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + + This element is the reponse from the + verifyEnrollment method + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the + doAuthentication method + + + + + + + + + + + + + + + + This element is the reponse from the + doAuthentication method + + + + + + + + + + + + + + This element is the request for the + doScoringCheque + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doScoringCheque method + + + + + + + + + + + + + + This element is the request for the + getEncryptionKeyRequest method + + + + + + + + + This element is the reponse from the + getEncryptionKeyResponse method + + + + + + + + + + + + + This element is the request for the + doReAuthorization method + + + + + + + + + + + + + + + + + This element is the reponse from the + doReAuthorization method + + + + + + + + + + + + + + + This element is the request for the + getMerchantSettings method + + + + + + + + + + + + This element is the response from the + getMerchantSettings method + + + + + + + + + + + + + + + + + + + This element is the request for the + getBalance + method + + + + + + + + + + + + + + This element is the reponse from the + getBalance + method + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element is the request for the doBankTransfer + method + + + + + + + + + + + + + + + + + This element is the reponse from the + doBankTransfer method + + + + + + + + + + + + + + This element is the request for the + isRegistered method + + + + + + + + + + + + + + + + This element is the reponse from the + isRegistered method + + + + + + + + + + + + + + + + This element contains information about the + process + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + order + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + encryptionKey + + + + + + + + + + + + + This element contains an array of orderDetail + + + + + + + + + + + This element contains information about the + order + product + + + + + + + + + + + + + + + + + + + This element contains information about the + merchant + private data + + + + + + + + + + + This element contains information about the + transaction + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + fraud + result details + + + + + + + + + + + + This element contains information about the + payment + + + + + + + + + + + + + + + + + + + This element contains information about the + authorization + + + + + + + + + + + This element contains information about the paymentData + + + + + + + + + + + + This element contains information about the card + + + + + + + + + + + + + + + + + + + + + This element contains information about the + buyer + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + owner + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + address + + + + + + + + + + + + + + This element contains information about the + capture + + + + + + + + + + + This element contains information about the + refund + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + An array of private data + + + + + + + + + + + This element contains the result of the address verification service + + + + + + + + + + + + An array of contract number of a wallet + + + + + + + + + + An array of cards + + + + + + + + + + This element contains element for recurring + operation + + + + + + + + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a billing + record + + + + + + + + + + + + + + + + + An array of billing record + + + + + + + + + + + This element contains element for update a recurring + operation + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + This element contains element for a wallet + + + + + + + + + + + + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains the list of selected card + + + + + + + + + + This element contains element for a 3DSecure + transaction + + + + + + + + + + + + + + + + + + + This element contains the merchant connection + parameters + + + + + + + + + + + + + + This element contains the scoring cheque parameters + + + + + + + + + + + + + This element contains information about Interlocutor + address + + + + + + + + + + + + + + + This element contains information about Interlocutor + + + + + + + + + + + + + + + + This element contains IBAN information + + + + + + + + + + + + + This element contains RIB information + + + + + + + + + + + + This element contains bankAccount information + + + + + + + + + + + + + This element contains bank Account information + + + + + + + + + + + + + This element contains technical data used to define + acquirer service + + + + + + + + + + + + This element contains all information about contract + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains all information about + customPaymentPageCode + + + + + + + + + + + + This element contains information e-ticket + + + + + + + + + + + This element contains all information about point of + sell + + + + + + + Merchant Category Code + + + + + + + + + + + + + + + + + + + + list of contract + + + + + + + + + + + list of custom payment page code + + + + + + + + + + + + virtualTerminal + + + + + + http session timeout delay + + + + + path to logo + + + + + list of functions + + + + + + + + + + + + functions availbe in virtual terminal + + + + + + Please refer to Payline documentation + + + + + + + + + + + + + + + Value of parameter + + + + + Parameter ID. Refer to payline documentation + + + + + + + + + + + + This element contains information about the + cheque + + + + + + + + + + This element contains all information about + contrinution + + + + + + + + + + + + + + + This element contains information about the + associated transactions + + + + + + + + + + + + + + + + An array of associatedTransactions + + + + + + + + + + + This element contains information about the + status + History + + + + + + + + + + + + + + + + An array of statusHistory + + + + + + + + + + This element contains information about the + paymentAdditional + + + + + + + + + + + + + + + + An array of paymentAdditionalList + + + + + + + + + + + An array of CustomerTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of PaymentMeansTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + An array of AlertsTrans + + + + + + + + + + + + + + + + + + + + + + + + + + + + This element contains information about the + creditor + + + + + + + + + + + + + This element contains information about a subMerchant associated with a Payment Facilitator + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +