Class: SquareEvent::WebhookController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
app/controllers/square_event/webhook_controller.rb

Constant Summary collapse

SECRET_ERROR =
'There was no webhook signing secret provided for this webhook'.freeze
NOTIFICATION_ERROR =
'There was no webhook notification URL provided for this webhook. Make sure it exactly matches and starts with https://'.freeze

Instance Method Summary collapse

Instance Method Details

#eventObject



13
14
15
16
17
18
19
# File 'app/controllers/square_event/webhook_controller.rb', line 13

def event
  SquareEvent.instrument(verified_event)
  head :ok
rescue SquareEvent::SignatureVerificationError => e
  log_error(e)
  head :bad_request
end