#vparthay_api
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/1348787447819014304
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hello! To clarify, you want to reuse a Payment Method after the first attempt to use it fails?
If so, that's not possible. To save a Payment Method for future use you must successfully confirm a Payment Intent or Setup Intent with it, or successfully attach it to a Customer directly (attaching directly is not recommended).
Why would you want to reuse a Payment Method that failed? Can you tell me more about what you're trying to accomplish?
@strong sedge You there?
Hi yes, reading your response
Give me a minute, typing up my use case
Looks like there is a extra charge on using request_partial_authorization in every transaction, hence this is what we decided:
-
If we get a 402/insufficient funds error, then create a new PI with the partial_authorization flag and while confirming, use the Payment method from the already confirmed but failed with a 402 insufficient funds.
-
This way FE doesn't have to retry or pass a new confirmation token
You can't do that. The Payment Method will have already been consumed by the first attempt and can't be reused at that point.
You should display a decline error to your customer and have them provide new payment information to generate a new Confirmation Token and Payment Method with.
They can supply the same information if they want though.
Ahh yes, for better user experience, i don't want to ask them to retry
and retype the same one
hence I wanted to reuse it
To reuse it you would need to attach it to a Customer first, using a Setup Intent or a Payment Intent with setup_future_usage set.
yes, i pass in setup_future_usage to be off_session
Or attach it directly (again, not recommended).
Yeah, the Intent has to succeed for the attach part to happen.
yeah, i get a 402 so doesn't succeed! ๐ฆ
It sounds like you would need to do a Setup Intent (meaning no funds are involved, you're just setting it up for future use without charging) but we don't recommend creating a Setup Intent and then immediately creating a Payment Intent after that.
Do you have other suggestions on how i can use partial_authorizations only for a 402/insufficient funds case?
No, not really. If you want to request a partial authorization you need to request it ahead of time, not after a decline.