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?

More extensive details on this matter:

I followed @Teodor’s tutorial for custom Stripe checkout with multiple payment methods and it all works fine for card payments, so far so good! :+1:
However for iDeal and sepa_debit payment methods it doesn’t.
Here’s the error output on the checkout page when iDeal payment method is chosen:

{error: {code: "url_invalid", doc_url: "https://stripe.com/docs/error-codes/url-invalid",…}}
error: {code: "url_invalid", doc_url: "https://stripe.com/docs/error-codes/url-invalid",…}
code: "url_invalid"
doc_url: "https://stripe.com/docs/error-codes/url-invalid"
message: "Not a valid URL"
param: "return_url"
payment_intent: {id: "pi_1IpVS1BRuXwUwCNd3Hm4uyNP", object: "payment_intent",…}
allowed_source_types: ["card", "sepa_debit", "ideal"]
0: "card"
1: "sepa_debit"
2: "ideal"
amount: 150000
canceled_at: null
cancellation_reason: null
capture_method: "automatic"
client_secret: "*************************"
confirmation_method: "automatic"
created: 1620639057
currency: "eur"
description: null
id: "pi_1IpVS1BRuXwUwCNd3Hm4uyNP"
last_payment_error: null
livemode: false
next_action: null
next_source_action: null
object: "payment_intent"
payment_method: null
payment_method_types: ["card", "sepa_debit", "ideal"]
0: "card"
1: "sepa_debit"
2: "ideal"
setup_future_usage: null
shipping: null
source: null
status: "requires_source"
type: "invalid_request_error"

So the missing return_url is required for this payment method it seems.
But that parameter can only be used if confirm is set to true:

image

Continuing, when confirm is enabled and a return_url is added, this error is thrown on the checkout page:

error: "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."

Hence my question about how to retrieve and set the payment method to make the confirmation work properly for other payment methods than cards?

Any help is very much appreciated :slight_smile:

Any news on this topic @George?
I know and understand that you are all very busy with the new beta versions, but this problem is still unsolved after more than a month and it seems nobody can help. Any assistance from the Wappler team would be very much appreciated. Thanks in advance!

Are the Stripe Connector improvements in version 3.9.8/3.9.9 the solution to this @george?

Thanks for any reply in advance.

Hi Emiel,

I already explained your options in a reply above:

If you are uncertain about the Stripe options and workflows just contact Stripe online chat support.

They have an excellent support and will help you narrow down the exact options.