From e6203391cadd0af3f350b165ca991b5bce18d6f2 Mon Sep 17 00:00:00 2001 From: Fabien SUAREZ Date: Tue, 7 Mar 2017 11:31:17 +0100 Subject: [PATCH] 4.49.1 --- src/Payline/PaylineSDK.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Payline/PaylineSDK.php b/src/Payline/PaylineSDK.php index c4e850d..f0d858f 100644 --- a/src/Payline/PaylineSDK.php +++ b/src/Payline/PaylineSDK.php @@ -40,7 +40,7 @@ class PaylineSDK /** * Payline release corresponding to this version of the package */ - const SDK_RELEASE = 'PHP SDK 4.49'; + const SDK_RELEASE = 'PHP SDK 4.49.1'; /** * WSDL file name @@ -361,6 +361,8 @@ function __construct($merchant_id, $access_key, $proxy_host, $proxy_port, $proxy } elseif (strcmp($environment, PaylineSDK::ENV_INT) == 0) { $this->webServicesEndpoint = PaylineSDK::INT_ENDPOINT; $plnInternal = true; + }else{ + $this->webServicesEndpoint = false; // Exception is raised in PaylineSDK::webServiceRequest } $this->soapclient_options['style'] = defined('SOAP_DOCUMENT') ? SOAP_DOCUMENT : 2; $this->soapclient_options['use'] = defined('SOAP_LITERAL') ? SOAP_LITERAL : 2; @@ -843,6 +845,9 @@ private function webServiceRequest($array, $WSRequest, $PaylineAPI, $Method) 'result.code' => null ); try { + if(!$this->webServicesEndpoint){ + throw new \Exception('Endpoint error (check `environment` parameter of PaylineSDK constructor)'); + } $client = new SoapClient(dirname(__FILE__) . '/' . PaylineSDK::WSDL, $this->soapclient_options); $client->__setLocation($this->webServicesEndpoint . $PaylineAPI);