Class: Pay::Webhooks::LemonSqueezyController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pay/webhooks/lemon_squeezy_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
# File 'app/controllers/pay/webhooks/lemon_squeezy_controller.rb', line 8

def create
  if valid_signature?(request.headers["X-Signature"])
    queue_event(verify_params.as_json)
    head :ok
  else
    head :bad_request
  end
rescue Pay::LemonSqueezy::Error
  head :bad_request
end