It's not opensource, but I really like a lot of the code in the RailsKit SaaS kit ( http://railskits.com/saas/ ). If you're doing a SaaS application that integrates with payment gateways (it sounds like you are), this would be a very well-spent $250, even if only to pick and pull bits of code from it. There are some good Rails projects with source code listed in this thread as well: http://stackoverflow.com/questions…
Re: Ask HN: opensource Ruby/Rails (or Python) based web app for source study?
#11If you're looking for payment/billing solutions, there exist more solutions, i really like these two http://chargify.com/ http://www.zuora.com/