Jumpstart uses the Pay gem for handling payments and billing.
Jumpstart Pro supports using Stripe, Braintree, or a combination of the two for payments and is configured for monthly and yearly subscriptions out of the box. PayPal is supported through the Braintree integration and may be used entirely on its own or in combination with the Braintree credit card form.
Each subscription is attached to a Account, which allows us to offer multiple subscriptions like Github, should you wish to use that.
You may also use the payments functionality in Jumpstart Pro to process one-time payments instead. In fact, that's what we're using on our website to sell Jumpstart Pro!
If you remove all of your payment providers, the Pricing page and the Billing management page under Account Settings will be disabled.
Jumpstart and the Pay gem payments using Stripe are now SCA compatible. We provide authentication for setting up new cards and will email customers when a subscription payment requires additional authentication.
We use the Stripe CLI to use webhooks to keep subscriptions and payments up-to-date in our application now. This is required to handle SCA payments that require authentication.
Subscriptions in Jumpstart Pro are billed against a Account, not a User. This allows you to handle various different billing situations.
To subscribe an individual, they just need to be logged in as their personal account and the subscription will be billed to them.
Account billing allows you to share resources and billing functionality with the entire account and allows any member to manage the subscription. It's much easier to start with account billing support than adding it later, so we've got you covered even if you don't need it right away.
For more information on how accounts work in Jumpstart Pro, check out the Accounts documentation.
Plans can be defined in the Plans Admin and allows for changes without deploying code. Each plan should be defined with the price amount in cents.
The Stripe and Braintree IDs are used to subscribe the user to the matching plan defined inside Stripe or Braintree.
Stripe IDs may either be a Plan ID or a Price ID.
Generic trials are trials without a card or subscription plan. These can be configured in
app/models/account.rb by uncommenting the
before_create block. You can check if an account is on generic trial with
Subscription trials are trials that require both a card upfront and a subscription plan selected. You can simply add
trial_period_days when creating a Plan in the admin. When the subscription is created, the
trial_period_days will be passed along to Stripe and Braintree for adding a trial to the subscription.
Processing payments with Stripe is as simple as adding your Stripe credentials, enabling the Stripe configuration, and adding plans with Stripe IDs on them.
/webhooks/stripe endpoint is available in your application for handling webhooks from Stripe. You can add the webhook to Stripe to have it process activity from your Stripe account.
Jumpstart now requires webhooks to support SCA. You must use the Stripe CLI to forward webhooks to your local Rails server to process subscriptions and payments with SCA.
stripe listen --forward-to localhost:5000/webhooks/stripe
Once stripe CLI is running it should display your signing secret. Add it to your credentials to make sure your server can receive stripe events.
Alternatively, you can use ngrok or localtunnel to expose your Rails server to the internet so it can receive webhooks.
Processing payments with Braintree is as simple as adding your Braintree credentials, enabling the Braintree configuration, and adding plans with the Braintree IDs on them. We handle all the heavy lifting such as calculation proration discounts to allow users to swap between monthly and yearly plans which Braintree does not support out of the box.
Before using Braintree, you will need to define a
plan-credit discount in your Braintree control panel. This discount will be used to properly prorate subscriptions that change from yearly to monthly billing, or from monthly to yearly billing.
The discount amount configured in the Braintree control panel can be any value you wish, as Pay will override the defined amount with our own custom amount each time we apply the coupon. This coupon is needed since Braintree does not natively support prorating subscriptions across subscription frequencies.
/webhooks/braintree endpoint is available in your application for handling webhooks from Braintree. You can add the webhook to Braintree to have it
PayPal is supported out of the box using Braintree for processing.
To enable PayPal in Jumpstart, you'll first need to enable it in your Braintree account under the Processing Options section.
Jumpstart supports two PayPal configurations:
The Braintree Drop-In UI is a widget like Stripe elements that handles all the various enabled payment options. If you wish to process both credit cards and PayPal through Braintree, this is the best option.
If you want to sell products that are one-time purchases, you can use the payment forms from Jumpstart Pro to do this.
The easiest way to do this is to have a user put their card in first and then show them the checkout form.
An example from the Jumpstart Pro website when purchasing a license: We check if the current account has a card on file, if so we let you purchase a license. If not, we display the card form.
<% if !current_account.card_type? %> <p>First, add a payment method to your account: <%= render 'cards/forms/stripe' if Jumpstart.config.stripe? %> <%= render 'cards/forms/braintree' if Jumpstart.config.braintree? %> <%= render 'cards/forms/paypal' if Jumpstart.config.paypal? %> <% else %> <%= render 'form', license: @license %> <% end %>
Then on the LicenseController create action, we use
current_account.charge(amount) from Pay to issue the charge before creating the license.
A user cannot switch from paying with Stripe to Braintree during their subscription. They must cancel and resubscribe to switch payment providers.