Recommended Rails plugins for software as a service app - ruby-on-rails

I am investigating potential Rails plugins or Gems to help develop a SAAS type app. Specifically I am looking for help in two areas:
Restricting access to certain areas of the app based on the account's plan. For example, a bronze account allows access to some functionality, upgrading to silver unlocks access to new features and functionality. Basically, just controlling what accounts have access to what controllers.
Managing subscriptions, invoicing and taking payments. This app will be charging on an annual or quarterly basis, there's a 30 day free trial with no payment details needed up front, and I think the intention is to use PayPal Website Payments Pro (although that is not set in stone).
Given the above, can anyone recommend any Gems or plugins? I have had a look at the SAAS Railskit and I am not opposed to spending a bit of money. However, I'd certainly want to hear good things from people who have used it first, and also how easy it is to pick appart the Railskit and apply it to my own application (as I am not starting from scratch here - needs to integrate with Authlogic too).
Thanks in advance for your help.

Bruno Bornsztein offers a Rails engine that implements a SaaS site. Look for striped_rails on GitHub.
You might want to look at the open source example application for a Rails Membership/Subscription/SaaS Site from the RailsApps project. It comes with a tutorial that explains the implementation in great detail. It does what you describe using Devise for authentication and Stripe for billing.

My SaaS Rails Kit does integrate well with pre-existing apps... many of my customers do that. And the testimonials at the site are real. :) Plus there are many other similar testimonials that I haven't published -- a lot of good things have been said about it. :)

While there are quite a few different gems out there which do different things different ways, I would definitely suggest that you start with these:
activemerchant — I would use this for payment processing. It is honestly the best (and most extensible) gem out there, and its especially well-tested for PayPal usage, although I'd look elsewhere for SaaS billing because PayPal is utter crap.
declarative_authorization — This is probably the most extensible plugin for authorization, which allows different users with different roles to do different things. For instance, you can build roles for each plan.
You should also take a look at the following Railscasts:
"Declarative Authorization" - http://railscasts.com/episodes/188-declarative-authorization
"Authorization with CanCan" - http://railscasts.com/episodes/192-authorization-with-cancan
"PayPal Express Checkout" - http://railscasts.com/episodes/146-paypal-express-checkout
"Integrating Active Merchant" - http://railscasts.com/episodes/145-integrating-active-merchant
Hope this helps!

You would also need subdomain routes, for restricting your user into its own subdomain.

Related

Ruby on rails SaaS application where to begin, what tools to use

I'm at the point in my application where I would like to integrate a saas solution into my application using ruby on rails. So far everything has been good except I am unsure where to begin.
My Idea:
I would create a subscription.rb and plan.rb model. A user would belong to subscription and subscription would have many users. Next subscriptions would have many plans and plans would belong to subscription. I would then add role for each plan to limit a user from certain parts of the application maybe using cancan. After setting everything up I would integrate stripe into my application to handle the payment side of things.
The above is how I am thinking of setting this up. It may truly be the wrong concept but that is why I wrote it so you could get an understanding of what I am thinking. I know I could use third party services like recurly, chargify, etc but I am opening my eyes to see if this can be done using a similar a approach.
What technologies have you used or prefer to use when creating a saas application?
Is my approach wrong? If so what is a better way to approach this?
Any tips or advice for creating a saas application such as technologies, ruby on rails tools etc.
Take a look at the open source example application for a Rails Membership/Subscription/SaaS Site from the RailsApps project. It comes with a tutorial that explains the implementation in great detail. Here's the libraries it uses:
Devise for authentication
CanCan for authorization
Stripe for recurring billing
Twitter Bootstrap for front-end CSS
Using Stripe for billing makes implementation easy and reduces security risks as Stripe handles all the automated recurring billing.
The RailsApps example puts CanCan together with Rolify and uses roles that correspond with subscription plans to manage user access. It shows how to simplify the architecture so there's no need for the complexity of a subscription.rb or plan.rb model (though you could refactor that if you wanted to).
1) I use MongoDB as the db backend for the flexibility, RSpec for TDD, HAML/SASS, and RailsAdmin for a quick admin dashboard.
2) Its not necessarily wrong, but its up to you in terms of what you plan on allowing users to do.
3) So wait, have you already developed your tool or are you asking us to plan your tool. Also, what kind of Saas application did you intend to build?

