#LuigiFan64 - Payment Element

1 messages ยท Page 1 of 1 (latest)

merry plaza
#

What are you using to create the Payment Element?

#

Are you first generating a PaymentIntent?

median cypress
#

I've only just seen the docs, so I'm not doing anything yet. But yes, I imagine we'd create a PaymentIntent first.

merry plaza
#

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.

median cypress
merry plaza
#

No..you are correct. All status checking would need to happen prior to requesting billing details.

median cypress
#

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.

merry plaza
#

You can still get the benefit of using the Payment Element while being able to verify your inventory before confirming the charge

median cypress
#

sorry, confused again ๐Ÿ˜• . I thought "finalize payments on server" is not possible with the new Payment Element.

merry plaza
#

I do apologize, you are correct.

#

I was thinking using a webhook

median cypress
#

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?

merry plaza
#

Yeah, it accepts a lot of different payment methods and so the behavior has to be universal

median cypress
#

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.

merry plaza
#

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.

median cypress
#

gotcha, yeah, makes sense. Thanks for the clarity here

merry plaza
#

I've got to step away but my esteemed colleague @plain mantle will be able to answer any additional questions.

median cypress
#

I'm all set. Thanks both