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

Commit

Permalink
Merge pull request #68 from PaylineByMonext/integration
Browse files Browse the repository at this point in the history
Integration TBD
  • Loading branch information
monext-ofrancome authored Jan 15, 2021
2 parents e2b0861 + d459ded commit 86dd172
Show file tree
Hide file tree
Showing 10 changed files with 1,590 additions and 7,670 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
* 4.64.1 (2020-01-06)
* wsdl upgrade and split wsdl in three files
* new properties authorizedCurrency, authorizedAmount in Authorization
* new property challengeWindowSize in threeDSInfo
* new property challengeWindowSize in threeDSInfo
* support php 7.4 replace array_key_exists by property_exists on object
* allow to customize waiting time when connecting to Payline servers
* format request for UpdateWallet call
* fix phpdoc for logger

* 4.59 (2019-07-28)
* wsdl upgrade
* new threeDSInfo parameter for manageWebWallet and doWebPayment
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Usage
use Payline\PaylineSDK;

// create an instance
$paylineSDK = new PaylineSDK($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment[, $pathLog= null[, $logLevel = Logger::INFO[, $externalLogger = null[, $defaultTimezone = "Europe/Paris"]]]]);
$paylineSDK = new PaylineSDK($merchant_id,$access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment[, $pathLog= null[, $logLevel = Logger::INFO[, $externalLogger = null[, $defaultTimezone = "Europe/Paris"]]]]);
/*
$merchant_id, the merchant identifier, has to be a string.
$environment determines in which Payline environment your request are targeted.
Expand All @@ -21,6 +21,11 @@ Usage

// call a web service, for example doWebPayment
$doWebPaymentRequest = array();

$doWebPaymentRequest['cancelURL'] = 'https://Demo_Shop.com/cancelURL.php';
$doWebPaymentRequest['returnURL'] = 'https://Demo_Shop.com/returnURL.php';
$doWebPaymentRequest['notificationURL'] = 'https://Demo_Shop.com/notificationURL.php';


// PAYMENT
$doWebPaymentRequest['payment']['amount'] = 1000; // this value has to be an integer amount is sent in cents
Expand Down
5 changes: 4 additions & 1 deletion src/Payline/Authorization.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@

class Authorization
{

public $number;

public $date;

public $authorizedAmount;

public $authorizedCurrency;
}
48 changes: 25 additions & 23 deletions src/Payline/PaylineSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,9 @@ class PaylineSDK

/**
* Payline release corresponding to this version of the package
* @see https://docs.payline.com/display/DT/API+version+history
*/
const SDK_RELEASE = 'PHP SDK 4.59';

/**
* WSDL file name
*/
const WSDL = 'v4.59.wsdl';
const SDK_RELEASE = 'PHP SDK 4.64.1';

/**
* development environment flag
Expand Down Expand Up @@ -309,7 +305,7 @@ class PaylineSDK
const ERR_SHORT_MESSAGE = 'ERROR';

/**
* Monolog\Logger instance
* @var Logger
*/
private $logger;

