#mtanzi-sub-anchor

1 messages ยท Page 1 of 1 (latest)

fresh wagon
#

hello, reading one sec

#

you're trying to anchor the Subscription beyond its next billing date, which won't work right, you can only update anchor b/w now and the next recurring cycle

little bone
#

looking at the data from chargebee the nextbilling date is chargebee_subscription.current_term_end

#

[9] pry(main)> Time.at 1648672876 # current_term_start
=> "2022-03-30T22:41:16.000+02:00"
[10] pry(main)> Time.at 1651351276 # current_term_end
=> "2022-04-30T22:41:16.000+02:00"

#

The data that is in the error is a couple of hour before

Time.at 1651333793
=> "2022-04-30T17:49:53.000+02:00"

#

but I don't know where this date is coming from

fresh wagon
#

stepping away, a colleague will be helping out in a bit

little bone
#

thanks..

wraith linden
#

Hi ๐Ÿ‘‹ I'm stepping in

little bone
#

Hi!

wraith linden
little bone
#

let me check... one sec

#

req_N5jkjJqVGsfq3p

wraith linden
#

So it appears to me that the back-dated start date combined with the per month price is creating a situation where the next billing cycle will start sooner than you want to set the billing cycle anchor. This is where the 1651333793 is coming from. Given how close they are I suspect there may be some rounding issue with the timestamps

little bone
#

mm that's around 5 hours

#

the thing is only some of the subscriptions are failing with this issue

#

and the data I pass is just take from chargebee and used in stripe... I am assuming is correct

#

what would you suggest I should do to solve this issue?

wraith linden
#

Well for starters we do not recommend recurring monthly billing at the end of the month. When February comes around it will move the date to the 28th and leave it there. The 1st of the month is a better option in general.

#

My second question is why you need to update the billing cycle anchor to a new date if it already is basically a match for when the next billing cycle will start

little bone
#

one interesting thing is that the time sent by stripe (1651333793) is exactly 1month from the time I run the migration

wraith linden
#

run the migration
What do you mean by that?

little bone
#

no nevermind..

#

the migration run today at "2022-03-31T15:49:52.50Z"

#

Well for starters we do not recommend recurring monthly billing at the end of the month.

we don't do at the end of the month... it happen by chance that now was at the end

wraith linden
#

Okay

little bone
#

we just take the data from chargebee and put into stripe ๐Ÿ™‚

#

the monthly it's calculated depending on the product

wraith linden
#

Okay so it appears there is a 5 hour gap between when the next billing cycle will occur and when you are trying to set the billing cycle anchor, you are trying to replicate the identical data as is currently in Chargebee and this conflict is preventing that. Do I have that correct?

little bone
#

yes

#

that's the issue

wraith linden
#

Okay .... Hmmmm

dusty pecan
#

Hi there ๐Ÿ‘‹ apologies for the delay here, just wanted to confirm that you're still struggling with this?