【发布时间】:2018-12-20 13:40:52
【问题描述】:
我想做的是验证 Paypal 付款的交易 ID。但是paypal给我回了一个:
{"name":"INVALID_RESOURCE_ID","message":"Requested resource ID was not found.","information_link":"https:\/\/developer.paypal.com\/docs\/api\/payments\/#errors"}
我现在的代码是这样的:
$curl = curl_init("https://api.sandbox.paypal.com/v1/payments/payment/<transaction_id>");
curl_setopt($curl, CURLOPT_POST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($curl, CURLOPT_HEADER, false);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HTTPHEADER, array(
'Authorization: Bearer ' . '<changed this to my access token>',
'Accept: application/json',
'Content-Type: application/json'
));
$response = curl_exec($curl);
$result = json_decode($response);
【问题讨论】: