#Sanjeev Sundaravarathan

1 messages · Page 1 of 1 (latest)

tall pulsarBOT
olive plank
#

Hello, what is the interval that you are passing in for both of those price_data hashes?

#

It looks like that interval object might represent a 7 day interval and is being passed in for both. If you make another hash for the 10 day interval or if you just directly define it there, the first phase should properly have a 10 day interval

vital pendant
#

'price_data': {'currency': 'eur', 'product': 'prod_MaZPXRu3zPbgy6', 'recurring': {'interval': 'week', 'interval_count': 1}, 'unit_amount': 1230}

#

end_date = 2022-10-20 15:51:08.113331+00:00

#

end_date.timestamp() = 1666281068

#

but

interval = Specifies billing frequency. Either day, week, month or year.

how can we pass 10 there ?

bold junco
#

Hi 👋 I'm stepping in for @olive plank . Give me a sec to catch up

vital pendant
#

Hi, thanks

bold junco
#

As our docs say about the interval and interval_count:

The number of intervals between subscription billings. For example, interval=month and interval_count=3 bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks).

#

So you could set the interval to "day" and the interval_count to 10 for the first phase. And then use the interval_count of 7 after that

vital pendant
#

so what should my first phase should have for interval and interval count ?

#

say my subscription is 10€ a week,

but first payment can be 10€ for 10days, but from then onwards 10€ for 7days

bold junco
#

That is exactly what I described. Both phases use the interval: day but for the first phase the interval_count is 10 and for the next one it is 7

vital pendant
#

sure will try and get back if any issues in this thread, thanks for your help

bold junco
#

Happy to do it 🙂

vital pendant
#

Sorry have a small doubt, 1st phase i will pass like interval=day and interval_count=10 but 2nd phase can i pass interval=week and interval count=1 ?

#

because above scenario what explained is dynamic, it can happen in monthly, yearly subscription also

bold junco
#

That language is not clear to me. You can pass week and interval count of 1 if that works for you since the number of days is the same.

vital pendant
#

sorry to be clear,

say I have 2 phases, as per my above example,

phase 1 : interval=day, interval_count=10
phase 2: interval=week, interval-count=1

will this be fine to pass?

bold junco
#

Yes that should be fine

vital pendant
#

perfect thanks