#LuigiFan64 - Payment Element
1 messages ยท Page 1 of 1 (latest)
What are you using to create the Payment Element?
Are you first generating a PaymentIntent?
I've only just seen the docs, so I'm not doing anything yet. But yes, I imagine we'd create a PaymentIntent first.
In that case take a look at the sequence diagram here: https://stripe.com/docs/payments/accept-a-payment#web-create-intent
You see when the control goes back to your server to confirm the paymentIntent. This would be a good spot to check your inventory/status.
Sorry, I don't actually see that ๐ฌ
On https://stripe.com/docs/payments/payment-card-element-comparison, I see "finalize payments on server" as not supported with the new Payment Element. My understanding is this refers to creating a PaymentIntent with confirmation_method=manual.
In the sequence steps on https://stripe.com/docs/payments/accept-a-payment#web-create-intent it looks like the server doesn't get back involved until a webhook is received, past the point of confirmation. Sorry if I'm missing something here!
MY mistake I mean to specify the custom web flow: https://stripe.com/docs/payments/accept-a-payment?platform=web&ui=elements#web-create-intent
No..you are correct. All status checking would need to happen prior to requesting billing details.
gotcha. Just out of curiosity, how does this work using the simpler flows/element for the wide range of businesses you support? I have to imagine cases where, like, a product is deleted on the customer's backend, and then a payment is completed 30 minutes later from a stale browser window.
In that case you may want to review this doc which uses a flow that does go through the server prior to communicating with Stripe: https://stripe.com/docs/payments/accept-a-payment-synchronously
You can still get the benefit of using the Payment Element while being able to verify your inventory before confirming the charge
sorry, confused again ๐ . I thought "finalize payments on server" is not possible with the new Payment Element.
Ah, so I just learned no payment method types other than cards can be confirmed server side. Maybe that's why the Payment Element works that way?
Yeah, it accepts a lot of different payment methods and so the behavior has to be universal
cool. I'm still curious (final thing if you have any insights!) about how merchants handle this case in general -- when using non card payment methods, how do people deal with these sorts of race conditions where for example a product gets deleted between when the form is rendered and when payment is completed, which could be like 45 minutes later.
Well that's tricky. I would consider a sort of "soft reserve" of an item in someone's "cart" so to speak. And the cart is actually processed and confirmed when the successful webhook event is received. But that approach has its own inefficiencies.
gotcha, yeah, makes sense. Thanks for the clarity here
I've got to step away but my esteemed colleague @plain mantle will be able to answer any additional questions.
I'm all set. Thanks both