I've been thinking about making a generator for managing subscriptions with options for a couple different payment processing services, it is something that I would use. Are there any existing examples of this, or any thoughts on a generator. I thought it might work like the scaffold function, similar to the authentication function in nifty-generators.

EDIT: Also, It seems that there should be a lot of security concerns when implementing payment processing, having a consistent and common way to generate this would let me make sure best practices and security are followed the same in all my apps.

3 Answers 3


Given the pain you'll experience when you start to navigate the byzantine requirements of PCI compliance, I think "best practices" in this area is not to handle payment processing in the first place.

At least, not within your application.

Stripe is an online payment processor geared toward developers. It's a breeze to accept credit card payments through their API, and it offloads responsibility (and liability) for PCI regulation issues to someone else. Which is a Good Thing.

There's even a Railscasts episode all about using Stripe to handle payments, and the stripe-rails gem will bootstrap the process for you.

Oh, and Stripe handles periodic billing (for subscriptions) for you.

Before you head down this road, I highly recommend taking a look at available technologies you might leverage. Although the code for payment processing is often fairly straightforward, the liability issues are massive.

P.S. I don't work for Stripe or anything. I just think their product/service is excellent, and a good match for your use case.


For the payment part have a look at ActiveMerchant. If there is a gem for subscriptions you can find at RubyGems.

If it doesn't exist yet, it would really be a good idea to write one. I have seen several sites that could have used one. Though this may become a more complicated task than a simple generator. To handle subscriptions (especially in combination with payments) you would need a process (like cron job) that checks subscriptions in regular intervals and generates payments or mails requests for renewals (and several more tasks, depending on usage scenario)

  • I'd like to scaffold Mailers etc. to have a framework in place for those mail requests and such
    – OpenCoderX
    Dec 6, 2011 at 19:32

Take a look at the open source example application for a Rails Membership Site with Stripe or Rails Membership Site with Recurly from the RailsApps project. Both are generated by the Rails Composer tool. You could use the rails_apps_composer gem to create application templates to handle other billing services (but Stripe and Recurly may be sufficient).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.