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

Commit

Permalink
commit for release 4.49
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabien SUAREZ committed Jan 5, 2017
1 parent eca5307 commit e300e9d
Show file tree
Hide file tree
Showing 4 changed files with 3,542 additions and 11 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

* 4.49 (2017-01-05)
* removal of autoload inclusion in main PaylineSDK.php file
* fix of `SOAP_DOCUMENT` and `SOAP_LITERAL` constants use in main PaylineSDK.php file
* new optional parameters defaultTimezone and externalLogger for PaylineSDK class constructor

* 4.48 (2016-09-13)
* new properties version and TransactionDate for getAlertDetailsRequest

Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ 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]]);
$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.
It should be filled with either PaylineSDK::ENV_HOMO (for testing purpose) or PaylineSDK::ENV_PROD (real life)
If $pathLog is null, log files will be written under default logs directory. Fill with your custom log files path
Expand Down
27 changes: 17 additions & 10 deletions src/Payline/PaylineSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

$vendorPath = realpath(dirname(dirname(dirname(dirname(dirname(__FILE__)))))) . DIRECTORY_SEPARATOR;
$classesPath = $vendorPath . 'monext' . DIRECTORY_SEPARATOR . 'payline-sdk' . DIRECTORY_SEPARATOR . 'src' . DIRECTORY_SEPARATOR . 'Payline' . DIRECTORY_SEPARATOR;
require_once $vendorPath . 'autoload.php';
require_once $classesPath . 'Payment.class.php';
require_once $classesPath . 'Order.class.php';
require_once $classesPath . 'OrderDetail.class.php';
Expand All @@ -41,12 +40,12 @@ class PaylineSDK
/**
* Payline release corresponding to this version of the package
*/
const SDK_RELEASE = 'PHP SDK 4.48';
const SDK_RELEASE = 'PHP SDK 4.49';

/**
* WSDL file name
*/
const WSDL = 'v4.48.wsdl';
const WSDL = 'v4.49.wsdl';

/**
* development environment flag
Expand Down Expand Up @@ -316,11 +315,17 @@ class PaylineSDK
* 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
*/
function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy_login, $proxy_password, $environment, $pathLog = null, $logLevel = Logger::INFO)
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")
{
date_default_timezone_set("Europe/Paris");
$this->logger = new Logger('PaylineSDK');
date_default_timezone_set($defaultTimezone);
if($externalLogger){
$this->logger = $externalLogger;
}else{
$this->logger = new Logger('PaylineSDK');
}
if (is_null($pathLog)) {
$this->logger->pushHandler(new StreamHandler(realpath(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'logs' . DIRECTORY_SEPARATOR . date('Y-m-d') . '.log', $logLevel)); // set default log folder
} elseif (strlen($pathLog) > 0) {
Expand Down Expand Up @@ -357,8 +362,8 @@ function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy
$this->webServicesEndpoint = PaylineSDK::INT_ENDPOINT;
$plnInternal = true;
}
$this->soapclient_options['style'] = defined(SOAP_DOCUMENT) ? SOAP_DOCUMENT : 2;
$this->soapclient_options['use'] = defined(SOAP_LITERAL) ? SOAP_LITERAL : 2;
$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;
if($plnInternal){
$this->soapclient_options['stream_context'] = stream_context_create(
Expand Down Expand Up @@ -1587,9 +1592,11 @@ public function verifyEnrollment($array)
'userAgent' => $array['userAgent'],
'mdFieldValue' => $array['mdFieldValue'],
'walletId' => $array['walletId'],
'walletCardInd' => $array['walletCardInd'],
'generateVirtualCvx' => $array['generateVirtualCvx']
'walletCardInd' => $array['walletCardInd']
);
if (isset($array['generateVirtualCvx'])) {
$WSRequest['generateVirtualCvx'] = $array['generateVirtualCvx'];
}
return $this->webServiceRequest($array, $WSRequest, PaylineSDK::DIRECT_API, 'verifyEnrollment');
}

Expand Down
Loading

0 comments on commit e300e9d

Please sign in to comment.