Billing

Jumpstart uses the Pay gem for handling payments and billing.

Accepting Payments

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 Team, 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!

Strong Customer Authentication (SCA)

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

Subscriptions in Jumpstart Pro are billed against a Team, 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 team and the subscription will be billed to them.

Team billing allows you to share resources and billing functionality with the entire team and allows any member to manage the subscription. It's much easier to start with team 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 teams work in Jumpstart Pro, check out the Teams documentation.

Defining Plans

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

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

The /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.

Stripe CLI

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

Alternatively, you can use ngrok or localtunnel to expose your Rails server to the internet so it can receive webhooks.

Braintree

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.

Plan Credit Discount

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

The /webhooks/braintree endpoint is available in your application for handling webhooks from Braintree. You can add the webhook to Braintree to have it

PayPal

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:

  1. PayPal inside Braintree's Drop-In UI
  2. Standalone PayPal button

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.

The Standalone PayPal button is designed for users who want to use PayPal with Stripe or by itself. This embeds a PayPal checkout button in the form without using the Braintree Drop-In UI. It still uses the Braintree Javascript to do this, but without the credit card form.

One-time Payments

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 team has a card on file, if so we let you purchase a license. If not, we display the card form.


    <% if !current_team.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_team.charge(amount) from Pay to issue the charge before creating the license.

Caveats

A user cannot switch from paying with Stripe to Braintree during their subscription. They must cancel and resubscribe to switch payment providers.

Since the Javascript for processing Stripe and Braintree are different, it's hard to build a single form with both Stripe and Braintree credit card fields in one. With some changes to our Javascript, we may be able improve this in the future.