#Mio

1 messages · Page 1 of 1 (latest)

twilit oceanBOT
drifting shadow
#

hi, looking...

#

yes, it looks like it was created about 5 hours later than the billing cycle. That can happen, it's because there are a lot of invoices being created all across Stripe at midnight UTC time on the 1st of a month, like yours. So at those times our systems are under a lot of pressure so creation of invoices can be delayed.

The actual billing period that the invoice and subscription charges for is unaffected, it's just that payment processing happens a couple of hour later.

silk owl
#

this machanism is not stable right? something like if the our account has 20000 records of invoice creations occured at the same time, the first 10000 will be at the right timing but the other will be set as 5 hours or something like that.

the reason why we asking is because our sercvice design a bit different logic than the logic of the Stripe. we show to the users from what is saved in our database and the database will sync with the stripe when the billing cycle datetime.

im thinkiong to have interval for the resync if the invoice creation is not yet occured.
hoping to know how long i should set for the interval of resync

drifting shadow
#

ultimately the way to build it is you look at the Invoice when you get webhook that it's paid and you update your database with the updated period from the Subscription object related to the event, which will be correct. The created date of the Invoice shouldn't really be an input. As we describe in the docs :
https://stripe.com/docs/billing/subscriptions/webhooks#active-subscriptions

Your site receives an invoice.paid event.
Your webhook endpoint finds the customer the payment was made for.
Your webhook endpoint updates the customer’s access expiration date in your database to the appropriate date in the future (plus a day or two for leeway).