Announcing Saaz – Stripe and ActiveRecord playing well together

We are releasing a new gem we are calling Saaz. It makes it easier to integrate the payment processor Stripe into your Rails application.

Here at Revelry Labs, we often develop apps that require credit card processing. We’ve used a variety of payment processors depending on the needs of the project, but Stripe is our favorite. Stripe takes away most of the pain of credit card processing and gives us a clean API for making one-time charges and subscriptions.

However, the stripe gem is (rightfully) a direct mapping onto the Stripe API, and is framework agnostic. For our applications, the downside is that it is not “Railsy.” It is easy to end up with too much work happening in the wrong place (controllers). We wanted to write less code and have the work happen in the right place (models). We wanted Stripe models that behave just like every other Rails model.

Our new gem is called ‘Saaz’, which is both a play on ‘SaaS’ and a reference to the Saaz noble hop variety. It is a Rails engine which exposes Customer and Subscription models which allow you do everything you can do with the corresponding Stripe APIs, but are also ActiveRecord models. You can use them in relations, validate them, decorate them and query them. Saaz caches your Stripe API calls and knows when information needs to be written back to Stripe, which makes your application faster.

For convenience, the gem also includes controllers, views and assets that make it easy to build a credit card form with Stripe in the right way.

The gem is still in an early (0.0) version, and we are rapidly adding new features.

More Posts by Robert Prehn: