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.

Community Page
Last updated: