Skip to content

Instantly share code, notes, and snippets.

@brandonhilkert
Created December 21, 2014 15:41
Show Gist options
  • Select an option

  • Save brandonhilkert/0dbf3a76403548864779 to your computer and use it in GitHub Desktop.

Select an option

Save brandonhilkert/0dbf3a76403548864779 to your computer and use it in GitHub Desktop.
class StripeEventsController < ApplicationController
skip_before_action :verify_authenticity_token
def create
klass = params["type"].gsub(/\./, "_").classify # InvoiceCreated
event_klass = "StripeEvent::#{klass}"
begin
event_klass.constantize.new(params).perform
rescue NameError
end
head :ok
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment