#thepunisher_best-practices

1 messages ¡ Page 1 of 1 (latest)

rotund hedgeBOT
#

👋 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/1409550359734779905

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

dawn yew
#

The way our business works is, we estimate how much our service will cost, then if a customer agrees to our quote, we manual capture. We want to manual capture because they could have hundreds of orders in process at a time so we want to make sure their card has enough funds to support those orders. Then when we are done with our service a week or two later or maybe even a month later, we caputre. Because of the delay time between payment intent creation and capture, we need to make sure the card has enough credit to cover the cost.

magic lantern
#

Right so, a few things

#

You've found the cancel event, which is emitted when the PI/auth is cancelled, either manually or automatically

#

Your flow will depends on the business model & needs/risk

#

Broadly, the default hold period is 7 days, some industries can get longer auth windows though.

#

eg, i you have ongoing costs/risks, you might want to get a new auth in place before the original expires to ensure you can capture that amount if needed

#

If there's a long gap between booking/contract and service delivery its not practical to hold and you can instead collected the payment info then attempt the auth a few days before scheduled service

#

this lets you know you have the auth before you incur the expense of service delivery

#

and if it fails gives you some time to contact the custoemr to correct that

dawn yew
#

Thanks for that. We have risks and we won't know when the service will end up being completed so I think we can use the capture_before attribute to schedule background jobs that will cancel the payment intent and then create a new manual capture right afterwards, thus extending the authorizaiton.

We can reuqest an extended auth to help prevent it coming to the above with this:
payment_method_options: {card: {request_extended_authorization: 'if_available'}}

Will the cancel and the create new payment intent flow cost extra money to us?

magic lantern
#

We can't answer fees/pricing question since this varies by account/geography etc, but my understanding of the default pricing is that it only applies to captured payments, so cancelled payments not captured are charged.

Support can give you firm answers about your pricing: https://support.stripe.com/contact

dawn yew
#

ok. Setting pricing aside, does the background job scheduled by the capture_before attribute sound like a viable solution to extend the auth?

#

I have to step aside, but I'm looking forward to your response when I get back. Thank you!

wind cypress
#

Yep, that would be a good programmatic way to know when you should either capture the intent or do something esle

rotund hedgeBOT