-
Notifications
You must be signed in to change notification settings - Fork 5
/
delete_order.php
33 lines (28 loc) · 1007 Bytes
/
delete_order.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/*----
Here we are deleting order by passing order id of that order.
To switch account from sandbox account to production environment you have to change this url to -"https://api.clover.com/" from "https://apisandbox.dev.clover.com/".
-----*/
function delete_order($merchant_id,$access_token,$order_id)
{
$curl=curl_init('https://apisandbox.dev.clover.com/v3/merchants/'.$merchant_id.'/orders/'.$order_id);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
"Authorization:Bearer ".$access_token,
'Content-Type: application/json',
)
);
curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "DELETE");
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$auth = curl_exec($curl);
$info = curl_getinfo($curl);
$order_detail=json_decode($auth);
return $order_detail;
}
/*parameter for deleting order */
$merchant_id="RN2XHHV9PA0BC";
$access_token="0c635734-cccb-58ce-90b3-eb3a1932d01e";
$order_id="M1D76J5RK2A38";
$result= delete_order($merchant_id,$access_token,$order_id);
echo "<pre>";
print_r($result);
?>