#coding-lover_code

1 messages ยท Page 1 of 1 (latest)

vast stormBOT
#

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

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

quaint stratus
#

You'd look at the current_period_end property

frozen cove
#

it is undefined not available on subscription object

#

if I do subscription.current_perion_end it is undefined

#

all others fields are available

#

but that field is not

quaint stratus
#

Hmm, what's the sub_xxx ID where that is the case?

frozen cove
#

sub_1RIrusD0unIZlP8OiDhsZTSe

#

I have bunch of subscriptions in all it is not available

quaint stratus
#

So you'll need to look at items[data][][current_period_end]

frozen cove
#

what are multi interval subs

quaint stratus
#

e.g. you'll be able to have a single subscription with items of different intervals. 1 might be yearly, another monthly. Currently not supported but that API change will unlock that functionality

frozen cove
#

currently I have one product with two prices yearly and monthly

quaint stratus
#

Yes, but I assume a single user will enver subscribe to both simulataneously. You'll only ever have subscriptions with one item, yes?

frozen cove
#

yes

quaint stratus
frozen cove
#

items[data][0][current_period_end]

quaint stratus
#

Just check the first (and only) index in items[data]

frozen cove
#

ok

#

does stripe have any way to send emails before 1 month to yearly subscription users?

quaint stratus
#

You can send 'reminder' emails yes, but only 7 days before

frozen cove
#

I need to send reminder email before 30 days to yearly subscribers and before 7 days to monthly subscribers

quaint stratus
#

No easy way to do that today I'm afraid

frozen cove
#

you afraid why ๐Ÿ˜ƒ

#

so I go with custom reminder notification system

quaint stratus
#

That's the only way to get the system you want yep

frozen cove
#

I need another help

quaint stratus
#

Sure

frozen cove
#

I achieved it before but want to do with easy way

#

I want to create subscription yearly but it will expired after 1 month from today date

quaint stratus
#

What do you mean by 'expired'?

frozen cove
#

yes It will expired after one month

#

I am doing this because I want to test my reminder email logic

#

Which I tell you before

#

Sorry for my poor grammar

quaint stratus
#

I don't know what you mean by 'expired'? How does an annual subscription expire after a month? You mean the customer cancels?

frozen cove
#

no I want to change the expiration date for example I create yearly subscription but I want manually update its expiration date and set to after 1 month from today date so I test my reminder email logic

#

Stripe Ai suggest me put billing_cycle_anchor field while creating subscription so I put there date after 1 month in timestamp

quaint stratus
#

Why not just use a test clock to 'fast forward' time to ~a month before the renewal?

frozen cove
#

ok but how I comapared today date with it

quaint stratus
#

i.e. start a yearly sub ~now, then you can advance the clock to April 2026 (1 month before the renewal) to test the logic

frozen cove
#

ok I got it I put manual date of future and then compare it with subscription date after doing advance clock

quaint stratus
frozen cove
#

ok thankyou so much