#huy_best-practices
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/1451065017221906604
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
๐ give me a moment to run a test
here's the screenshot for reference, thanks!
It is expected that SetupIntent does not set an amount
is there anyway that I could achieve something like this during set up, because I'm using subscription so I guess I can't use confirmPayment() for that
I don't think that's possible. We don't have a way to check if a card has sufficient funds / or its credit limits before an actual charge, since we require the card issuer (customer's bank) to actually return this error code to us.
the purpose of Setup Intent is to tell Stripe you intent to charge this payment method in the future, it does not check if a card has enough credit
okay, is there any better way to handle that error? I am currently doing it like this: confirmSetup -> create subscription -> payment fails due to insufficient funds -> show the user the "open" invoice and let them pay again
Yes if the payment fails, then you would need to collect a new payment method. Redirecting the customer back to the invoice for payment is the right way to handle this error
okay thanks!
You can also consider leveraging our failed payment notifications [0] for payment recovery. ๐
[0] https://docs.stripe.com/invoicing/automatic-collection#failed-payment-notifications