Search code examples
ruby-on-railspaypalsaasbilling

Only people who have paid can sign-up for application...?


I built an authentication system for my app following these Railscasts:

http://railscasts.com/episodes/250-authentication-from-scratch and http://railscasts.com/episodes/274-remember-me-reset-password

People are not going to be able to use the app if they don't have an account. It's finally working fine and dandy, just the way I want it to.

Now I'm wondering how exactly to go about restricting sign-ups only to people who have paid. To be honest I'm pretty clueless about the billing aspect of things.

The most basic solution is to use Paypal, and redirect users to the sign-up page after they've paid. I would actually prefer to use Paypal, and don't mind if they have to go outside the site to put in payment details.

But that method has a huge hole: customers could decide to cancel their Paypal subscription and just sign up for an account using the raw signup page. Or even worse, share it with everyone.

I know about RailsKit for SaaS but the price is a little scary (not to mention having to pay $1,000 if I want to use it on multiple sites) so I'd much rather go for an opensource/lower-cost solution if possible.


Solution

  • Came across this: http://railscasts.com/episodes/289-paypal-recurring-billing -- after watching the 24 minute (!) video, Ryan Bates comes to the rescue once again. The "subscription" table can easily be a "users" table with authentication. I'll spend the next couple of days trying to implement this. It's only for Pro users, but if you have this problem I think it's worth spending the $9 to get your hands on it.