gpt4 book ai didi

Paypal 快速结帐 - 似乎没有成功运行

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

所以,我正在尝试解决这个问题,但似乎无法解决这个问题。

我正在尝试将 paypal express 集成到网站上。我有带服务商和买家帐户的沙盒环境。

我粘贴了示例代码并更改了客户值和交易详细信息等...如下所示:

paypal.Button.render({

env: 'sandbox', // Optional: specify 'sandbox' environment

client: {
sandbox: 'My Client ID here'
},

payment: function () {

var env = this.props.env;
var client = this.props.client;

return paypal.rest.payment.create(env, client, {
intent: "sale",
payer: { payment_method: "paypal" },
transactions: [
{
amount: { total: '14.00', currency: 'GBP' },
description: "This is a payment description"
},
],
redirect_urls: {
return_url: "http://somesite.com/success",
cancel_url: "http://somesite.com/cancel"
}
});
},

commit: true, // Optional: show a 'Pay Now' button in the checkout flow

onAuthorize: function (data, actions) {

// Optional: display a confirmation page here
alert('confirmation here');
return actions.payment.execute().then(function () {
// Show a success page to the buyer
alert('success here');
});
}
}, '#paypal-button');

我面临的问题是,当您点击 paypal 按钮时 - 在弹出窗口中我看不到金额。

然后在继续时,我从 javascript 中得到一个错误,如下所示:

JavaScript runtime error: Error: Payment Api response error:



{

"name": "INTERNAL_SERVICE_ERROR",

"message": "An internal service error has occurred",

"information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",

"debug_id": "a9ceebeb96bab"

}

Error: Payment Api response error:



{

"name": "INTERNAL_SERVICE_ERROR",

"message": "An internal service error has occurred",

"information_link": "https://developer.paypal.com/docs/api/#INTERNAL_SERVICE_ERROR",

"debug_id": "a9ceebeb96bab"

}

at Anonymous function (https://www.paypalobjects.com/api/checkout.js:8325:17)

at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

at SyncPromise.prototype.dispatch (https://www.paypalobjects.com/api/checkout.js:1542:17)

at SyncPromise.prototype.resolve (https://www.paypalobjects.com/api/checkout.js:1480:13)

at Anonymous function (https://www.paypalobjects.com/api/checkout.js:1533:25)

at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

at SyncPromise.prototype.dispatch (https://www.paypalobjects.com/api/checkout.js:1542:17)

at SyncPromise.prototype.resolve (https://www.paypalobjects.com/api/checkout.js:1480:13)

at Anonymous function (https://www.paypalobjects.com/api/checkout.js:1533:25)

at _loop2 (https://www.paypalobjects.com/api/checkout.js:1509:25)

那么我怎么知道错误是什么?

第二个问题:希望在您的帮助下完成所有工作后,我怎样才能得到回复并确定付款是成功还是失败以及详细信息以将其记录在我的网站上并显示给用户?从我的网站生成的自定义变量(如 paymentID)怎么样?我可以取回该信息吗?

谢谢

最佳答案

您缺少 API 的一些重要信息。AMOUNT{} 等内容。

https://developer.paypal.com/docs/integration/direct/create-process-order/

我也有这方面的问题,我可以进入 actions.payment.execute() 并且我得到一个错误,_loop2 等等。

关于 Paypal 快速结帐 - 似乎没有成功运行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40691937/

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