How would I add support for Quarterly Subscriptions?



Ok that's great. I should clarify. To launch we'll only have quarter & annual subscription offerings and hence we want the pricing selector to say quarterly/annually rather than monthly/annually as it is currently.
So basically I can make changes on the UI and as long as the underlying subscription is monthly with interval of 3, then behind the scenes it will correctly charge with stripe? Just confirming.
Thanks
So basically I can make changes on the UI and as long as the underlying subscription is monthly with interval of 3, then behind the scenes it will correctly charge with stripe? Just confirming.
Thanks




I've had a further look around, since you connect your Products with Stripe "Prices" seems I can make Products in Stripe and put all the related prices under there and then link to each "price" from the Jumpstart plans.
"Products and Prices are the primary objects used to model subscriptions. Products define what you’re selling and prices define how to charge for the product.. Products can have multiple prices so you can vary pricing by billing interval, currency, or amount. You can also use multiple prices to phase out old prices that you no longer offer."
ref: https://stripe.com/docs/billing/subscriptions/model
"Products and Prices are the primary objects used to model subscriptions. Products define what you’re selling and prices define how to charge for the product.. Products can have multiple prices so you can vary pricing by billing interval, currency, or amount. You can also use multiple prices to phase out old prices that you no longer offer."
ref: https://stripe.com/docs/billing/subscriptions/model


I might also add if you have a discount coupon or a one-time product fee (such as a "setup fee"), you can add those to your app without having to attach them all together inside Stripe.
Example: you have a subscription for $10/month with a $10 setup fee or a subscription for $25/quarter and no setup fee. You set up the subscriptions as a Product with two recurring price points in Stripe, and you create a stand alone Product (non-recurring, one-time) with the setup fee in Stripe. And then in Jumpstart you can attach that setup fee product to just the monthly plan and not the quarterly plan.
Ditto with the coupon, though it's handled a tad differently
Small warning: Jumpstart isn't setup to do that out of the box, you do have to do a little configuration on your end. There are several ways. Chris has a very professional way of handling it but it's not built into Jumpstart. My down-n-dirty solution was a bit more hacky, insofar as I re-wrote the `subscriptions_controller`'s `subscribe` method to read a plan's "addons" attribute (in the DB as a JSONB field on Plans, which are just Stripe's "API ID"s for those products/coupons ... works just like the "details" attribute) and then did something like this:
`
def complex_subscribe(plan, payment_processor)
Example: you have a subscription for $10/month with a $10 setup fee or a subscription for $25/quarter and no setup fee. You set up the subscriptions as a Product with two recurring price points in Stripe, and you create a stand alone Product (non-recurring, one-time) with the setup fee in Stripe. And then in Jumpstart you can attach that setup fee product to just the monthly plan and not the quarterly plan.
Ditto with the coupon, though it's handled a tad differently
Small warning: Jumpstart isn't setup to do that out of the box, you do have to do a little configuration on your end. There are several ways. Chris has a very professional way of handling it but it's not built into Jumpstart. My down-n-dirty solution was a bit more hacky, insofar as I re-wrote the `subscriptions_controller`'s `subscribe` method to read a plan's "addons" attribute (in the DB as a JSONB field on Plans, which are just Stripe's "API ID"s for those products/coupons ... works just like the "details" attribute) and then did something like this:
`
def complex_subscribe(plan, payment_processor)
addon_product_id = plan.addons['product_id']
addon_coupon_id = plan.addons['coupon_id']
sub = {}
sub[:plan] = plan.id_for_processor(payment_processor.processor)
sub[:trial_period_days] = plan.trial_period_days
sub[:coupon] = addon_coupon_id unless addon_coupon_id.blank?
sub[:add_invoice_items] = [{price: addon_product_id}] unless addon_product_id.blank?
payment_processor.subscribe(**sub)
end
`
which the Pay gem and Stripe were both happy about. This way I was able to subscribe to a subscription and add a one-time charge (the setup) and a recurring or one-time coupon to the invoice all at once.
end
`
which the Pay gem and Stripe were both happy about. This way I was able to subscribe to a subscription and add a one-time charge (the setup) and a recurring or one-time coupon to the invoice all at once.
Notifications
You’re not receiving notifications from this thread.