-
Notifications
You must be signed in to change notification settings - Fork 0
/
pm.php
31 lines (25 loc) · 774 Bytes
/
pm.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
<?php
header("Access-Control-Allow-Origin: *");
if ($_POST) {
$customer_id = "";
$sandbox_api_key = "";
$curl = curl_init("https://api.postmates.com/v1/customers/" . $customer_id . "/deliveries");
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($_POST));
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Basic ' . base64_encode($sandbox_api_key . ":")
)
);
echo curl_exec($curl);
curl_close($curl);
}
else {
echo json_encode(
array(
'error' => TRUE,
'message' => 'No post data found in request!'
)
);
}
exit;
?>