#samiya_unexpected

1 messages ยท Page 1 of 1 (latest)

stone cobaltBOT
#

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

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

stiff sparrow
#

hey there - no event triggers on the second day of a trial period for a subscription

are you trying to manually create a pre-auth for a payment, separate to the subscription? the customer will be billed as part of the subscription when the trial ends, so it's not clear to me how the pre-auth is intended to fit into this

sharp shell
stiff sparrow
#

can you confirm what the purpose of this pre-auth is?

for example, do you just want to validate that the customer's card can be charged, or do you want to capture the pre-auth (i.e. take an additional payment, outside the subscription)

#

to answer your question more directly, there's no event that Stripe fires on the second day of a subscription, so you'd need to control the timing of this pre-auth manually on your side (rather than creating it in response to an action on Stripe's side)

sharp shell
#

I want to hold the payment amount till the trial ends

#

Is there a way I can create preauth on day 2

stiff sparrow
#

ok cool - you'd need to manage the timing of this yourself, since Stripe doesn't send any event on day 2

sharp shell
#

Can you suggest how that can be done

stiff sparrow
#

The usual approach would be something like: when the subscription/trial starts (via customer.subscription.created), store the start time and schedule your own job to run 2 days later; also listen for subscription updates/cancellations to reschedule or cancel the job.

#

So you'd get the customer.subscription.created event, and compute the target timestamp (i.e. target_time = subscription.trial_start + 2 days)