【发布时间】:2020-08-09 13:11:35
【问题描述】:
我是 Paypal 智能按钮的新手。
我已经能够成功进行购买,并且在返回我的网站时,我能够获得订单的 ID。
我想验证 transactionID 是否是下一步的合法 ID。
为此,我正在尝试使用 PHP SDK
我已经创建了以下代码
require 'vendor/autoload.php';
$apiContext = new \PayPal\Rest\ApiContext(
new \PayPal\Auth\OAuthTokenCredential(
'sandboxclient',
'sandboxsecret'
)
);
$payment = new \PayPal\Api\Order();
try {
$payment->get("8T0564921E866114V",$apiContext);
echo $payment;
}
catch (\PayPal\Exception\PayPalConnectionException $ex) {
echo $ex->getData();
}
但是我收到一个错误:
{"name":"INVALID_RESOURCE_ID","message":"The requested resource ID was not found","information_link":"https://developer.paypal.com/docs/api/payments/#errors","debug_id":"cae19ebc8e1b1"}```
I tried both the Order API calls and also the Payment API calls, both ended up with the same error. How do I get this to work. Does it matter that I am using the Paypal Sandbox at the moment for this?
【问题讨论】: