#Genezis

1 messages · Page 1 of 1 (latest)

runic isleBOT
worn flame
#

👋 Thanks for reaching out
So I'm not understanding your ask, could you please describe an example and what you are willing to do exactly ?

waxen gale
#

sure think. Basically, I want to just keep in our database the current state of stripe subscription object, updated by customer.subscription.updated webhook.
And then when determining if we should on our BE enable subscription to user, we just check if the current date is inside Stripe Subscription.current_period_start and Subscription.current_period_end
And I am asking if its possible that for some scenarios current date will be inside stripe subscription current period start/end but the subscription should not be given from our end

#

with example, lets say, today is 26th/9 and lets say stripe subscription date from/to will return 01/09 ~ 01/10, but the status is canceled or unpaid, can this happen? and does it mean that the sub should be still active till 01/10 or should not be enabled the day we recieve canceled/unpaid event

whole sigil
#

Hi! I'm taking over this thread.

waxen gale
#

well because imagine this scenario:

I buy sub for October, it will be valid from 1/10 till end of month 31/10, but in the middle of month 15/10 I will cancel, but I already paid full price, so the Stripe sends the webhook with subscription status canceled the day I cancel, so 15th, but we actually should only cancel subscription 31st of the month, not 15th.
This is how I understand the webhooks will be sent, correct me if I am wrong

waxen gale
#

well so first please confirm that you understand my scenario, with cancelation in middle of the month and that the webhook behaviour that I described is correct

whole sigil
#

I buy sub for October, it will be valid from 1/10 till end of month 31/10, but in the middle of month 15/10 I will cancel, but I already paid full price, so the Stripe sends the webhook with subscription status canceled the day I cancel, so 15th, but we actually should only cancel subscription 31st of the month, not 15th.
If the customer cancels immediately, then the subscription status will be cancelled. However in that case Stripe will add a credit balance to the customer for the unused time on the subscription https://stripe.com/docs/billing/customer/balance
If you don't want to cancel the subscription immediately, you can use https://stripe.com/docs/api/subscriptions/update#update_subscription-cancel_at_period_end and in this case the subscription status will stay active until the end of the current billing period.

waxen gale
#

okay, so what will be the current_period_start and current_period_end and status, of webhook sent 15th/10
I mean start is obvious will stay 1/10, what about the end, will it be 15th or 31st?

also I gotta go for lunch, so if you can not close the thread for a while pelase

whole sigil
#

I'll keep the thread open and do some tests to check your question.

#

So if you cancel the subscription in the middle of the month, the current_period_end won't be updated, so it stays at the end of the month. But the status of the subscription is cancelled.
Note that you can test that yourself with Test Clocks: https://stripe.com/docs/billing/testing/test-clocks

waxen gale
#

oh okay, I didnt knew about the test clocks, I was just using the CLI and similar. That looks very helpful. Okay so I will go try out those scenarios myself via test clock, that can answer most of my questions I think, so you can close the thread now, and in case I would have more questions even after using test clock, I will make new post.
So thanks for help, for now!