#thang-nguyen_error

1 messages ยท Page 1 of 1 (latest)

zealous jasperBOT
#

๐Ÿ‘‹ 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.

vivid summit
quasi brook
#

req_S0nYgqbeMpjoR1

#

here is it

vivid summit
quasi brook
vivid summit
#

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)

quasi brook
vivid summit
vivid summit
quasi brook
#

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

vivid summit
#

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?

#

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

vivid summit
quasi brook
#

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?

vivid summit
#

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
    },
  })
vivid summit
quasi brook
#

but the status of payment intent return is requires_payment_method

#

it's not requires_action

vivid summit
#

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 in requires_action state

You must call confirmCardPayment somewhere else. I'd recommend adding some logging to understand which part of the code is throwing that error

quasi brook
#

ok let me try