Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

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.

share|improve this question
add comment

3 Answers

up vote 1 down vote accepted

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.

share|improve this answer
1  
+1 for Stripe, the javascript solution is baller –  scottschulthess Mar 4 '12 at 19:45
add comment

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).

share|improve this answer
add comment

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)

share|improve this answer
    
I'd like to scaffold Mailers etc. to have a framework in place for those mail requests and such –  opensourcechris Dec 6 '11 at 19:32
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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