Ecommerce Subscription for Rails

Have seen some conversations revolving around this, but hoping for some current input as to perhaps the best libs and services available for Rails developers at the moment who are implementing a subscription membership based website.
I'm interested in any libs or frameworks with which you may be familiar through GitHub or elsewhere as well as what service has given you the best experience so far for clients and your own sanity? I'm leaning towards paypal and perhaps also including Google Checkout, however there are certainly a lot of other options.
I'd like for it to be clean and to appear as integrated into the website as possible while carrying the trust of a larger service provider such as PayPal and Google.
Additionally, these are mostly micro payments at around $1.00 USD. Sometimes purchases go up to $15 to $30.
EDIT: Since initial post I've found SaaS Rails Kit (http://railskits.com/recurring_billing/). Has anyone had experience with this vs Recurly? Doing some research as per the first answer, it appears Recurly is the superior option at this point for our model, however this Rails Kit may be an even better option if it has met some very positive experiences in comparison with other options.
The one I prefer: Chargify (soon to be available on heroku)
Another I know but haven't used: Recurly (soon on heroku too)

Paypal, Recurring Billing, and ActiveMerchant

I'm trying to research how to add a subscription based pay model on an existing site of mine, but am running into a lot of conflicting information and caused me to be a bit lost.
All I need is a very simple way to set up recurring billing (per month) by credit card. I just need a simple solution, but am having a hard time finding the best practices of setting it up.
So far I understand that this is supported by Paypal's Website Payment Standards option. I just have a few questions regarding how I should implement it:
First, does Paypal require a user to register for recurring billing with Website Payment Standard?
I planned to use ActiveMerchant but I found some blogs that says ActiveMerchant doesn't support recurring billing from Paypal. is this true?
I found the SASS Rails Kit by railskits.com, which says it supports recurring billing with Paypal's Website Payments Standard. If I purchased this, would the code be clear enough to understand and implement in my own site, or is it kind of packaged deal for starter sites and not existing sites?
I found a lot of blog with help with recurring billing with ActiveMerchant, but using Paypal's Express Checkout. I read about Express Checkout on the Paypal site, but I still can't quite understand what it is, and how it's different from Website Payment Standard. Can anyone explain this in a simple way?
If anyone could answer even just one of these questions, I'd be very grateful!
**By the way, before it gets suggested, I have watched all of Ryan Bates' Paypal screencasts about Paypal, which are great for basics or buying items in a shopping cart, but I don't understand how it should work with recurring billing. Also, it seemed like he skipped some important steps in the video (e.g. the Paypal docs says after your app receives an IPN, you need to send back a confirmation of reception to Paypal, but Ryan does not do this in his screencast). I'm just trying to make sense of all this!
First, does Paypal require a user to register for recurring billing with Website Payment Standard?
With Website Payment Standard, you direct your customers to fill out their information on paypal's site. to me, that's kind of cheesy, but your mileage may vary. If you are going to be making some money, it's well worth integrating it into your site and upgrading to Website payments Pro, imo.
I planned to use ActiveMerchant but I found some blogs that says ActiveMerchant doesn't support recurring billing from Paypal. is this true?
It doesn't out of the box, but you have to create a new Module class that gets added into Active Merchant, plus the views and really, it's a lot of work. No should say to you that it's easy to do, because they are either liars or really good at programming.
I found the SASS Rails Kit by railskits.com, which says it supports recurring billing with Paypal's Website Payments Standard. If I purchased this, would the code be clear enough to understand and implement in my own site, or is it kind of packaged deal for starter sites and not existing sites?
Sure, it may be clearer, but if i recall, they use a referential transaction to 'fake' recurring billing, as of this august, when i wrote my solution. As for existing sites, you may have to gerry rig it into your existing app, or create it around it. TBH, the $2XX price tag scared me off.
I found a lot of blog with help with recurring billing with ActiveMerchant, but using Paypal's Express Checkout. I read about Express Checkout on the Paypal site, but I still can't quite understand what it is, and how it's different from Website Payment Standard. Can anyone explain this in a simple way?
Paypal Express requires you to have your own merchant account. A merchant account is where your money will end up and is the only for your customer's bank account to speak to your bank account easily.
Website Payments Standard uses Paypal's own merchant Account through your Paypal Account, in order to pay you.
Again, imo, pay the 30 bucks and go with Website Payments Pro.
Express Checkout is the same as Website Payments Standard. It is the method of redirecting your customers to PayPal to collect their payment info. There's a simple implementation of just creating a form that posts directly to PayPal, and you can optionally use IPN to get info about the transaction. There's also an API for Payments Standard, that lets you set up the transaction with PayPal behind the scenes, then redirect your customer to PayPal, then query PayPal via the API for details on the just-completed transaction. The SaaS Rails Kit (I'm the author of it) uses this API.
Website Payments Pro is PayPal's offering that lets you collect the payment info at your site and pass that info via their API to PayPal. You then get information about the transaction via the API. The customer never leaves your site. PayPal's TOS require you to offer Express Checkout even if you offer Payments Pro. Payments Pro costs $30 / mo. (as I recall) and requires you to fill out an application for a Pro account.
We're also developing a subscription based site and this looks pretty interesting - http://chargify.com/. Could save quite a bit of coding time.
If we are discussing how to do subscriptions using a Ruby on Rails /ActiveMerchant environment I am not sure why no one has brought up Freemium, which is a sister project to ActiveMerchant that focuses on subscriptions.
I use the SaaS Railskit, and Highly recommend it. The code is clean, commented and legible. It can be dropped in to an existing app, with minimal tweaking, or used as the foundation for a new app. I suppose it work fine if you just wanted to use it as a reference, or stand-alone payment processing app.
Hope that helps!
One other potential option is to hit one of the other recurring billing capable gateways like Authorize.net or BrainTree. I don't normally suggest Authorize.net because of their slightly gimpy development process (you have to request a test account if you want to do continual testing which takes about 2 days) but I've done integrations with them on several sites and it works reasonably well. Though they do have the same inane policy as PayPal of naming 19 products which all seem to do what you need but don't in reality.
The only bonus to this is that people don't have to be PayPal members in order to do the payment and I believe Authorize.net has lower fees but that may have just been our accounts; our sales guy was a killer negotiator.
active_merchant and the SaaS Railskit both support Authorize.net and BrainTree.
I wouldn't recommend buying the Railskit just to look at quality code that uses active_merchant though, I'm certain there are other places that you can look for free. Railskits are really designed to be used as a base and it's almost guaranteed to have a different set of assumptions about setup than you had planned on so if you've made it anywhere on your project merging the two would almost certainly be a pain. On the other hand, if you're still just starting the site the Railskit might well be a great way to start over with a really sane environment.
If you're using Paypal subscriptions then you will probably need a Paypal business account. Nothing scary it's just a case of supplying a business name to paypal and requesting your existing account to be converted over.
I also looked through a few Paypal subscrition solutions for rails and eventually just created my own.
I've written it up here Adding PayPal subscriptions to your Rails App with 1 Controller.
Question: First, does Paypal require a user to register for recurring billing with Website Payment Standard?
Yes, I believe so. Paypal wants the user to be able to cancel the payments as needed.
Question: I planned to use ActiveMerchant but I found some blogs that says ActiveMerchant doesn't support recurring billing from Paypal. is this true?
That's what I see, too. You can implement it through the Paypal SOAP interface, though. It's not too tough.
shameless plug:
I went through all the docs for Paypal and pulled out the good stuff for implementing standard and soap-based methods. You can find it for $8.50 on pragprog.com
/shameless plug:

Recommendation on development framework for a browser based online product catalogue?

I have to develop a online product catalog which will eventually developed into a simple online ordering system, I have never developed a web application before. Please recommend an application framework which might be a good choice for this kind of apps.
Is Ruby on Rails a good choice?
Thanks.
Definitely Ruby on Rails a Good Canditate for developing online e-commerce application , There are many e-commerce application developed in Ruby on Rails , which are successfully running .
Open source e-commerce application spree
Shopify CMS for online store .
Agile web development book has explained the working of rails with an example how to develop a product catalog , which will be more helpful for you.
Many plugins and gems available for payment gateway like the Payment gem .
What more you could need to develop an online store .If your resources are less and the development time should be speedy then rails a good candidate for your requirement.
Finally its your interest and skills set and choose the platform which suits your requirement :)
Hope this helps !
Rails is as a good choice as any other web framework can be.
Here are a few links to help you getting started with it.
The Guides
The Screencasts
The Agile Web Development with Rails book
And for your online ordering feature, you could look at Active Merchant.
Is it necessary to develop it yourself?
There are a number of great drop in solutions for a catalog/shop application. Some offer both the source code for customized deployment, others offer a package including hosting, setup and maintenance. In addition to what's already been mentioned, here are a few more e-commerce solutions that are ready to do.
Keep your hosting solution in mind when deciding how to proceed. A lot more hosts offer PHP than rails.
PHP Based ZenCart (Both)
Django Based Satchmo (Source only)
Rails Shopify (Hosted only)
Do you really want to reinvent the wheel?
If you've never written a web application before do NOT start with something that involves billing. That's a good way to end up in a lot of trouble. Billing is hard to get right, and if you get it wrong you can end up facing huge fines or even in court. In most cases, you have to comply with PCI DSS security standards, and if you fail to do so and information is lost or stolen, you're likely looking at $500,000 in fines.
If you absolutely must do e-commerce, outsource it to PayPal or Google Checkout so that your risk is limited mainly to charging people the wrong amount by accident.
That warning out of the way, Rails is a good place to start if you've never done web development before. It has it's problems, but they'll go unnoticed until you've been working with it for at least two or three years. i.e., they're fairly minor, and are likely to annoy only a very experienced developer with significant project requirements.
Full disclosure: Google is my employer, so obviously I think you should opt for the Google Checkout option.

