Skip to content

Commit 01e6410

Browse files
authored
[add] orderUpdate to update confirmed orders
1 parent d651596 commit 01e6410

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/Client.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,23 @@ public function sendDeliveryReport($delivery_report)
208208
curl_close($this->ch);
209209
}
210210

211+
public function orderUpdate($order)
212+
{
213+
$uri = $this->_endpoint .
214+
'/merchants/' . $order['merchant']['id'] .
215+
'/orders/' . $order['merchant_reference']['order_ref_1'];
216+
$this->initCurl($uri);
217+
$this->verbThePayload('PUT', array('order' => $order));
218+
219+
if ($this->status >= 200 && $this->status <= 299) {
220+
$this->success = true;
221+
} elseif ($this->status == 409) {
222+
$this->cart_has_changed = true;
223+
$this->json = json_decode($this->curl_result, true);
224+
}
225+
curl_close($this->ch);
226+
}
227+
211228
public function callCron($cron_url)
212229
{
213230
$this->_user_agent = 'sequra-cron';

0 commit comments

Comments
 (0)