gpt4 book ai didi

ruby-on-rails - 使用 PayPal REST API,如何取消付款?

转载 作者:数据小太阳 更新时间:2023-10-29 07:10:06 25 4
gpt4 key购买 nike

使用 PayPal REST API,我似乎无法弄清楚在客户单击“取消订单并返回网站”链接后如何取消付款。也许在生产模式下,PayPal 会自动取消这些付款,但在沙盒模式下,它们似乎仍处于“已创建”状态。

这一观察让我相信我需要在返回网站的“cancel_url”页面时以编程方式取消每笔付款。但是,我似乎无法在 PayPal REST API 文档中找到取消功能。

https://developer.paypal.com/docs/api/

为了它的值(value),我正在使用 Ruby API。

最佳答案

上周我一直在联系 PayPal 的技术支持,他们是这样说的:

If the buyer has completed the work on the PayPal checkout page without cancelling the checkout, then they are redirected back to your site. If you wish for them to have a cancellation at that point, you can build the Return URL to have a final confirmation (showing final total to be billed). So at this point the buyer is on your site, but the payment execution has not happened. If the buyer decides to proceed, then you run the execute command, updating your database with the successful payment details. If the buyer decides to cancel at that point, you do not run the execute command, and purge the payment ID and the buyer's Payer ID. There would be no request that you would need to pass to PayPal to cancel what the buyer did on PayPal. This would be the same type of process done with the Classic APIs using Express Checkout. Once the buyer gets sent over to PayPal, they choose the funding source and shipping address and get sent back to your site, if they want to cancel the transaction, your site does not send any API call to PayPal to cancel or void the EC token. It is just not used to collect the payment.

当被问及如何处理未执行的付款以及他们是否会在一定时间后自 Action 废未执行的付款时:

Yes, I recommend deleting the Payment ID from your database, so there is no accidental payment. Our system, by default, will expire the payment approval made by PayPal payers if the payment hasn't been executed within 3 hours.

PayPal 已允许在此处发布他们的答案。

关于ruby-on-rails - 使用 PayPal REST API,如何取消付款?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20750611/

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