【发布时间】:2015-07-12 22:29:28
【问题描述】:
我有一个通过订阅费运作的 SAAS Web 应用程序。如果订阅有效,则一切正常,否则应用程序将进入只读模式,直到客户续订订阅。我已经使用 PayPal API 开发了支付流程。
问题在于 PayPal 文档是这样说的:
"Although PayPal usually processes IPN messages immediately, IPN is not synchronized with actions on your website. Internet connectivity is not always 100% reliable and IPN messages can be lost or delayed. The IPN service automatically resends messages until the listener acknowledges them. The service resends messages for up to 4 days.
Because IPN is not a real-time service, your checkout flow should not wait for the IPN message before it is allowed to complete. If the checkout flow is dependent on receiving an IPN message, processing can be delayed by system load or other reasons. You should configure your checkout flow to handle a possible delay."
不幸的是,这正是我的情况:当客户续订订阅时,我需要立即激活应用程序,因此我将所有逻辑都放在“通知回调”中,我必须在其中创建订单、发送确认电子邮件、更新一些会话变量...但是如果 PayPal IPN 有延迟,这就是个问题! 这几天我在沙盒模式下做了一些测试,有几次我在成功付款后4小时就得到了IPN的答复!这对我的应用来说是不可接受的!
最后的问题是:我的情况的最佳解决方案是什么?将应用程序激活从“通知回调”移动到“成功回调”是否有意义?可能有问题?
谢谢
【问题讨论】:
标签: paypal delay paypal-ipn saas