How to validate paymentID Express Checkout PHP

srinivastamada
Contributor
Contributor
 
<?php

$ch = curl_init('https://api.sandbox.paypal.com/v1/payments/payment/PAY-XXXXXXX');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . $accessToken,
'Accept: application/json',
'Content-Type: application/xml'
));
$result = curl_exec($ch);

?>
 
Response
{"name":"PERMISSION_DENIED","message":"No permission for the requested operation","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"8ab402e2b3366"}
Login to Me Too
1 REPLY 1

angelleye
Advisor
Advisor
What are you passing for the $accessToken? Did you generate that before this snippet runs?
Angell EYE - www.angelleye.com
PayPal Partner and Certified Developer - Kudos are Greatly Appreciated!
Login to Me Too

Haven't Found your Answer?

It happens. Hit the "Login to Ask the community" button to create a question for the PayPal community.