Expand Down Expand Up @@ -370,9 +366,9 @@ class PaylineSDK
* @param string $pathLog
* path to your custom log folder, must end by directory separator. If null, default logs folder is used. Default : null
* @param int $logLevel
* Monolog\Logger log level. Default : Logger::INFO
* @param Monolog\Logger $externalLogger
* Monolog\Logger instance, used by PaylineSDK but external to it
* \Monolog\Logger log level. Default : Logger::INFO
* @param Logger $externalLogger
* \Monolog\Logger instance, used by PaylineSDK but external to it
*/
public function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null, $logLevel = Logger::INFO, $externalLogger = null, $defaultTimezone = "Europe/Paris")
{
Expand Down Expand Up @@ -431,7 +427,7 @@ public function __construct($merchant_id, $access_key, $proxy_host, $proxy_port,
}
$this->soapclient_options['style'] = defined('SOAP_DOCUMENT') ? SOAP_DOCUMENT : 2;
$this->soapclient_options['use'] = defined('SOAP_LITERAL') ? SOAP_LITERAL : 2;
$this->soapclient_options['connection_timeout'] = 5;
$this->soapclient_options['connection_timeout'] = defined('SOAP_CONNECTION_TIMEOUT') ? SOAP_CONNECTION_TIMEOUT : 5;
$this->soapclient_options['trace'] = false;
$this->soapclient_options['soap_client'] = false;
if($plnInternal){
Expand Down Expand Up @@ -504,7 +500,7 @@ protected function order(array $array)
$order = new Order();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $order) && (strlen($v))) {
if (property_exists($order, $k) && (strlen($v))) {
$order->$k = $v;
}
}
Expand All @@ -526,7 +522,7 @@ protected function card(array $array)
$card = new Card();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $card) && (strlen($v))) {
if (property_exists($card, $k) && (strlen($v))) {
$card->$k = $v;
}
}
Expand Down Expand Up @@ -556,7 +552,7 @@ protected function buyer(array $array, array $shippingAdress, array $billingAddr
$buyer = new Buyer();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $buyer) && (strlen($v))) {
if (property_exists($buyer, $k) && (strlen($v))) {
$buyer->$k = $v;
}
}
Expand Down Expand Up @@ -607,7 +603,7 @@ protected function owner(array $array, array $addressOwner)
$owner = new Owner();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $owner) && (strlen($v))) {
if (property_exists($owner, $k) && (strlen($v))) {
$owner->$k = $v;
}
}
Expand Down Expand Up @@ -671,7 +667,7 @@ protected function wallet(array $inWallet, array $address, array $card)
$wallet = new Wallet();
if ($inWallet) {
foreach ($inWallet as $k => $v) {
if (array_key_exists($k, $wallet) && (strlen($v))) {
if (property_exists($wallet, $k) && (strlen($v))) {
$wallet->$k = $v;
}
}
Expand Down Expand Up @@ -755,11 +751,12 @@ protected function subMerchant(array $array)
* the array keys liste in Sdk CLASS.
* @return SoapVar representation of ThreeDSInfo instance
*/
protected function threeDSInfo(array $array, array $arrayBrowser, array $arraySdk) {
protected function threeDSInfo(array $array, array $arrayBrowser, array $arraySdk)
{
$threeDSInfo = new ThreeDSInfo();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $array) && (strlen($v))) {
if (property_exists($threeDSInfo, $k) && (strlen($v))) {
$threeDSInfo->$k = $v;
}
}
Expand Down Expand Up @@ -966,6 +963,11 @@ private static function formatRequest(&$array)
if (!isset($array['threeDSInfo'])) {
$array['threeDSInfo'] = array();
}
if (!isset($array['updatePersonalDetails'])) {
$array['updatePersonalDetails'] = null;
}


}

/**
Expand Down Expand Up @@ -993,7 +995,7 @@ protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI
if ($this->soapclient_options['soap_client'] instanceof \SoapClient) {
$client = $this->soapclient_options['soap_client'];
} else {
$client = new SoapClient(__DIR__ . '/' . self::WSDL, $this->soapclient_options);
$client = new SoapClient(__DIR__ . '/wsdl/' . $PaylineAPI . '.wsdl', $this->soapclient_options);
}
$client->__setLocation($this->webServicesEndpoint . $PaylineAPI);

Expand Down Expand Up @@ -1356,7 +1358,7 @@ public function usedBy($toolName)
}

/**
* returns Monolog\Logger instance
* @return Logger \Monolog\Logger instance
*/
public function getLogger()
{
Expand All @@ -1374,7 +1376,7 @@ public function addOrderDetail(array $newOrderDetail)
$orderDetail = new OrderDetail();
if ($newOrderDetail) {
foreach ($newOrderDetail as $k => $v) {
if (array_key_exists($k, $orderDetail) && (strlen($v))) {
if (property_exists($orderDetail, $k) && (strlen($v))) {
$orderDetail->$k = $v;
}
}
Expand All @@ -1394,7 +1396,7 @@ public function addPrivateData(array $array)
$private = new PrivateData();
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $private) && (strlen($v))) {
if (property_exists($private, $k) && (strlen($v))) {
$private->$k = $v;
}
}
Expand Down Expand Up @@ -2470,7 +2472,7 @@ protected function buildSoapObject(array $array, $object, $typeName)
{
if ($array) {
foreach ($array as $k => $v) {
if (array_key_exists($k, $object) && (strlen($v))) {
if (property_exists($object, $k) && (strlen($v))) {
$object->$k = $v;
}
}
Expand Down
2 changes: 2 additions & 0 deletions src/Payline/ThreeDSInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,7 @@ class ThreeDSInfo {
public $threeDSMethodNotificationURL;

public $threeDSMethodResult;

public $challengeWindowSize;
}

Loading

0 comments on commit 86dd172

Please sign in to comment.