#Mike Taylor-element-inventory-management
1 messages · Page 1 of 1 (latest)
Hey! Yes, there's no inventory management with Elements per se. Even with Checkout the actual management of inventory is somewhat ad-hoc (other than expiration of Sessions)
What do you mean by a 'short-lived SetupIntent'?
only that we would be using the setup intent for only a few minutes until payment intent is completed.
The output of a successful Setup Intent is a authenticated Payment Method object, so they're not really short-lived (assuming you pass a customer parameter so that the PM is reusable)
So I think that approach of capturing the payment details with a Setup Intent would work, and then you handling inventory state/management on your end before creating a PI with the previously created Payment Method
Specifically https://stripe.com/docs/payments/save-and-reuse?platform=web#charge-saved-payment-method
So the Setup Intent would be the on-session (customer present) part, enabling the off-session payment later when your own logic deems that necessary
ok thanks. sounds like this should work for us. We are intending not to store the Payment Method Object credential long-term (unless explicitly granted/permission by the customer), So what happens if the same customer comes back and enters the same payment method?This person has not given permission to store payment method object, but you have a setup intent for them in the stripe system. Does this create a new setup intent or does it create an error because of the long-lived setup intent in stripe?
The Setup Intent object is irrelevant once successful. You can't update/re-use it once status: 'successful'. In relation to your specific queries:
So what happens if the same customer comes back and enters the same payment method?
You'd simply be creating a new Setup Intent and Payment Method objects with the same payment details – this is totally normal
This person has not given permission to store payment method object, but you have a setup intent for them in the stripe system.
The Payment Method object is not reusable if not attached to a Customer
Does this create a new setup intent or does it create an error because of the long-lived setup intent in stripe?
Yes a new Setup Intent would be created
A Setup Intent is just a state machine for creating authenticated payment methods. There's nothing unique about them
But they are immutable once successful
Ok thanks. Much appreciated.
Sure, np!