Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $curl = curl_init();
- $payload = "grant_type=authorization_code&code=".$_GET['code']."&redirect_uri=https://mdeliverywine.co.uk/ups/callback&client_id=4AGdWW41GyA3ehKAM3OzyK5vZiLgnXBxrjSfdkrYqY2PxXbV";
- curl_setopt_array($curl, [
- CURLOPT_HTTPHEADER => [
- "Content-Type: application/x-www-form-urlencoded",
- "Authorization: Basic bWRlbGl2ZXJ5NDgyOnp5bmhpay1jb3d3RWQtM3FpeHJ1"
- ],
- CURLOPT_POSTFIELDS => $payload,
- CURLOPT_URL => "https://wwwcie.ups.com/security/v1/oauth/token",
- CURLOPT_RETURNTRANSFER => true,
- CURLOPT_CUSTOMREQUEST => "POST",
- ]);
- $response = curl_exec($curl);
- $error = curl_error($curl);
- curl_close($curl);
- if ($error) {
- echo "cURL Error #:" . $error;
- } else {
- echo $response;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement