#harshitbhargava
1 messages ยท Page 1 of 1 (latest)
Yes! You can find the payment method ID under payment_method param in the result of confirmSetup: https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
How can you please give m reference through code
It'll just simply be:
const result = await stripe.confirmSetup({
elements,
redirect: 'if_required',
confirmParams: {
return_url: window.location.href,
},
});
You can find payment_method in the result param
Have you given it a try?
Yes but it is not giving me any response
Can you share the setup intent ID (seti_xxx)?
Can you copy and paste the ID here instead of the screenshot?
Give me one minute
When you console log the result, what does the response look like?
Can you share your code?
In the docs it is written when there is any error then it will print, so thats why i am confused
Can you share your code?
From our side, I can see that we returned the payment method ID in the response: https://dashboard.stripe.com/test/logs/req_XaHfo2aZ7exAHh
It's likely that your code didn't retrieve the correct parameter
I am using th same cide what you have sent
Please share your code as there can be other reasons. Mine is just partial example
But you are finding the payment method id through setupIntentId , hiw we can find through confirmSetup function itself?
https://dashboard.stripe.com/test/logs/req_XaHfo2aZ7exAHh was made from confirmSetup
The response should be what you recevied from confirmSetup
๐ how may I help?
const addPaymentMethod = async (e) => {
e.preventDefault();
if (!stripe || !elements) {
return;
}
const result = stripe.confirmSetup({
elements,
confirmParams: {
return_url: window.location.href,
},
});
console.log(result);
};
This is th code
And i am not able to find payment method id
the result will only give you whether the confirmation errored or not