Skip to content

Instantly share code, notes, and snippets.

View craigs's full-sized avatar

Craig Sullivan craigs

View GitHub Profile
@craigs
craigs / hooks_controller.rb
Created October 21, 2010 22:33 — forked from ryansch/hooks_controller.rb
Chargify Hooks Controller
require 'md5'
class Chargify::HooksController < ApplicationController
protect_from_forgery :except => :dispatch
before_filter :verify, :only => :dispatch
EVENTS = %w[ test signup_success signup_failure renewal_success renewal_failure payment_success payment_failure billing_date_change subscription_state_change subscription_product_change ].freeze
def dispatch
event = params[:event]