Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

Commit

Permalink
4.53
Browse files Browse the repository at this point in the history
  • Loading branch information
PaylineGitHub committed Jan 11, 2018
1 parent 25a0423 commit 0755ec4
Show file tree
Hide file tree
Showing 6 changed files with 3,697 additions and 82 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
84 changes: 43 additions & 41 deletions src/Payline/Order.php
Original file line number Diff line number Diff line change
@@ -1,42 +1,44 @@
<?php
/*
* This file is part of the Payline package.
*
* (c) Monext <http://www.monext.net>
*
* 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;
<?php
/*
* This file is part of the Payline package.
*
* (c) Monext <http://www.monext.net>
*
* 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;
}
83 changes: 74 additions & 9 deletions src/Payline/PaylineSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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();
}
}

/**
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand Down Expand Up @@ -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');
}
Expand All @@ -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');
}
Expand Down Expand Up @@ -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'];
Expand Down Expand Up @@ -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');
}

/*
* *************************************************************************
Expand Down Expand Up @@ -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'])) {
Expand Down
64 changes: 33 additions & 31 deletions src/Payline/Payment.php
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
<?php
/*
* This file is part of the Payline package.
*
* (c) Monext <http://www.monext.net>
*
* 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;
<?php
/*
* This file is part of the Payline package.
*
* (c) Monext <http://www.monext.net>
*
* 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;
}
38 changes: 38 additions & 0 deletions src/Payline/SubMerchant.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?php
/*
* This file is part of the Payline package.
*
* (c) Monext <http://www.monext.net>
*
* 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;
}
Loading

0 comments on commit 0755ec4

Please sign in to comment.