gpt4 book ai didi

laravel - 在 Laravel 中获取 Paypal 付款详细信息时出现 403 错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:39:05 26 4
gpt4 key购买 nike

我想在后端通过交易 ID 获取付款详情。所以只会从前端获取交易 ID,我需要检查这笔付款。

我的交易信息:

{
"id":"8BE39713UM4013017",
"state":"completed",
"payment_mode":"INSTANT_TRANSFER",
"protection_eligibility":"ELIGIBLE",
"parent_payment":"PAYID-LYAS2CA0MC84362BH057454Y",
"create_time":"2019-12-23T21:10:26Z",
"update_time":"2019-12-23T21:10:26Z",
"amount": {
"total":"100.00",
"currency":"USD",
"details": {
"subtotal":"100.00",
"shipping":"0.00",
"handling_fee":"0.00",
"insurance":"0.00",
"shipping_discount":"0.00"
}
}
}

我的 Controller :

public function paypal(){

$payment_token = 'PAYID-LYAS2CA0MC84362BH057454Y';

try {
$paypal_key = config('services.paypal.client_id');
$paypal_secret = config('services.paypal.secret');
$paypal_mode = config('services.paypal.mode');
$apiContext = new ApiContext(new OAuthTokenCredential($paypal_key, $paypal_secret));
$apiContext->setConfig([
'mode' => $paypal_mode
]);
$payment = Payment::get($payment_token, $apiContext);
return $payment;
}
catch (\Exception $exception){
return $exception->getMessage();
}
}

错误是:

Got Http response code 403 when accessing https: //api.sandbox.paypal.com/v1/payments/payment/PAYID-LYAS2CA0MC84362BH057454Y.

最佳答案

403 是拒绝访问的 HTTP 响应代码。

在某种程度上,您无权提出请求,我不熟悉您的用例,但请仔细检查您的详细信息并重新阅读有关该主题的文档。

祝你好运

关于laravel - 在 Laravel 中获取 Paypal 付款详细信息时出现 403 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59461836/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com