at present, there is a demand. Alipay or Wechat can be used to pay for second-kill merchandise activities, but the problem is that the demand must be paid before deducting inventory, and placing an order does not reduce inventory. In other words, when Alipay / WeChat Pay informed me that the payment was successful, but there may be a shortage of inventory.
for example, if there is only one item left, user An and user B place an order at the same time (do not reduce inventory, only after successful payment), and then pop up the Alipay / Wechat password interface. When the payment is completed, Alipay / Wechat will inform me that the payment is successful. At this time, there is only one item in stock, but two people have paid, how can we avoid insufficient inventory
I now have two solutions: 1 is to automatically refund, 2 is to subtract inventory when placing an order (beating the product manager), I wonder if you have a better solution