Chargify: Rails Powered Recurring Billing Service With An ActiveResource API »

Created at: 25.01.2010 21:58, source: Rails Inside, tagged: Elsewhere Tools

chargifyx.pngOver the last couple of months, a new billing and subscription company - Chargify - have been popping up around the Web 2.0, SaaS, and Rails scenes. Notably, Chargify's CEO is Lance Walley, co-founder of Rails hosting company Engine Yard. Rails developers are a pretty entrepreneurial lot and Chargify have a lot to offer Rails developers who need to set up billing systems.

Upside? Dead Simple Billing

In short, Chargify offers "recurring billing for Web 2.0 & SaaS companies." Once you've started an account (which is free, until you top 50 customers) you can add information about your merchant account, products, subscription plans and pricing models. Then you either direct your customers to a Chargify hosted payment page or supply payment details through an ActiveResource-powered API, and billing is done.

Downside? Merchant Account Needed

Sadly, it seems that Chargify is authorize.net only right now. I asked them whether they were considering adding other systems such as PayPal, but that's not currently a priority. You currently need a merchant account (or be ready to apply for one through them). For other systems, however, there are other services such as Spreedly (which supports 10 different systems and has a gem built by a third party - Richard Livsey).

All Rails: Backend and API

I spoke with Jonathan Kay and Michael Klett of Grasshopper (the company behind Chargify) and it turns out they're Rails powered back and front. Not only that, but their API (chargify_api_ares) is too. Here's some example code for creating a recurring billing record in their system (assuming you've already added the customer to the system - just one other API call):

# Create a subscription from a customer reference
subscription = Chargify::Subscription.create(
  :customer_reference => 'moklett',
  :product_handle => 'chargify-api-ares-test',
  :credit_card_attributes => {
    :first_name => "Michael",
    :last_name => "Klett",
    :expiration_month => 1,
    :expiration_year => 2020,
    :full_number => "1"
  }
)

# Update credit card information
subscription.credit_card_attributes = {:full_number => "2", :expiration_year => "2015"}
subscription.save

Nice, right? It's ActiveResource powered but doesn't necessarily require Rails.

Demo App

Nathan Verni has put together an entire Rails demo app for showing off how Chargify works from a Rails POV. Compared to the old school wrestling with payment systems directly, it's ridiculously easy.

Disclaimer: Chargify is a Ruby Inside advertiser but this is not a paid post or similar. It merely comes from editorial interest caused by talking with them a lot!

Post to Twitter Tweet This Post


more »

Hammertime: Ruby Interactive Error Console »

Created at: 20.01.2010 23:14, source: Ruby Inside, tagged: Tools

stophammertime.png Hammertime (GitHub repo) is a new interactive error console for Ruby by Avdi Grimm, modelled after those found in the Squeak/Smalltalk and LISP environments. It fills some of the same roles as ruby-debug, except in a less intrusive and more Ruby-esque fashion. Be warned though.. currently it's for Ruby 1.8.x only.

Installation is via RubyGems (gem install hammertime) and the library is activated in your app with require 'hammertime'. That's it; you're good to go. Once activated, any exception raised in your app will result in a Hammertime prompt appearing where you can choose from a number of options, including:

  • Continue (process the exception normally)
  • Ignore (proceed without raising an exception)
  • Permit by type (don't ask about future errors of this type)
  • Permit by line (don't ask about future errors raised from this point)
  • Backtrace (show the call stack leading up to the error)
  • Debug (start a debugger)
  • Console (start an IRB session)

For more info, a walkthrough of a basic debugging process using Hammertime is shown in Avdi's Hammertime blog post. I get a feeling that if this is refined with the extra features Avdi's planning (such as making retries easier from the console and, perhaps, support for exceptions raised in native code) and Ruby 1.9 support is added, Hammertime could become a standard debugging tool in any good Rubyist's toolbox.

[job] Snapizzi is currently looking for a Ruby and Rails developer to join their team. Alternatively, check out one of the other 11 jobs on our Ruby jobs board!


more »

Rackamole: Rack-Based Monitoring For Your Ruby Web Apps »

Created at: 04.01.2010 05:22, source: Ruby Inside, tagged: Tools

rackamole.pngRackamole (GitHub repo) is a Rack application that lets you to monitor the interactions between users and your own Rack-based application (e.g. any Rails or Sinatra app). As well as pumping out information to the console or a log file, there's a Web interface called Wackamole to give you the skinny on your app activity.

Rackamole's creator, Fernand Galiana (also of ZiYa charting library fame), says that Rackmole is well suited for determining what parts of your application you need to work on next. It traps and records feature usage, performance issues, and application exceptions, and by integrating as a middle layer between your HTTP server and your Web app, it can work with almost any backend system out of the box.

wackamole.png

Above: Wackamole and Rackamole in action

As well as logging data and presenting it through Wackamole, Rackamole also has a built-in e-mail notifier so you can be alerted when certain actions occur that need your attention. In this way, it's sort of like a New Relic-lite or like FiveRuns' now defunct Dash system. MongoDB fans might also appreciate that Rackamole also has support for logging to a MongoDB database out of the box.


more »

Amp: A Revolution in Source Version Control (in Ruby!) »

Created at: 27.11.2009 16:03, source: Ruby Inside, tagged: Cool Tools

amp.png Amp is a new Ruby based project that aims to "change the way we approach VCS" (version control systems). Currently it's basically a port of the Mercurial version control system - a common alternative to the Git system that's more popular in Rubyland - but it aims to abstract things to the point where it could be used in place of Git, Bazaar, SVN, CVS, Darcs, and so forth.

The creators of Amp believe that while there are lots of great repository formats out there, none of the official clients are "truly good software" and so they're aiming to build something that abstracts away all of the pain into a heavily customizable Ruby library and client. Even now you can add your own commands to Amp or adjust those that already exist, meaning you can totally customize a powerful source control tool to your own taste.

One of the points that's constantly stressed on Amp's rather well designed official site is that the project is actively looking for new contributors and help. They have a repo on GitHub if you want to fork and issue pull requests, as well as an IRC channel on Freenode, #amp.

caliper-logo.png[ad] Find duplication, code smells, complex code and more in your Ruby code with Caliper! The metrics are free and setup takes just one click. Get started!


more »

Racksh: A Rails-Console-A-Like for Rack-Based Ruby Apps »

Created at: 23.11.2009 15:46, source: Ruby Inside, tagged: Miscellaneous Tools

Have you ever yearned for something like Rails's script/console or Merb's merb -i in your other Rack based apps? If so, then Marcin Kulik's racksh, inspired by Heroku's console, might be for you.

Racksh is a console for Rack based ruby web applications. It allows you run a console in the context of an application environment for Rails, Merb, Sinatra, Camping, Ramaze (or even your own framework) provided there is a rackup file in the root directory.

When you run the racksh command, it loads the whole application environment just like a Rack web server, but instead of running the app it starts an irb session where you can invoke commands.

$ racksh
Rack::Shell v0.9.4 started in development environment.
> Article.all
=> # returns all articles...

As of version 0.9.4 (released this week), racksh uses Bryan Helmkamp's rack-test to simulate HTTP requests to your Rack application via the $rack variable.

$ racksh
Rack::Shell v0.9.4 started in development environment.
> $rack.get "/"
=> # returns a Rack::MockResponse

Racksh also allows you to apply configuration through a .rackshrc file. This can be used to set headers which will be used for requests, or to make additional setup requests (e.g. to make sure a user is logged in).

Install as a gem from Gemcutter, or get the source from Github.

gem install racksh -s http://gemcutter.org

For more details, check out the project's README, and these recent posts on Marcin's blog.


more »