#thang-nguyen_error
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1415251972994629743
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Can you share the ID (req_xxx) of the API request? https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
That doesn't seem to be the request that returned the error. Looks like this one: https://dashboard.stripe.com/logs/req_QsyvRpetGR6iEa
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
but the payment intent i have created before I have set the data of automatic_payment_methods.enabled = true
Can you share the code you're using? But the error seems to imply that your integration is not sending all the required params (e.g. there's just no card data in the confirmation repsonse)
do you mean the code when create the payment intent or the confirm payment intent on submit confirm payment on store?
Sure, but I don't think that works like you expect it to. That simply defers the computation of available PM logic for the payment for us, so we can tell the customer which PM types are available to pay with (e.g. card, klarna, etc)
The confirmation request โ the one that errors. I suspect you're calling stripe.confirmPayment
can you check with this?
our website is support two ways for payment
the customer can use the old way with card, or using payment elements
but with payment elements we only load if the customer checkout on EU country
Hmm, which function in that code triggered this request? I would guess confirmCardPayment but I can't see where that is called without also calling confirmPayment?
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
Overall, that confirmCardPayment function is missing any kind of payment information/data be that from an Elements instance or otherwise which is why it errors
What is 'the old way with card'? Does that use the Card Element?
yes
but with my understand if me call to create payment intent with automatic_payment_methods.enabled = true and with the same PI why when confirm it still require payment methods?
Then your code won't work as the Payment Intent (via this.clientSecret) has no attached payment_method, which is why the confirmation request is failing as it requires some payment info (be that from the Card Element)
I think you're just missing an extra param in your confirmCardPayment function:
.confirmCardPayment(this.clientSecret, {
payment_method: {
card: cardElement
},
})
I answered this here: #1415251972994629743 message
This is what automatic_payment_methods[enabled] does: https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods
but on my code the confirmCardPayment was trigger if response.paymentIntent.status === 'requires_action'
but the status of payment intent return is requires_payment_method
it's not requires_action
but on my code the confirmCardPayment was trigger if response.paymentIntent.status === 'requires_action'
That code block cannot be triggered in the example you shared as the intent (pi_3S25HUFtAqvm0zkk0lBWLFGq) is never inrequires_actionstate
You must call confirmCardPayment somewhere else. I'd recommend adding some logging to understand which part of the code is throwing that error
ok let me try