• Learn what makes Stripe great
  • Read about this book
  • Learn how the book is organized

Before Stripe came onto the scene, alternatives for accepting payments online were either expensive, annoying, complicated, or all three. PayPal had (and still has) a large portion of the business, but the API is very old and the payment flow is not conducive to a modern application. To accept credit cards, you either you had to use PayPal or integrate at least three separate services: a merchant account, a credit card gateway, and a recurring subscription service. You had the responsibility to make sure every piece was secure, and all of the software that integrated them had to be maintained.

Stripe makes all of this irrelevant. You can create an account on Stripe's website and be making real live charges the next day with simple, easy to use APIs and documentation. The power of this is huge: you can go from idea to accepting payments in very little time, often less than a day.

Why this guide?

If Stripe is so easy to use, why read a whole book about it? There's a few reasons. Stripe's documentation often does not go far enough. It assumes that Stripe will always be available and responsive. It also only gives small or limited examples that don't directly apply to production applications.

This guide goes farther and deeper than Stripe's documentation. It builds up a complete production-level Rails application and covers every step along the way.

In this guide we're going to cover a basic Stripe integration and then expand upon it to cover things like background workers, subscriptions, marketplaces, audit trails, PCI compliance, and more. When you're done with the guide you should have a good grasp on how to build a complete, robust Stripe integration.

How does the guide work?

This guide builds an application to sell downloadable products. By the end of the book it will be a full marketplace where sellers can upload one-off and subscription content.

Each chapter has a GitHub discussion thread associated with it that you can get to by clicking on the Discuss button in the upper left-hand corner. Here, you can ask questions and give help to your fellow readers.

Who am I?

My name is Pete Keen. I've been working with the Stripe API for a little over three years now and have built many applications with it. In addition, I've worked with a wide variety of other payment systems at my full time and consulting jobs and learned quite a lot about how to handle payments in general.


Code examples are marked out like this.

Shorter code snippets are marked like this.

Links are underlined and are all clickable from all of the electronic versions.

Reporting Bugs

Every technical book is going to have bugs, it's just the nature of the beast. To report a bug you can either use the "Report a bug" link in the book dropdown on any chapter page, or you can email it to


Versions of software used in the examples:

  • Ruby 2.3.1
  • Rails 4.2.6
  • Stripe Ruby API 1.43.1
  • Devise 4.1.1
  • Paper Trail 5.2.0
  • PostgreSQL 9.4

The current version of the guide is v2.0.12. See the Changelog for details about guide changes.

You just finished Introduction.

Share your progress with the world!