Software as a Service Rails Kit

Write your app. Not billing code.

Are you starting to build a new web service with Ruby on Rails? Do you want to avoid having to write the subscription management, recurring billing, and credit card management code?

The SaaS Rails Kit gets your new software-as-a-service site off to a running start by providing you a well-tested and proven recurring billing system with credit card payments. You also get a framework for building membership-based applications, including account signups/upgrades/downgrades, tiered pricing levels with customizable limits (e.g, # of users, # of projects, etc.), multi-tenant data security in a single database, and more.

Supported gateways:

Last Update

20 March 2015: Added support for Rails 4.2.1

Tested with:4.2.1

Choose your license based on your development needs. All licenses come with full source code. They are not limited to a set number of developers, but they are limited based on the number of sites you want to build. A “site” is one web application served from one domain, such as

The license is a one-time fee. You don’t need to pay yearly, per developer, or per server.

Not sure whether you are going to build multiple sites at this point? You can always buy the Single Site License now and get a discount equal to the cost of the Single Site License on a purchase of the Multiple Site License later.

Single Site License

Suitable for developers building a single hosted web service. If you’re a startup building one product, this is the license for you. You can use the SaaS Rails Kit - Single Site License as the basis for one subscription-based site.

Multiple Site License

This license is intended for companies / developers that are building multiple subscription-based services. This would be suitable for companies offering a suite of products, like 37signals, or independent consultants and agencies building solutions for clients. You can build multiple products with the SaaS Rails Kit - Multiple Site License.

By purchasing a license you are agreeing to the license agreement

  • Supported gateways: CIM, Braintree, Payment Express, Stripe, and TrustCommerce, all via ActiveMerchant
  • No local credit card storage. All credit card information is stored with the payment gateway, so you don’t have to worry about the PCI implications of storing credit card numbers.
  • Automated billing script runs nightly for anniversary billing.
  • Configurable subscription renewal period (defaults to one month).
  • Automated notification and retry of failed renewals.
  • Free accounts and one-month trials are supported.
  • Discounts.
  • Optionally collect payment information for paid accounts at account creation.
  • Optionally collect setup fees, if you collect payment info up-front and don’t have a trial period.
  • Easy customization of plan levels — pricing and custom limits.
  • Ability to tweak limits and fees per account.
  • Self-serve account creation.
  • Self-serve account upgrades and downgrades, with limit checking to prevent downgrading to a plan for which the account does not qualify, based on the plan limits.
  • Account lookups by subdomain (multi-tenant).
  • Ability for users to reset their own passwords (Forgot your password?…)
  • Uses the inherited_resources gem to easily scope all model access to the current account.
  • Comes with a limit on the number of users each account can have, complete with controller code, as an example of how to implement limits.
  • Integration of devise gem, customized for a multi-tenant web service.
  • Compatible with Rails 4

Here are some details of the implementation, to give you a better idea of what you’re getting when you purchase a license to use this Rails Kit. Below are the key files that make up the guts of the Rails application:

  • account.rb - The center of the application. Accounts are created by your customers, and everything associated with your application — users, projects, files, etc. — hang off the Account.
  • subscription.rb - This is where the limits are kept, along with how much to charge and when.
  • subscription_address.rb - Tableless model for passing billing address to the payment gateway.
  • subscription_notifier.rb - Emails for account creation, cancellation, up/downgrades, billing receipts, and billing failures.
  • subscription_plan.rb - The plan levels (Free, Basic, Advanced, etc.) and the limits associated with each level.
  • user.rb - A typical Devise user model, with one change in the logins and emails having the uniqueness check scoped to the account.
  • accounts_controller.rb - Account creation, up/downgrades, etc.
  • users_controller.rb - An example of a basic CRUD controller that shows how to use the account scoping and account limits.

If you have more questions about the details of the implementation, feel free to contact me.

Watch how to build a SaaS Rails app in 6 minutes
Watch the 6 minute video that shows setting up and trying out the SaaS Rails Kit.

You can get a demo of the customer-facing functionality by creating a free account at Catch the Best, the application I created that is the source of the SaaS Rails Kit. Once you create your account, click on the Settings link at the top-right to see the account edit action, self-serve plan changing, and account cancellation. If you upgrade to a non-free plan, you’ll get access to the billing information page. Of course you can downgrade back down to a free plan if you really want to. :)

You’ll get some emails as you go through those steps, so watch out for those. Those email triggers and templates are in the Kit as well.

If you have more questions after checking out the UI, feel free to contact me.

Amazing product - best $250 I’ve spent in a while.

— Jarrett Green, Blink Media Group

We were already pretty far along in the development process, so we didn’t use the kit right out of the box. Instead, it was an incredibly useful codebase for selectively pulling out bits and pieces that we needed to implement. It easily saved us a week of implementation time and we were even able to pick up some new coding habits as well.

Thanks again for putting this out. It’s been hugely valuable and was a very welcome purchase at just the right time in our project and really saved us from reinventing the wheel.

— Garrett Dimon, Sifter

I purchased the kit tonight and have been going through the code the past couple of hours. Everything looks very good.

This was the last piece for my subscription based service and it couldn’t have come at a more perfect time. It’s sort of funny, because I wrote out a list of features I needed to implement in my subscription based billing 3 days ago, and then I saw this on your blog today and the feature list is almost identical…. having the payment processing section of my app being the only place where I lacked direct experience, it made buying this a no-brainer :).

— Eric Campbell

We’re using the Saas Rails Kit on a startup site. Even if we just use it as a reference site, it’s totally worth it!

— Tee Parham, Mobile Foundry

A little more than a year ago, I purchased “The Money Train,” an e-book written by Benjamin Curtis. I’ve since purchased a second copy for my business partner because I thought the tips on building an e-commerce site were priceless.

We’ve been working on “the meat” of our site and have been putting off the grueling task of building a recurring billing system. Even armed with the knowledge contained in Benjamin’s e-book, there’s a lot of ways to shoot yourself in the foot when it comes to billing code. Let’s face it, the last thing you want to do is write code that accidentally messes with other people’s money.

I came across Rails Kits and saw that it was from the same guy that wrote that e-book. Even better, he’d finally done what I wished he had done before: built a best-of-breed billing system using his intimate knowledge of billing systems.

I purchased the SaaS Rails Kit and have been working through the code. This really is awesome stuff!

Days and weeks of our time have been saved and we couldn’t be happier.

— Chris Grant,

I’d recommend buying the Rails Kit for Software as a Service from Ben Curtis. It’s $250 well spent on billing/gateway code that has been well tested. I’m using it for a site in production now quite happily.

I recently purchased the SaaS Rails Kit. In the process of deploying it to my server I ran into some issues and problems. In all honesty, the issues were related to my lack of knowledge in a couple areas - not any problems with the SaaS Rails Kit itself. None the less, Benjamin Curtis was very responsive and very helpful in helping me analyze and resolve my issues. He really went the extra mile to ensure that I got the help I needed in a timely and effective manner. I sincerely appreciate his assistance and I’m looking forward to using the SaaS Rails Kit to develop a new production application.

— Ken Hudson
Live chat