ยทFrontend developer

"Reserve" product while entering card

Hey,

I have an interesting problem for which I have no idea how it can be solved. However, I have users purchase some products. When the screen with the card payment form (bottom sheet) opens up, it would be ideal if the products were "reserved" for X minutes. This is important as you don't want to be entering all your card details and because of that miss the purchase.

Using periodic actions, this can be simply done while the user is in the app. When the card form is opened, you "reserve" the product with an update action, and if the time passes or the user closes the bottom sheet, the products become available again (an update action that returns the inventory). However, what happens if the user "kills" the app or just closes it?

The problem I am facing is that if the user "reserves" the product (e.g. reduce product inventory - open bottom sheet) and then the user closes the app, the product inventory wont be able to re-update as the action won't trigger. I believe this needs to be some cloud-based function?

Has anyone faced a problem similar to this before?

5 replies