#erangalp-paymentelement

1 messages · Page 1 of 1 (latest)

olive plover
#

Hello! Starting up a thread for you

#

Is there a reason you're adding on a charge immediately after collecting payment details with a Setup Intent? Typically, we recommend using Payment Intents if you want to also charge the customer while collecting their payment details (which would allow you to use the same Payment Intent and not re-initialize the Payment Element if payment fails)

normal carbon
#

Yes, because the payment scenario could change depending on user action. We provide software for gyms, and depending on the gym membership the member selects he might be charged immediately or later

#

The members need both a card on file, and the option to potentially pay immediately for a membership

#

Tying the initialization of the Payment Element with the setup intent really made dealing with this flow difficult

#

Ideally, resetting the setup intent so the user can try fixing the issue would be the best option

olive plover
#

Is there any way for you to know whether payment will be needed immediately before you get to the payment element initialization?

#

Unfortunately there isn't a way to reset the Setup Intent once it's successful, so that really limits your options

normal carbon
#

Unfortunately not. It's on the same page and can be changed even after entering initial payment information (before submitting for processing)

#

So our only option to completely reload the payment Element on payment failure? seems a bit ridiculous

#

If a user needs to just correct their zipcode, they should not need to re-enter all of the card details again

olive plover
#

Yeah I'm sorry - that would be your best option (or move back to using the card element) given the restrictions you mentioned. Most users in this situation would rely on Payment Intents to gather payment method details, which would allow them to continue using the same PI until it succeeds, but because you're using the Setup Intent + Payment Intent together this isn't possible

normal carbon
#

The payment intent requires an amount to be provided, correct? and it can't be changed after it's created?

olive plover
#

It does require an amount, but it can be changed after creation

normal carbon
#

Can the amount be 0?

olive plover
#

No, the amount can't be 0

normal carbon
#

That's not ideal either - we either need to constantly juggle between setting up setup intents and payment intents on the same page depending on user actions, or we have to reload the payment Element on payment failure

#

Any other ideas?

olive plover
#

Really I think these are your only options:

  • Continue using Payment Element but change your flow so that gathering the payment method comes as late as possible (so that you know whether you need to use a Setup Intent or a Payment Intent)
  • Continue using Payment Element and create a new Setup or Payment Intent and reinitialize the payment element
  • Switch over to using Card Element
normal carbon
#

Somewhat disappointing. We've been using Stripe for this integration for years and never had issues until switching to the Payment Element which was supposed to make things easier when dealing with multiple payment methods, but made things more difficult for card payments. Is it possible to convey this scenario to the dev team and see if they could potentially add a method to address this flow? for example resetting the state of the setup intent so it can be used again

olive plover
#

Yes, I can definitely surface this feedback - we're unlikely to allow for resetting the state of the setup intent to allow it to be reused, but there are potential other improvements that could be made the may help make flows like yours easier

#

I need to head out, but @inner sky can answer any other questions you have