DEV Community

owais 7osha
owais 7osha

Posted on

How can I subtract from inventory using Stripe Elements

0

I was using a pre-SCA Stripe integration in my webapp that used Checkout. The flow basically:

Did \Stripe\Order::create against a selected SKU and quantity so that I ensured that inventory was still available (for products with 'finite' quantity)

Then an \Stripe\Order::retrieve and $order->pay using the token passed back to me by Checkout in the client.

I've rebuilt my integration with an SCA-compliant flow, now with Stripe Elements, for a better UX.

However, I don't see how I can check against inventory when using Elements. There doesn't seem to be a way to use Elements with a similar Order, Retrieve, Pay flow.

Can anyone that's got a similar Elements based integration point me toward how to making sure I don't oversell products with limited quantity.

TIA.

Top comments (0)