#jun_best-practices

1 messages ยท Page 1 of 1 (latest)

tidal solsticeBOT
#

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

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

thorn lake
#

hello! i don't think i fully understand the question. can you give me a concrete example of what you are attempting to do? e.g. when is a customer saving the payment method, when are you charging the card, etc? are you looking to implement recurring payments like subscriptions?

warped robin
#

Yeah let me try to explain the use case a little more in depth! Did not have enough characters to do so in the ticket

#

For compliances reasons, we have to open an account for the user before we can charge them.

The user will go through the onboarding flow and be redirected to add a payment page, after they add their payment method, the account should open and then we charge the user.

We want to do a pre-authorization hold on the user for $5 to ensure they have enough money on the card before we open the account.

so in this case, would the following flow be considered best practice?

paymentIntent (hold $5) -> open account ->  paymentIntent (capture $5)

if the user does not have $5 on the card, then they should encounter an insufficient_funds error and the account would not open

#

in the other scenario, we are allowing users to schedule payments in the future after their account has opened

which means that we would do

setupIntent -> open account -> paymentIntent (capture $5)

but if we wanted to do a preauthorization hold on the account to check the balance, what could we do to adjust this flow?

#

hopefully the explaination makes sense ๐Ÿ˜“

thorn lake
warped robin
#

for the requirements, the user could schedule up to 30 days in the future, which i know that paymentIntent mostly goes to 7 days(?)

thorn lake
#

you can't really rely on setup intents to do any kind of balance checking for you. sometimes they will do a $1 auth charge, but that's not guaranteed

#

in that case extended authorizations are probably your best bet, but those have several restrictions on when they apply and you have to be on our IC+ pricing plan to get access to tis

warped robin
#

gotcha!
so for the first pay now case:
paymentIntent (hold $5) -> open account -> paymentIntent (capture $5)
this makes sense right?

in essence, we should be switching our flow between using setupIntent or paymentIntent depending on if it is a scheduled payment or not

#

since a successful charge/hold will save the card to a user account similar to setupIntent

thorn lake
warped robin
#

gotcha, thanks ๐Ÿ˜„

thorn lake
#

yep of course! happy to help ๐Ÿ™‚