#jmschp_payment-element-error-messages

1 messages · Page 1 of 1 (latest)

echo heronBOT
#

👋 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/1390275323282849834

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

quasi geyser
#

Not that I am in the Acacia version

I have seen this, even recommended by Stripe AI docs, but it does not work event.error is always undefined.

const paymentElement = elements.create('payment');
paymentElement.on('change', (event) => {
  if (event.error) {
    // An error occurred, handle it here
    console.log(event.error.message);
  }
});
half parrot
#

The general recommendation is detailed here:

If the confirmation fails, the Promise will resolve with an {error} object that describes the failure. When the error type is card_error or validation_error, you can display the error message in error.message directly to your user. An error type of invalid_request_error could be due to an invalid request or 3DS authentication failures.

That doesn't really detail which error types the Payment Element displays. I think there's a few exceptions for example, the error message will not be shown automatically if the decline code is not one of the codes listed here, if the payment is declined after a 3DS challenge was completed, or if the payment is attempted with a saved payment method, selected through the Payment Element’s saved payment methods feature

Accept payment methods from around the globe with a secure, embeddable UI component.

quasi geyser
#

Testing with 4000008260003178 after a successful 3DS authentication the Paymet Element is not displayng the error message "Your card has insufficient funds. Try a different card."

From what you say it should display the message, correct?

half parrot
#

Do you have an example PI?

quasi geyser
#

I just ran this one
pi_2RgjoV2ALfsUTznj1XH2kfRR

half parrot
#

Hmm, yeah I get the same. Those docs seem inaccurate then

#

Interestingly the error is rendered inline when you use 4000000000009995 (which is an insufficient_funds decline without 3DS/auth)

quasi geyser
#

Yes

#

That inconsistency is the problem.

half parrot
#

Yeah I'm flagging it to the Payment Element team, in the meantime you'll just need to account for that in your integration. I'd recommend writing in to us so we can notify you if/when we fix the behaviour

echo heronBOT
#

Hello @quasi geyser, we have sent you a direct message, please check it at https://discord.com/channels/@me/1390282862644957284

  • 🔗The message has instructions on how to open a direct support case with our Developer Support team, in order to help you more effectively.
quasi geyser
#

Thank you
I opened the support case.

half parrot
#

I see it – thanks. We'll pick it up from there

echo heronBOT