paypal返回商户问题
我使用贝宝标准作为我的支付网关。
我的问题是,在 Paypal 标准付款方式中,
我的代码如下:
当用户单击 Paypal 的“返回商家”按钮时,用户将返回带有订单数据的网站,并且在该页面上我的订单条目将被插入我的数据库。
因此,当有人付款但没有点击返回商家链接时,我的问题就会出现。
因此,在这种情况下,客户得到报酬,但由于没有条目,我的数据库无法正常工作。
希望我对大家都清楚。
谢谢 阿维纳什
I am using paypal standard as my payment gateway.
My problem is that, in Paypal Standard payment method,
I have done my code as below:
When user click on return to merchant button from paypal then user return to the site with order data , and on that page my order entry will be inserted in my DB.
So my problem occur when someone pays but don't click on return to merchant link.
So in this case customer gets paid, but due to no entry my DB its not working proper.
Hope I am clear to all.
Thanks
Avinash
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您必须设置一个回调 IPN,以便在结账完成时侦听 PayPal 的响应。然后该脚本可以处理数据输入部分。 PayPal 及其开发者网络是一个很好的起点。
正如您已经注意到的那样,您的解决方案不是最优的并且容易出错(任何依赖于某些用户行为的东西都在某种程度上)。
You have to set up a callback IPN that listens for PayPal's response when the check out has been completed. This script can then handle the data entry portion. A great place to start is PayPal and its developer network.
Your solution, as you already noticed, is sub-optimal and error-prone (anything that relies on certain user behavior is to some extend).
使用侦听器消化 IPN 与您在 PDT 成功/返回页面上执行的操作几乎相同,因此我通常只执行这两个操作。仅拥有 IPN 将确保数据完整性,但由于拥有一个 PDT 成功页面很不错,其中包含一些逻辑,欢迎用户回来并通过分解消息来确保他们的交易成功,因此您不妨只执行您的操作订单处理也在那里。只需跟踪事务 ID,这样就不会重复处理任何内容。
Digesting the IPN with a listener is pretty much the same as what you would be doing on your PDT success/return page so I usually just do both. Having just the IPN will ensure data integrity but since its nice to have a PDT success page that has some logic in it that welcomes the user back and ensures them that their transaction was successful by breaking down the message, you might as well just do your order processing there as well. Just keep track of the transaction IDs so nothing gets processed twice.