#adri10_payment-method-validation

1 messages ยท Page 1 of 1 (latest)

wide masonBOT
#

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

๐Ÿ“ Have more to share? Add more details, code, screenshots, videos, etc. below.

grizzled aspen
#

Hi ๐Ÿ‘‹

Sorry but I'm not quite grasping which type of error you are testing for. Do you want the card to pass validation in the front-end but fail in the back-end?

sly lark
#

hi, no i want an error at the moment of creating the payment method

grizzled aspen
#

So on the front-end then? Like not event allowing you to submit the card?

sly lark
#

yes, to let the user know if the card is expired or any other error that might happen. Right now only fail in the request server. These test card do failed trying to add the card to the customer but is curious that they don't cause error when creating the payment method

grizzled aspen
#

You can simulate that with any test card by providing an incorrect expiration date like 02/22

sly lark
#

the stripe elements form validate that and do not allow that. im expecting to have an error on using one of the failure test card, it doesn't make sense get the paymentMethodId if not is a good card. I thought maybe stripe have a different list to test payment method, but the createPaymentMethod always work even submitting cards of the list of failure test cards

grizzled aspen
#

Ah, in that case the problem is you are using the createPaymentMethod function, not something like Setup Intents

#

That function does zero authorization checks

sly lark
#

oh ok, thanks. That's what i want to know if there was a way to catch at the moment of creating the paymentMethod, but there's not. Thanks, i'll take a look on this

grizzled aspen
#

Happy to shed what ๐Ÿ’ก I can ๐Ÿ™‚