We've moved discussions to Discord

How would I add support for Quarterly Subscriptions?

Richie Khoo
Jumpstart currently supports monthly and annual subscriptios out-of-the-box.
What's involved to add quarterly subscriptions? 
(I'm integrating with Stripe which does support Quarterly payments).

Thanks!
Chris Oliver
It's already supported. A quarterly subscription is simply a monthly interval subscription with a 3 interval count. 👍
Richie Khoo
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
Chris Oliver
You'll adjust that HTML / JS accordingly and that's it. Everything else is handled by Stripe.
Richie Khoo
Chris Oliver re-looking at stripe, lets say I have one product that is available on a quarterly and an annual subscription, is it best to set multiple prices in Stripe on the one product OR making separate stripe products for each clickable pricing item in Jumpstart? Im guessing I need to do the later to fit with how you've built Jumpstart.
Richie Khoo
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
Chris Oliver
You'll define everything in Stripe how you want it, then basically just associate Jumpstart Pro with them by creating Plans with the matching Price ID. 👍
John Quarto-vonTivadar
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)
    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.
Notifications
You’re not receiving notifications from this thread.