#pavittarsingh
1 messages ยท Page 1 of 1 (latest)
Hi there, can you tell me the question that you want to ask?
Hey Jack
I'm trying to use payment request button but I'm facing error
"A payment method of type card was expected to be present, but this PaymentIntent does not have a payment method and none was provided. Try again providing either the payment_method or payment_method_data parameters."
I have already shared detail on the #1037079054710480987 message
Can you share with me the payment intent ID?
sure
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
would this help?
Thanks. What's the result that you get from pr.canMakePayment() ?
It's give me { applePay:true, googlePay:false }
So It shows apple pay button. but when I try to do pr.confirmCardPayment method I'm getting this error
"A payment method of type card was expected to be present, but this PaymentIntent does not have a payment method and none was provided. Try again providing either the payment_method or payment_method_data parameters.e"
Can you do a console.log and see what's inside e.paymentMethod.id ?
Here you go
paymentMethodId: pm_1LzYyqJ3K2kPnvT1zol4XPy9
https://dashboard.stripe.com/test/payments/pi_3LzYyzJ3K2kPnvT10HtJCvYF
Error message
"message": "A payment method of type card was expected to be present, but this PaymentIntent does not have a payment method and none was provided. Try again providing either the payment_method or payment_method_data parameters."
"type": "invalid_request_error"
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
๐ taking over
When you use confirmCardPayment probably you forgot to include the paymentMethod.id? This part
stripe.confirmCardPayment(
clientSecret,
{payment_method: ev.paymentMethod.id},
{handleActions: false}
).then(function(confirmResult) {
...
}
No I'm passing the paymentMethodId in confirmCardPayment method from this method I'm getting the error.
Have you tried log the ev.paymentMethod.id there?
hmm, ok so you can see it is passed in, logging right before the call?
eventhough the request doesn't have it? ๐ค
Hi, I am stepping down for the day. If you are back and still need help, feel free to ask in the channel