#ultrapro5000_error

1 messages ยท Page 1 of 1 (latest)

coral galleonBOT
#

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

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

inland cedar
#

Hi, request id is req_9IsAG7Tiv0x8wU

median onyx
#

hello! Can you share more on why you're creating a PaymentMethod directly and not continuing on to use a SetupIntent or PaymentIntent?

inland cedar
#

Hi Alex ๐Ÿ™‚ sorry but I forgot why. it's for a checkout plugin I built for client like two years ago and trying to fix

median onyx
#

what are you trying to fix specifically?

inland cedar
#

server side handling of the checkout is running even though payment method is invalid

#

because stripe is returning a payment method id on invalid payment method

#

looks like I made it to create customer and payment method, then create subscription with those

median onyx
#

does your Subscription have a trial?

inland cedar
#

yes, 30 days

median onyx
#

okay, so actually, i wouldn't do what you're doing right now i.e. creating a PaymentMethod. You would typically use a SetupIntent to attach the card to the Customer.

so in your server, you would create a SetupIntent, return the corresponding client_secret to your frontend and do something like

const result = await stripe.confirmCardSetup(clientSecret,
   {
     payment_method: {
     card: elements.getElement(CardElement),
...
inland cedar
#

okay, thanks for that. are you saying stripe is meant to return a payment method id even if card details are invalid? just due to the fact that I thought I'd be merely adding a coupon code for the client, I'd much prefer not to restructure the approach if possible. Quite sure it was all working as expected before. thoughts?

median onyx
#

yes, it's expected behaviour. Stripe only validates basic card format details when you do createPaymentMethod .