一次只允许一个用户使用支付网关进行商品购买 [英] Allow only a single user to use Payment gateway at a time for an item buy

查看:75
本文介绍了一次只允许一个用户使用支付网关进行商品购买的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在申请时遇到问题。这是一个在线购物门户网站。

问题是:

- 当客户选择要购买的商品时,会将其添加到他的愿望清单中。他有一些问题要付款。
付款。

- 现在他打电话给顾客提前购买。

- 同时他再次登录申请并尝试付款。

- 所以有2个人(呼叫中心用户和客户)试图为同一项目付款。

- 现在呼叫中心用户首先接收并收到感谢消息。

- 同时客户也到达支付网关并付款。

- 因此,对同一项目已经完成了2笔付款。

- 支付网关是第三方网站所以我们不能在那里强制要求用户。



是否有任何解决方案只允许当前用户(谁正在付款)继续并锁定其他会话?



请指教。

Hi All,

I am facing a problem in my application. It's an online shopping portal.
Problem is:
- When a customer choose an item to purchase, it's added to his wishlist. he had some problem to
make payment.
- Now he calls Customer care to purchase ahead.
- At same time he again login to application and tries to make payment.
- So there are 2 persons (Call center user and Customer) trying to make payment for same item.
- Now Call center user does it first and receive a Thank You message.
- Meanwhile Customer also reached to payment gateway and made payment.
- Therefore 2 payments have been done for the same item.
- Payment gateway is 3rd party site so we can not mandate user there.

Is there any solution to allow only the current user(who is is making payment)to proceed and lock other sessions?

Please advise.

推荐答案

不幸的是,没有灵丹妙药解决方案。您必须编写代码以查看最近是否放置了类似的订单,然后可能会警告用户。例如,用户可以购买该商品,然后决定他们想要另一个商品,以便他们再次购买。这将是有效的,但你的代码不会知道。



可能最好的方法是有一张带有ID的购物卡表,当客户服务代表付款时它将购物卡清空并创建订单。因此,当用户重新上线时,他不再拥有有效的购物车。
Unfortunately there is no magic bullet solution. You'll have to write code to see if a similar order was placed recently and then perhaps warn the user. For example, the user could purchase the item and then decide they want another one so they purchase again. That would be valid but your code wouldn't know.

Probably the best way is to have a shopping card table with an ID and when the customer service rep pays for it the shopping card is emptied and an order created. So, when the user goes back online he no longer has a valid shopping cart.


这篇关于一次只允许一个用户使用支付网关进行商品购买的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