How to retrieve and set the payment method for Stripe confirmation?

I am using a custom Stripe checkout form, which works perfectly with a credit card.

For many other payment method types like sepa debit confirmation is required, so I checked the Confirm option in the createPaymentIntent sc action.
I also set the required return url and then this error remains in the console:

You cannot confirm this PaymentIntent because it’s missing a payment method. You can either update the PaymentIntent with a payment method and then confirm it again, or confirm it again directly with a payment method.

So I suppose the payment method should be set here:

However, I can’t figure out where to retrieve the payment method that was selected by the customer and set it here. How can that be done?

Thanks for any help.

1 Like

Nobody knows how to set this up correctly? :frowning_face:
Any help would be much appreciated…
Thanks in advance!

You really don’t have to enable payment confirmation and also specify specific payment method.

It is all done automatically when you use the hosted stripe checkout.

The payment method you see in the UI is for a very specific workflow where you create a very specific payment method first. But that is very advanced and you really don’t need it.

So just follow the stripe checkout tutorial and when you use the stripe hosted checkout, stripe handles all your redirects and confirmation, also for ideal and sepa.

Hi @George, thanks for your reply.

But what if I am using a custom checkout form instead of the stripe hosted checkout?

Then, in the console’s network tab, the error says a payment method should be defined. So how do I do that?