gpt4 book ai didi

PayPal Plus Sandbox - 根据发票付款

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

我在我的网站上成功集成了 PayPal Plus,除了“根据发票付款”。

这是我用于集成支付墙的 JavaScript 代码:

<script src="https://www.paypalobjects.com/webstatic/ppplus/ppplus.min.js"
type="text/javascript"></script>

<script type="application/javascript">
var ppp = PAYPAL.apps.PPP({
"approvalUrl": "<?= $createPaymentArr['links'][1]['href']; ?>",
"placeholder": "ppplus",
"language": "de_DE",
"mode": "sandbox",
"showPuiOnSandbox": "true",
"country": "DE"
});
</script>

当我尝试使用“根据发票付款”时,我收到以下错误消息:“很遗憾,我们无法处理您的购买。”

PayPal's Error Message

我的 API 调用:

$fields = '{
"intent":"sale",
"redirect_urls":{
"return_url":"http://XYZ.info/ABC/paypal/index.php",
"cancel_url":"http://XYZ.info/ABC/paypal/index.php"
},
"payer":{
"payment_method":"paypal"
},
"transactions":[
{
"amount":{
"total":"7.47",
"currency":"EUR",
"details":{
"subtotal":"7.41",
"tax":"0.03",
"shipping":"0.03"
}
},
"item_list":{
"items":[
{
"quantity":"1",
"name":"XYZ",
"price":"7.41",
"currency":"EUR"
}
],
"shipping_address":{
"line1":"XYZ Straße 587",
"city":"OPA",
"postal_code":"12345",
"country_code":"DE"
}
},
"description":"XYZ.info Warenkorb"
}
]
}';

$curl = curl_init();

curl_setopt_array($curl, array(
CURLOPT_URL => "https://api".$mode.".paypal.com/v1/payments/payment",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => $fields,
CURLOPT_HTTPHEADER => array(
"Authorization: Bearer ".$arr['access_token'],
"Content-Type: application/json"
),
));

最佳答案

您需要在显示 iframe 之前修补付款。在补丁期间,只需提供送货地址即可。然后根据发票付款,即使在沙盒中也是如此。

关于PayPal Plus Sandbox - 根据发票付款,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36307650/

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