Class: Pay::Webhooks::PaddleBillingController

Inherits:
ApplicationController show all
Defined in:
app/controllers/pay/webhooks/paddle_billing_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/paddle_billing_controller.rb', line 8

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