Rails for ecommerce site

I was planning on using RoR for an upcoming e-commerce site but keep reading
comments that give the impression that this framework is not yet fit for this type of a commercial application.
What is the state of it? May it be used for large scale online stores etc?
Is compatibility and the frequently changing framework an issue to worry about?
Late answer... but I feel I should share some of the latest stuff available.
Is compatibility and the frequently
changing framework an issue to worry
about?
No. But it sounds like you are a beginner with Rails -- anyone starting a big e-commerce project should consider sticking with a framework they are already comfortable with.
If you definitely want a Rails app and your site is primarily an e-commerce shopping site, I recommend you look at Spree (http://spreecommerce.com/).
If your site is primarily a web application with a small purchasing component, consider using ActiveMerchant directly to hack together your own simple shopping page.
If you are making a primarily e-commerce shopping site, you would do well to at least consider non-Rails solutions. There are so many options for standalone web stores, shopping carts linked to CMS apps like WordPress and Drupal, third-party services for a fee (e.g., Shopify for shops, Chargify for subscription services) and many of them can be customized with minimal coding.
Rails is up to the task, but if you aren't already a "Rails guy" there's no particular reason to choose it for a new e-commerce app.
yes, rails can do it quite well. check out active merchant site, as well as shopify, which is a rails site specifically for ecommerce. as far as changes to the framework, i've found them pretty easy to keep up with on our applications.
Agree with other's posts about activemerchant. That combined with someone like Braintree as the gateway (who are programmer oriented) make it pretty simple to do.
It depends on what features you want in your system.
Chris mentioned some tools for payment processing and order / cart management.
If you want something for a 'large scale online store' then I'm not sure there is anything yet. Specifically when I worked with ATG Dynamo Commerce Server, there was a massive amount of effort invested in their pricing, discount and promotion elements.
Very late to answer but try out http://www.ror-e.com
https://github.com/drhenner/ror_ecommerce
Disclaimer: I wrote it, but it is more developer friendly and starts you off with a lot of best practices baked in. Good luck

Resources