@@ -44,7 +44,7 @@ public function isValidAuth($merchant = '')
44
44
$ this ->initCurl (
45
45
$ this ->_endpoint .
46
46
'/merchants ' .
47
- $ merchant ?'/ ' .$ merchant :'' .
47
+ ( $ merchant ?'/ ' .$ merchant :'' ) .
48
48
'/credentials '
49
49
);
50
50
curl_setopt ($ this ->ch , CURLOPT_CUSTOMREQUEST , 'GET ' );
@@ -87,6 +87,7 @@ public function getIdentificationForm($uri, $options = array())
87
87
$ this ->sendRequest ();
88
88
$ this ->dealWithResponse ();
89
89
curl_close ($ this ->ch );
90
+ return $ this ->curl_result ;
90
91
}
91
92
92
93
public function sendIdentificationForm ($ uri , $ options = array ())
@@ -98,6 +99,7 @@ public function sendIdentificationForm($uri, $options = array())
98
99
$ this ->verbThePayload ('POST ' , $ options );
99
100
$ this ->dealWithResponse ();
100
101
curl_close ($ this ->ch );
102
+ return $ this ->curl_result ;
101
103
}
102
104
103
105
public function startCards ($ order )
@@ -188,6 +190,9 @@ public function orderUpdate($order)
188
190
$ this ->initCurl ($ uri );
189
191
$ this ->verbThePayload ('PUT ' , array ('order ' => $ order ));
190
192
$ this ->dealWithResponse ();
193
+ if ($ this ->status == 409 ) {
194
+ $ this ->cart_has_changed = true ;
195
+ }
191
196
curl_close ($ this ->ch );
192
197
}
193
198
@@ -291,12 +296,12 @@ private function sendRequest()
291
296
292
297
private function dealWithResponse ()
293
298
{
299
+ $ this ->json = json_decode ($ this ->curl_result , true );
294
300
if (200 <= $ this ->status && $ this ->status <= 299 ) {
295
301
$ this ->success = true ;
296
302
$ this ->log ("Start " . $ this ->status . ": Ok! " );
297
303
} else {
298
304
$ this ->success = false ;
299
- $ this ->json = json_decode ($ this ->curl_result , true );
300
305
$ this ->log ("Start " . $ this ->status . ": " . $ this ->curl_result );
301
306
}
302
307
}
0 commit comments