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

Commit

Permalink
upgrade 4.73
Browse files Browse the repository at this point in the history
  • Loading branch information
vpietri-tbd authored and thomasmonext committed Feb 6, 2023
1 parent ae411bc commit f5fdf03
Show file tree
Hide file tree
Showing 6 changed files with 121 additions and 4 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
----------------------------------------

* 4.73 (2023-01-20)
* Update WSDL from 4.72 to 4.73
* Fix proxy usage
* Fix exception log

----------------------------------------

* 4.72.1 (2023-01-09)
* fix missing namespace on address for buyer and wallet

Expand Down
13 changes: 10 additions & 3 deletions src/Payline/PaylineSDK.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ 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.72.1';
const SDK_RELEASE = 'PHP SDK 4.73';

/**
* development environment flag
Expand Down Expand Up @@ -1104,6 +1104,9 @@ protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI

$WSRequest = $this->completeWSRequest($array, $WSRequest, $PaylineAPI, $Method);

$client = false;
$logRequest = array();

try {
if(!$this->webServicesEndpoint){
throw new \Exception('Endpoint error (check `environment` parameter of PaylineSDK constructor)');
Expand Down Expand Up @@ -1178,7 +1181,9 @@ protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI
}
return $response;
} catch (\Exception $e) {
$this->logger->info($Method . 'Request', $logRequest);
if($logRequest) {
$this->logger->info($Method . 'Request', $logRequest);
}
$this->logger->error('Exception occured at ' . $Method . ' call', array(
'code' => $e->getCode(),
'message' => $e->getMessage(),
Expand All @@ -1193,7 +1198,9 @@ protected function webServiceRequest(array $array, array $WSRequest, $PaylineAPI

return $ERROR;
} finally {
$this->lastSoapCallData = $client->retrieveSoapLastContent();
if($client) {
$this->lastSoapCallData = $client->retrieveSoapLastContent();
}
}
}

Expand Down
30 changes: 29 additions & 1 deletion src/Payline/WebserviceClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,11 @@ protected function buildClientSdk($location, $extraOptions = array())
$defaultOptions['trace'] = false;

$options = array_merge($defaultOptions, $this->soapOptions);
if(empty($options['proxy_login'])) {
unset($options['proxy_login']);
unset($options['proxy_password']);
}

if(!empty($extraOptions)) {
$options = $this->array_merge_recursive_distinct($options, $extraOptions);
}
Expand Down Expand Up @@ -368,6 +373,9 @@ protected function buildClientSdk($location, $extraOptions = array())

$sdkClient->__setLocation($location);

unset($options['proxy_login']);
unset($options['proxy_password']);

return $sdkClient;
}

Expand Down Expand Up @@ -440,6 +448,18 @@ protected function getAllFailoverServicesEndpoint()
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $this->endpointsDirectoryLocation);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

// Use proxy parameters (from soap options in webclient)
if (!empty($this->soapOptions['proxy_host'])) {
$proxy = $this->soapOptions['proxy_host'].':'.$this->soapOptions['proxy_port'];
curl_setopt($ch, CURLOPT_PROXY, $proxy);

if(!empty($this->soapOptions['proxy_login']) && !empty($this->soapOptions['proxy_password'])) {
$proxyAuth = $this->soapOptions['proxy_login'] . ':' . $this->soapOptions['proxy_password'];
curl_setopt($ch, CURLOPT_PROXYUSERPWD, $proxyAuth);
}
}

$jsonContent = curl_exec($ch);
curl_close($ch);
break;
Expand All @@ -449,14 +469,22 @@ protected function getAllFailoverServicesEndpoint()
'method'=>"GET"
)
);
// Use proxy parameters (from soap options in webclient)
if (!empty($this->soapOptions['proxy_host'])) {
$opts['http']['proxy'] = $this->soapOptions['proxy_host'].':'.$this->soapOptions['proxy_port'];
$opts['http']['request_fulluri'] = true;
if(!empty($this->soapOptions['proxy_login']) && !empty($this->soapOptions['proxy_password'])) {
$proxyAuth = base64_encode($this->soapOptions['proxy_login'] . ':' . $this->soapOptions['proxy_password']);
$opts['http']['header'] = "Proxy-Authorization: Basic " . $proxyAuth;
}
}
$context = stream_context_create($opts);
$jsonContent = file_get_contents($this->endpointsDirectoryLocation, false, $context);
break;
default:
break;
}


if(!empty($jsonContent)) {
$endpointData = json_decode($jsonContent, true);
if (!empty($endpointData['urls']) && is_array($endpointData['urls'])) {
Expand Down
25 changes: 25 additions & 0 deletions src/Payline/wsdl/DirectPaymentAPI.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@
<element minOccurs="0" name="virtualCvx" nillable="true" type="xsd:string"/>
<element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
<element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
<element minOccurs="0" name="sdkChallenge" nillable="true" type="tns1:sdkChallenge"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1192,6 +1193,7 @@
</annotation>
<sequence>
<element name="version" nillable="true" type="xsd:string"/>
<element name="merchantKeyName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1643,6 +1645,7 @@
<sequence>
<element name="keyId" nillable="false" type="xsd:integer"/>
<element name="modulus" nillable="false" type="xsd:string"/>
<element name="merchantKeyName" nillable="false" type="xsd:string"/>
<element name="publicExponent" nillable="false" type="xsd:string"/>
<element name="expirationDate" nillable="false" type="xsd:string"/>
<element name="cipher" nillable="true" type="xsd:string"/>
Expand Down Expand Up @@ -2892,6 +2895,28 @@
<element name="date" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="sdkChallenge">
<annotation>
<documentation>
This element contains information about SDK 3DS Challenge.
</documentation>
</annotation>
<sequence>
<element name="cardType" type="xsd:string"/>
<element name="threeDSServerTransID" type="xsd:string"/>
<element name="threeDSVersion" type="xsd:string"/>
<element name="authenticationType" type="xsd:string"/>
<element name="transStatus" type="xsd:string"/>
<element name="sdkTransID" type="xsd:string"/>
<element name="dsTransID" type="xsd:string"/>
<element name="acsTransID" type="xsd:string"/>
<element name="acsRenderingType" type="xsd:string"/>
<element name="acsReferenceNumber" type="xsd:string"/>
<element name="acsSignedContent" type="xsd:string"/>
<element name="acsOperatorID" type="xsd:string"/>
<element name="acsChallengeMandated" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getTransactionDetailsRequest">
Expand Down
25 changes: 25 additions & 0 deletions src/Payline/wsdl/ExtendedAPI.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@
<element minOccurs="0" name="virtualCvx" nillable="true" type="xsd:string"/>
<element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
<element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
<element minOccurs="0" name="sdkChallenge" nillable="true" type="tns1:sdkChallenge"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1192,6 +1193,7 @@
</annotation>
<sequence>
<element name="version" nillable="true" type="xsd:string"/>
<element name="merchantKeyName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1643,6 +1645,7 @@
<sequence>
<element name="keyId" nillable="false" type="xsd:integer"/>
<element name="modulus" nillable="false" type="xsd:string"/>
<element name="merchantKeyName" nillable="false" type="xsd:string"/>
<element name="publicExponent" nillable="false" type="xsd:string"/>
<element name="expirationDate" nillable="false" type="xsd:string"/>
<element name="cipher" nillable="true" type="xsd:string"/>
Expand Down Expand Up @@ -2892,6 +2895,28 @@
<element name="date" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="sdkChallenge">
<annotation>
<documentation>
This element contains information about SDK 3DS Challenge.
</documentation>
</annotation>
<sequence>
<element name="cardType" type="xsd:string"/>
<element name="threeDSServerTransID" type="xsd:string"/>
<element name="threeDSVersion" type="xsd:string"/>
<element name="authenticationType" type="xsd:string"/>
<element name="transStatus" type="xsd:string"/>
<element name="sdkTransID" type="xsd:string"/>
<element name="dsTransID" type="xsd:string"/>
<element name="acsTransID" type="xsd:string"/>
<element name="acsRenderingType" type="xsd:string"/>
<element name="acsReferenceNumber" type="xsd:string"/>
<element name="acsSignedContent" type="xsd:string"/>
<element name="acsOperatorID" type="xsd:string"/>
<element name="acsChallengeMandated" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getTransactionDetailsRequest">
Expand Down
25 changes: 25 additions & 0 deletions src/Payline/wsdl/WebPaymentAPI.wsdl
Original file line number Diff line number Diff line change
Expand Up @@ -1109,6 +1109,7 @@
<element minOccurs="0" name="virtualCvx" nillable="true" type="xsd:string"/>
<element minOccurs="0" name="token" nillable="true" type="xsd:string"/>
<element name="privateDataList" nillable="true" type="tns1:privateDataList"/>
<element minOccurs="0" name="sdkChallenge" nillable="true" type="tns1:sdkChallenge"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1192,6 +1193,7 @@
</annotation>
<sequence>
<element name="version" nillable="true" type="xsd:string"/>
<element name="merchantKeyName" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
</element>
Expand Down Expand Up @@ -1643,6 +1645,7 @@
<sequence>
<element name="keyId" nillable="false" type="xsd:integer"/>
<element name="modulus" nillable="false" type="xsd:string"/>
<element name="merchantKeyName" nillable="false" type="xsd:string"/>
<element name="publicExponent" nillable="false" type="xsd:string"/>
<element name="expirationDate" nillable="false" type="xsd:string"/>
<element name="cipher" nillable="true" type="xsd:string"/>
Expand Down Expand Up @@ -2892,6 +2895,28 @@
<element name="date" nillable="true" type="xsd:string"/>
</sequence>
</complexType>
<complexType name="sdkChallenge">
<annotation>
<documentation>
This element contains information about SDK 3DS Challenge.
</documentation>
</annotation>
<sequence>
<element name="cardType" type="xsd:string"/>
<element name="threeDSServerTransID" type="xsd:string"/>
<element name="threeDSVersion" type="xsd:string"/>
<element name="authenticationType" type="xsd:string"/>
<element name="transStatus" type="xsd:string"/>
<element name="sdkTransID" type="xsd:string"/>
<element name="dsTransID" type="xsd:string"/>
<element name="acsTransID" type="xsd:string"/>
<element name="acsRenderingType" type="xsd:string"/>
<element name="acsReferenceNumber" type="xsd:string"/>
<element name="acsSignedContent" type="xsd:string"/>
<element name="acsOperatorID" type="xsd:string"/>
<element name="acsChallengeMandated" type="xsd:string"/>
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="getTransactionDetailsRequest">
Expand Down

0 comments on commit f5fdf03

Please sign in to comment.