订单取消时 Paypal 标准 IPN 返回变量
我使用 Paypal Standard 作为付款方式。如果用户取消,Paypal 是否会发回自定义变量?
这是当前的工作流程
- 第 1 页 - 用户创建列表
- 第 2 页 - 用户预览列表
- 第 3 页 - 显示列表的总成本,如果他们点击付款,它将重定向到 Paypal
- 将帖子插入数据库并发送 Paypal 自定义变量
- 我们发送“自定义”变量发送给 Paypal,如果用户成功,它将返回“自定义”变量并通过更改数据库中的状态来启用列表。
当用户决定点击取消时,Paypal 是否会发回自定义变量?我希望变量返回并从数据库中删除列表。
I'm using Paypal Standard as the payment. If a user cancels does Paypal send custom variable back?
Here's the current workflow
- Page 1 - User creates listing
- Page 2 - User previews listing
- Page 3 - Display total cost for the listing and if they hit pay it will redirect to Paypal
- Post is inserted into the database and Paypal custom variable is sent
- We send "custom" variable to Paypal and if user is successful it will return the "custom" variable back and enable the listing by changing the status in the database.
Does Paypal send the custom variable back when user decides to hit cancel? I want the variable to come back and delete the listing from the database.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,paypal IPN 仅在事件发生时发送数据:已完成、已退款等...
您可以做的是在表中创建一个名为 status 的新字段,默认值为 0 和时间戳。当用户完成付款时,将该字段设置为 = 1。
然后,要清除不完整的订单,您可以设置 CRON 每隔几天检查一次数据库并删除/归档具有
WHERE status=0 AND timeStamp <; 的行的作业'$今天'
。As far as I know paypal IPN only sends data when an event occurs: Completed, refunded, etc...
What you can do is create a new field in your table called status with a default value of 0 and a timeStamp. When a user complete's payment, set that field to = 1.
Then, to weed out incomplete orders you can setup a CRON job that goes through your DB every few days and removes/archives rows that have
WHERE status=0 AND timeStamp < '$today'
.