Pete Keen is a software developer who has built half a dozen different Stripe and Rails integrations over the past few years. He's been professionally developing software for seven years, most recently for a web game platform named Kongregate.
- More links to docs, examples, and libraries
Hopefully this guide has given you a good overview of working with Stripe with Rails and the tips and hints I've given have been helpful. What follows is a list of links to additional resources that I've found very helpful to my Stripe implementations.
- Use OAuth to connect to your customer's accounts
- Make payments to third-party bank accounts with Recipients and Transfers
Marketplaces let multiple people sell goods and services on the same site at the same time. Stripe lets your SaaS app implement a marketplace in two different ways. With Stripe Connect your users connect their Stripe account with yours, allowing you to make charges with their Stripe account securely and passing fees
- Learn how to set up basic subscriptions
- Create composable service objects
- Advanced subscriptions techniques
So far in this book we've talked about how to sell products once. A customer selects a product, puts their information in, and hits the "buy now" button, and that's end of our interaction with them.
- Learn why processing payments in the background is necessary
- Survey the landscape of background processing systems
- Make charges in the background
Stripe does everything in their power to make sure the payment process goes smoothly for you and your customers, but sometimes things out of everyone's control can go wrong. This chapter is about making sure that your payment system keeps going in the face of things like connection failures and large bursts of traffic
- Handling webhooks with Stripe Event
- Testing your event handling
- Learn how to send PDF receipts
Stripe tracks every event that happens to the payments, invoices, subscriptions, plans, and recipients that belong to your account. Every time something happens they create an Event object and save it to their database. If you'd like you can iterate over all of these events using the API, but a much more efficient way to deal with them is to register a webhook endpoint with Stripe. Whenever they create a
- Learn how to structure processes as state machines
- Add an automatic audit trail to ActiveRecord models
So far in our little example app we can buy and sell downloadable products using Stripe. We're not keeping much information in our own database, though. We can't easily see how much we've earned, we can't see how big Stripe's cut has been. Ideally our application's database would keep track of this. The mantra with financial transactions should always be "trust and verify" and to that end we should be tracking sales through each stage of the process, from the point the
- Build a custom payment form using stripe.js
- Learn how to embed forms in iframes
In the simple Stripe introduction we used Stripe's excellent checkout.js that provides a popup iframe to collect credit card information, post it to Stripe and turn it into a stripeToken and then finally post our form. Sometimes Checkout doesn't really do what you need, though. For example, let's say you're building a subscription site and you need to include a package selection dropdown or a
- Learn about PCI compliance
- Generate and install an SSL certificate
- Set up Rails security tools
Note: I'm not an expert in PCI compliance and this chapter shouldn't be interpreted as legal advice. Rather, this is background information and advice on how to implement Stripe's guidelines. If you have questions, please ask Stripe or your nearest local PCI consultant.
- Create a basic Rails application
- Do the simplest Stripe integration
- Learn how to deploy to Heroku
In this chapter we're going to create a simple Rails application so we have something to work with for later chapters. All of the rest of the examples in the guide will be based on this app.
Our app will sell downloadable products. Users will be able to create products and