gpt4 book ai didi

php - 我的代码有什么问题( future 支付服务器端集成)

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

这是我的 php 代码,请从这里找到 error.code refrence https://github.com/paypal/PayPal-iOS-SDK/blob/master/docs/future_payments_server.md

 $acces_token="A103.LhXuh7MZlAXK-4Vw6jJn9Q7m__ncsJHMDkkpUouekljaXxoNoCGNVkQanDcp9Jyt.9s7Yk5J9UoulgI3aGZNgZp3pwPy";
$Metadata_id="28c5sss8d309db24639bb1b76ca2419a850";
$data=array(
"intent"=>"authorize",
"payer"=>array(
"payment_method"=>"paypal"
),
"transactions"=>array(
array( "amount"=>array(
"currency"=>"USD",
"total"=>"1.88"
),
"description"=>"future of sauces")
));

$data_string = json_encode($data);
$ch = curl_init( "https://api.sandbox.paypal.com/v1/payments/payment" );

curl_setopt_array( $ch, array(
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json',
'PayPal-Client-Metadata-Id: ' . $Metadata_id,
'Authorization: Bearer ' . $acces_token
),
CURLOPT_POSTFIELDS => $data_string

)
);

$result = curl_exec( $ch );
$information = curl_getinfo($ch);
curl_close($ch);
print_r($information);die;

响应是

{"name":"PERMISSION_DENIED","message":"No permission for the requested operation","information_link":"https://developer.paypal.com/docs/api/#PERMISSION_DENIED","debug_id":"4fb7372e76089"}

最佳答案

我认为您需要为您的应用启用权限才能使用 future 的付款方式。检查您的权限:

  1. 转到http://developer.paypal.com/并登录
  2. 转到https://developer.paypal.com/developer/accountStatus在那里你可以看到你有什么许可证。

您还可以在此处获取有关使用您的应用上线的一些信息: https://developer.paypal.com/docs/classic/lifecycle/goingLive/

关于php - 我的代码有什么问题( future 支付服务器端集成),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35794515/

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