Class: Stripe::EventsController

Inherits:
ApplicationController show all
Includes:
EventDispatch
Defined in:
app/controllers/stripe/events_controller.rb

Instance Method Summary collapse

Methods included from EventDispatch

#dispatch_stripe_event, #retrieve_stripe_event

Instance Method Details

#createObject



6
7
8
9
10
11
12
13
14
15
# File 'app/controllers/stripe/events_controller.rb', line 6

def create
  @event = dispatch_stripe_event(request)
  head :ok
rescue JSON::ParserError => e
  ::Rails.logger.error e.message
  head :bad_request, status: 400
rescue Stripe::SignatureVerificationError => e
  ::Rails.logger.error e.message
  head :bad_request, status: 400
end