如何取消 PayPal(快速结帐)交易?
我有一个使用 Express Checkout 来处理付款的应用程序。
在调用 SetExpressCheckout (并让用户在 paypal 页面上填写详细信息)之后以及在我实际使用 DoExpressCheckoutPayment 完成交易之前,我需要某种方法来取消交易。
我在 paypal 文档中找不到正确的方法,我是让它超时还是需要进行一些 API 调用?
I have an application that uses Express Checkout to process payments.
I need some way to cancel a transaction after calling SetExpressCheckout (and having the user fill out his details on paypal's page) and before i actually complete it with DoExpressCheckoutPayment.
I can't find the right way to do it in paypal documentation, do i just let it time out or do i need to do some API call?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你只要让它超时。如果您尚未调用 DoExpressCheckoutPayment,则表示尚未执行任何操作。
令牌将在三小时后自动过期。
You just let it time out. If you haven't called DoExpressCheckoutPayment yet, no action has yet taken place.
The token automatically expires after three hours.
从技术上讲,您可以清空令牌 REQUEST,并取消设置 reshash SESSION 并让它过期而没有风险(假设您使用的是 api 示例附带的相同命名变量。您使用什么语言?我可以进一步提供示例。
在 PHP 中,我会简单地做:
现在,理想情况下,您希望将用户重定向到取消页面,例如
否则,根据用户是否处于“ReviewOrder”阶段,他们将自动重定向回 paypal 以开始新交易。
Technically you could just empty the token REQUEST, and unset the reshash SESSION and let it expire without risk (assuming you are using the same named variables the api samples came with. What language are you using? I can further provide examples.
In PHP I would simply do:
Now you would ideally want to redirect the user to a cancellation page, something like
Otherwise depending if the user is in the 'ReviewOrder' phase, they will just automatically get redirected back to paypal to start a new transaction.