#nadiya_code

1 messages ¡ Page 1 of 1 (latest)

rare lichenBOT
#

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

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

limber axle
unborn sparrow
#

what's the difference between:
mark the subscription as unpaid and leave the subscription past-due?

limber axle
#

so, the subscription is not set to incomplete_expired even after 23 hours if i set
I believe that only applies to collection_method: charge_automatically
for collection_method: send_invoice - the subscription will be marked differently when it crosses the due date

what's the difference between:
mark the subscription as unpaid and leave the subscription past-due?

We explain that here - https://docs.stripe.com/api/subscriptions/object#subscription_object-status

when a subscription has a status of unpaid, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices.

unborn sparrow
limber axle
unborn sparrow
#

even if the the suscription has trial period for few days, the next invoice (the first non trial invoice) has billing_reason: subscription_create ?

limber axle
#

Hmm not sure about the trial no.. With a trial we do generate a $0 invoice so I suspect we'd just use billing_reason => subscription_cycle for the first paid invoice

#

I'd recommend trying it out in test mode to be 100% certain of the outcome

unborn sparrow
#

its subscription_cycle for the first paid invoice (in case of a trial)
so, is there any other way , we can check they cycle number or something?

limber axle
unborn sparrow
#

may be i could just listen for the invoice payment succeeded event, and if the subscription's collection method is still send_invoice, update it to charge_automatically.
is this step right?

limber axle
#

yup invoice.payment_succeded or invoice.paid
either events would work

unborn sparrow
#

can you please share any doc showing the difference between those two events?

limber axle
#

They're identical, the only difference being one is generated when the invoice is marked as paid (it's status changed to paid)

rare lichenBOT
unborn sparrow
#

i'd this code for subscription schedule phases:

[
{
                    // Single phase with a trial ending on the target day.
                    trial_end: nextBillingDateUnix,
                    items: [{ price: stripePriceId, metadata }],
                    metadata,
                },
]

and i changed to this one below

[
                {
                    // Phase 1 : with a trial ending on the target day and manual payment for the first invoice.
                    trial_end: nextBillingDateUnix,
                    collection_method: 'send_invoice',
                    items: [{ price: stripePriceId, metadata }],
                    metadata,
                },
                {
                    // Phase 2: with an automatic charge for the subsequent invoices
                    items: [{ price: stripePriceId, metadata }],
                    metadata,
                },
            ];

how about this?

#

since i'm already using scheduled subscription and phses, should i just add one more phase?
or should i need to do this one " listen for the invoice paid event, and if the subscription's collection method is still send_invoice, update it to charge_automatically."

tawny saffron
#

Hi, taking over for a teammate who needs to step away. Let me catch up