#devsmith

1 messages · Page 1 of 1 (latest)

dreamy ploverBOT
prime compass
#

Good question, for payment installments like that we typically recommend a Subscription or Subscription Schedule that automatically cancels after say 3 months.

#

Checking in to how to do 39 days, then two 30 day periods

hushed ravine
#

@prime compass Could you please advise solution for this

prime compass
#

Hey, apologies for the wait. So I think you will want to use a subscription schedule for this as a normal subscription can't automate different period lengths like this.
Basically, the schedule has phases with a list of items the customer is subscribed to.
https://stripe.com/docs/api/subscription_schedules/object#subscription_schedule_object-phases-items-price
So you would make a price where interval="day" and interval_count=39 and then a second price with the 30 day interval
https://stripe.com/docs/api/prices/create#create_price-recurring-interval_count
Then set up a subscription schedule with 2 phases, the first with the 39 day price and set the phase to go for one iteration
https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-phases-iterations
Then the second phase would be the 30 day price for two iterations

hushed ravine
#

But in our case 39 day cost of booking will be different and 30 days cost will be different

prime compass
#

You can do whatever combo of prices over whatever lengths of time you want here

#

The main idea is that you create a new Price object for each amount + length of time combo that you need and then create a schedule that changes between them

dreamy ploverBOT