使用 PayPal REST API,我如何取消付款? [英] Using the PayPal REST API, how can I cancel a payment?

查看:128
本文介绍了使用 PayPal REST API,我如何取消付款?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

Using the PayPal REST API, I cannot seem to figure out how to cancel a payment after a client clicks the "Cancel order and return to website" link. Perhaps in production mode PayPal cancels these payments automatically, but in sandbox mode they seem to stay in the "created" state.

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

That observation lead me to believe that I need to programmatically cancel each payment upon return to the website's "cancel_url" page. However, I cannot seem to find a cancel function in the PayPal REST API documentation.

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

就其价值而言,我使用的是 Ruby API.

For what it's worth, I'm using the Ruby API.

推荐答案

我实际上直接与 PayPal 的某个人进行了交谈.答案是:

I actually talked directly with someone from PayPal. The answer was:

一旦用户授权销售,就必须执行销售.不能取消过了那个点.因此,如果用户返回到您的返回 URL,您是只是希望对您的付款运行执行"命令.

Once a user authorized a sale, the sale has to be executed. It cannot be canceled past beyond that point. So if the user comes back on your return URL, you are simply expected to run an "execute" command on your payment.

这可能并不直接适用于您的情况.我认为取消"的唯一方法是先执行",然后申请全额退款".否则,永远不要执行(我也认为这很奇怪,因为这看起来可能存在安全问题.也就是说,可能发生的主要问题是执行"付款,您的公司将收到您可以手动付款的款项必要时退款...)

This may not directly apply to your case. I think that the only way to "cancel" would be to first "execute", then apply a full "refund". Otherwise, never execute (which I also view as strange because that looks like a potential for security problems. That said, the main problem that could happen is an "execute" on the payment and your company would receive the money that you can then manually refund if necessary...)

这篇关于使用 PayPal REST API,我如何取消付款?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