#Tzafi

1 messages · Page 1 of 1 (latest)

real voidBOT
balmy breach
#

Hi! Let me help you with this.

#

Could you please share the Event ID? evt_xxx

last frost
#

yes - evt_1MnjwAGaxbf4cZoRdOWbPFQC

balmy breach
#

The actual subscription will be renewed in 2 days, that's when the invoice will be created: "period_start": 1679591340.
Then it will take a few days to finalize the invoice and pay.

last frost
#

the subscription is this: sub_1Mnju6Gaxbf4cZoR8N8Ah3X6, currently in trial period that should end on April 2nd. My question is why I got an invloice.upcoming event 14 days before (April 2nd) and not 7 days before as I configured in the "Upcoming renewal events" on test mode..?

balmy breach
#

I understand. Please let me check.

torn aspen
#

these settings don't take effect immediately, if you change the setting it only applies to new subscriptions and to existing subscriptions after they have a billing cycle

#

think of it as when the subscription is created, it snapshots the current value of the setting to know when it should generate the event; it only picks up the new snapshot the next time the subscription updates itself on a new billing cycle

last frost
#

thank you for the answer, I think it was set for 7 days already before.

torn aspen
#

seems that way

#

maybe it's a bug then with how test clocks work and they use some default settings.

#

looking in more detail, why do you think it's 14 days in advance?

#

is it because you got the event today and today is more than 7 days from April 2? Today in the 'real world' doesn't matter, the subscription is using a test clock. In the test clock's frozen time, it is 2023-03-26 , which is within that 7 day window for the event to happen. From what I see internally, we generated that invoice.upcoming event because of the clock advancing (the event was generated at the same time as we were advancing the clock to March 26th per your request https://dashboard.stripe.com/test/logs/req_0xkTGKqHn3E2fr ) to within 7 days of the upcoming date

#

@last frost

real voidBOT
last frost
#

thanks. you're right about the test clock. I guess what was confused for me is that on the events list - it says "an upcoming invoice scheduled for automatic payment in 14 days".
Another thing is a subscription we updated yesterday with the trial days - in order to get the invoice.upcoming event today - and we didn't got it yet: sub_1MiZ6vGaxbf4cZoRD142k2jp. Should it be at a constant hour?

torn aspen
#

well it's not 7 days yet for that one

#

the billing date is 2023-03-28 13:55: UTC and it's only March 21st 10:51 UTC right now so it will be a few hours before it's actually 7 days in advance of the next invoice, so the event won't happen until at least then, as far as I know

#

we have some regularly-running job that will look at existing subscriptions and check if they meet the criteria and send the event, it's not at a specific time of the day

#

it says "an upcoming invoice scheduled for automatic payment in 14 days".
I had a look at the code in the dashboard and that's basically a bug

#

it computes the number "14" there by subtracting the time the Event object was created from the date inside the subscription object; but the time the Event object is created is the real-world time of March 20th, which is subtracted from April 2nd date; that part of the dashboard code is not aware of the test clock properly.

last frost
#

ok, thank you for all the explanations. I'll just wait for today's event to come.

real voidBOT