PHP - Paypal 产品超时

发布于 2024-08-11 16:01:22 字数 217 浏览 1 评论 0原文

我终于让我的贝宝系统使用 IPN 和预订系统工作,以确保两个人不会购买相同的产品。

问题是,我的申请上的预订持续时间为 10 分钟。如果用户预订了“计时器”启动的产品,他会点击“付款”并最终进入贝宝网站。然后他离开电脑 10 分钟然后回来。然后他买了它。到目前为止,虽然预订已经结束,但很可能其他人已经购买了。

是否可以通过 paypal IPN 请求发送一个时间限制来阻止这种情况发生?

I have finally got my paypal system working using IPN and a reservation system to ensure that two people do not buy the same product.

The problem is, the reservations last for 10 mins on my application. If a user reserves the product the 'timer' starts, he clicks pay and ends up on paypals website. He then leaves the computer for 10 mins and comes back. He then buys it. By now though the reservation is up and it is possible that someone else could have already bought it.

Is it possible to send a time limit with the paypal IPN request to stop this happening?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

注定孤独终老 2024-08-18 16:01:22

据我所知,您无法指定贝宝交易必须在一定时间内完成。

不过,我看到您可以使用两个选项:

  1. 如果他们购买但产品缺货,则提供全额退款。您可以在购买的 iPN 通知中进行检查,如果不可用,则退款。如果这种情况经常发生,您可能会受到贝宝的处罚,但我在提供退款方面没有太多经验。

  2. 您可以指定该按钮需要检查库存,请参阅标准付款指南中的“步骤 2 – 使用“立即购买”按钮跟踪库存”。一旦产品售完,您使用 api 通知 paypal 库存为零(如果有 api,您可能必须使用网站来执行此操作),并且他们应该能够通知用户库存为零。我也没有这方面的经验,但它似乎比#1 更复杂,如果这种情况不经常发生,我可能会选择#1。我认为,如果用户在看到库存为零后仍继续进行交易,那么最终您仍然必须退款,但我不确定文档中的措辞。

As far as I know, you cannot specify that a transaction has to close within a certain amount of time with paypal.

However, I see two options you can use:

  1. Offer a full refund if they purchase and the product is not available. You would check during the ipn notification of the purchase and if it is not available, then refund. You might be penalized by paypal if this happens a lot, but I don't have a lot of experience with offering refunds.

  2. You can specify that the button needs to check inventory see "Step 2 – Tracking Inventory With Your Buy Now Button" in the standard payments guide. Once the product becomes sold out, you use the api to notify paypal the inventory is zero (if there is an api, you might have to use the website for this), and they should be able to notify the user there is zero inventory. I don't have experience with this either, but it seems more complicated than #1, and I would probably go with #1 if this didn't happen a lot. I think in the end you still end up having to issue a refund if the user goes through with the transaction even after seeing there is zero inventory, but I'm not sure about the wording in the docs.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文