55use Verinder \PrestashopWebService \Exceptions \PrestashopWebServiceException ;
66use Verinder \PrestashopWebService \Exceptions \PrestashopWebServiceRequestException ;
77use SimpleXMLElement ;
8- use \Support \Facades \Log ;
8+ use \Illuminate \ Support \Facades \Log ;
99/**
1010 * @package PrestaShopWebService
1111 */
@@ -28,7 +28,7 @@ class PrestashopWebServiceLibrary
2828 protected $ runningInConsole ;
2929
3030 /** @var array compatible versions of PrestaShop WebService */
31- const PS_COMPATIBLE_VERSION_MIN = '1.4 .0.0 ' ;
31+ const PS_COMPATIBLE_VERSION_MIN = '1.6 .0.0 ' ;
3232 const PS_COMPATIBLE_VERSION_MAX = '1.7.99.99 ' ;
3333
3434 /**
@@ -88,7 +88,7 @@ protected function checkRequest($request, $format = 'XML')
8888 500 => 'Internal Server Error ' ,
8989 );
9090
91- if (isset ($ messages [$ request ['status_code ' ]])) {
91+ if (isset ($ messages [$ request ['status_code ' ]])) {
9292 $ xml = null ;
9393 if ($ request ['response ' ]) {
9494 if ($ format === 'XML ' ) {
@@ -188,6 +188,7 @@ protected function executeRequest($url, $curl_params = array())
188188 if ($ curl_params [CURLOPT_CUSTOMREQUEST ] == 'PUT ' || $ curl_params [CURLOPT_CUSTOMREQUEST ] == 'POST ' ) {
189189 $ this ->printDebug ('XML SENT ' , urldecode ($ curl_params [CURLOPT_POSTFIELDS ]));
190190 }
191+ $ this ->printDebug ('RETURN HTTP BODY ' , $ body );
191192 if ($ curl_params [CURLOPT_CUSTOMREQUEST ] != 'DELETE ' && $ curl_params [CURLOPT_CUSTOMREQUEST ] != 'HEAD ' ) {
192193 $ this ->printDebug ('RETURN HTTP BODY ' , $ body );
193194 }
@@ -217,6 +218,7 @@ protected function executeCurl($url, array $options = array())
217218 $ response = curl_exec ($ session );
218219
219220 $ error = false ;
221+ $ info = false ;
220222 if ($ response === false ) {
221223 $ error = curl_error ($ session );
222224 } else {
@@ -476,7 +478,7 @@ public function edit($options)
476478 $ url .= '&id_group_shop= ' .$ options ['id_group_shop ' ];
477479 }
478480 if (isset ($ options ['output_format ' ])) {
479- $ url .= '&output_format= ' .$ options ['output_format ' ];
481+ $ url .= '&output_format= ' .$ options ['output_format ' ];
480482 }
481483 } else {
482484 throw new PrestashopWebServiceException ('Bad parameters given ' );
@@ -485,7 +487,7 @@ public function edit($options)
485487 (isset ($ options ['output_format ' ]) === true )
486488 ? $ options ['output_format ' ]
487489 : 'XML ' ;
488- $ request = self ::executeRequest ($ url , array (CURLOPT_CUSTOMREQUEST => 'PUT ' , CURLOPT_POSTFIELDS => $ xml ));
490+ $ request = self ::executeRequest ($ url , array (CURLOPT_CUSTOMREQUEST => 'PUT ' , CURLOPT_POSTFIELDS => $ xml ));
489491 $ this ->checkRequest ($ request , $ outputFormat );
490492 return self ::parseResponse ($ request ['response ' ], $ outputFormat );
491493 }
0 commit comments