#victoria.fabris - installments

1 messages · Page 1 of 1 (latest)

tepid dust
#

Hi there. Any reason you are using sub schedules instead of a plain subscription?

snow badge
#

im my application the user can choose how many installments they want, for example a purchase of $400 they can choose to make in 2 installments of $200 each

#

in that way, in receiving from the front end the user input for the number of installments

#

i already saw that stripe dont make the calculations automatically, so i was thinking in receiving this number of installments, and do the calculations of the price of each installment on my own, and then send this value inside stripe.SubscriptionSchedule.create()

#

but i dont know if im following the right path

tepid dust
#

Ok. I believe you can actually do this with just a plain subscription to simplify things. You could define the price on the fly. For example, if the cost is $400 and the user chooses 2 installments, you could create the subscription with a price per month of $200: https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data-unit_amount and a cancel at date of 2 months into the future: https://stripe.com/docs/api/subscriptions/create#create_subscription-cancel_at

snow badge
#

ok, so i would just use stripe.Subscription.create( ), right? i still need to create a price and product object? with stripe.Product.create() and stripe.Price.create()

#

i dont understand where will i use these objects

tepid dust
#

No, if you define the price per month on the fly, as I linked above, you actually won't need to create a price object (since the per month charge will be different depending on how many installments the customer chose). However, you will still need to pass the product id: https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data-product

snow badge
#

another question: will i need to make a stripe.PaymentIntent.create() before the stripe.Subscription.create()? or this dont make sense? 🤔

tepid dust
tepid dust
#

No problem!