#anshulfarkya_86718
1 messages · Page 1 of 1 (latest)
If collected previously, the ID of the payment method to attach to this PaymentIntent. This is mutually exclusive with the elements parameter.
- That sounds like an abnormal integration to me (having 2 PE in a same page). Why can't you just use 1 PE?
Hi @weary nimbus ,
From where we'll get the id of the payment method?
That is only for an alternative flow. In the normal flow you don't pass that value, you use the elements parameter instead
I am passing the elements param but the confirmPayment call is getting failed and when I check the reason on dashboard it's saying please pass payment_method and when I am passing payment_method in the same call it's showing success.
That doesn't sound right. Can you share the errored request id req_xxx it shows on Dashboard
YUQgAO2p0jaxxD
It should in the format req_xxx
req_V8NwSLvQkVzSer
this is the right one
It doesn't look like being confirmed by PaymentElement
How did you call the method? Could you share the code? Or better an URL here
Sure
You need to have the elements here
Yes, I am passing elements in card
const {error} = await stripe.confirmPayment({
elements,
clientSecret,
confirmParams: {
return_url: 'https://example.com/order/123/complete',
},
});
@weary nimbus The reason for using different payment elements is, that in the 1st configuration, we want to display only cards in the UI as allowed payment options and in the second element, Apple-pay and Google Pay.
How can we initialise both configurations using one payment element? refer: https://stripe.com/docs/payments/multiple-payment-method-configs#section-4
Please guide us to the correct approach otherwise
Hi! I'm taking over this thread.
So you want multiple Payment Element loaded on the same page?
@elfin merlin We want to display different stripe UI and payment options for different configurations, and that's why we decided to go ahead with creating separate payment elements. Is this the right approach?
I've never tried this. Is it working or do you get an error message?
@elfin merlin is it mandatory to call submit() before confirmPayment() ?
That's important to know when the users clicked on the submit button and we should confirm the payment. But technically no it's not mandatory.
Getting this error