#dharm

1 messages · Page 1 of 1 (latest)

tribal swanBOT
alpine stirrup
#

hey there just reading through 👀

#

If you already have the payment method saved on the customer, there is no need to use the payment element. Elements are for collecting payment details, but you already have that.

blazing root
#

To do that won't I need to supply the mandate id?

alpine stirrup
blazing root
#

The example that you have given needs the setup_intent as well. So do I need to create a setup intent as well.

alpine stirrup
#

Ok let me take a step back. At the start you said:

reuse an existing payment method (already verified)

#

I assumed this meant you already did either a setup intent or a payment intent with future usage

#

and have a payment method you saved to a customer, some pm_123

blazing root
#

I did the payment_intent with the future usage.

#

but not the setup intent

alpine stirrup
#

Ok great, that's fine! If that succeeded and you have the payment method, its already ready to go

blazing root
#

okay

#

Also this means that I need to change the UI depending upon whether the user already has a payment method or not.

#

i.e. for the first time show the user PaymentElement and the second time only ask the user to confirm without showing the PaymentElement.

alpine stirrup
blazing root
#

Thanks. Although I think it would make the implementation easier if the PaymentElement automatically detected that the payment method already exists and only requires the confirmation. At least that's how I though the PaymentElement is designed.

alpine stirrup
#

Ah, gotcha. No, that is not currently the case. It is for collecting those details initially.

blazing root
#

Okay thanks. Will try as you have suggested.