#dharm
1 messages · Page 1 of 1 (latest)
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.
If you have a payment method saved for future use, you can either create the payment intent with that payment method and confirm server side (ie, if doing an off-session payment), or you can create the payment intent and use confirmUsBankAccountPayment by supplying the payment_method in the data
https://stripe.com/docs/js/payment_intents/confirm_us_bank_account_payment#stripe_confirm_us_bank_account_payment-data-payment_method
To do that won't I need to supply the mandate id?
No that should be managed by the saved payment method as far as i know, equivalent to saving the details and taking payment later shown here:
https://stripe.com/docs/payments/ach-debit/set-up-payment?platform=web#web-future-payments
The example that you have given needs the setup_intent as well. So do I need to create a setup intent as well.
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
Ok great, that's fine! If that succeeded and you have the payment method, its already ready to go
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.
Yes, that is something you'll want to control. You'd check if you already have a payment method for the customer or not.
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.
Ah, gotcha. No, that is not currently the case. It is for collecting those details initially.
Okay thanks. Will try as you have suggested.