Class: Pay::Webhooks::BaseController

Inherits:
ActionController::API
  • Object
show all
Defined in:
app/controllers/pay/webhooks/base_controller.rb

Overview

Verifies a processor's webhook request and queues the event for Pay::Webhooks::ProcessJob.

Subclasses implement verified_event, which raises a Pay::Error when the signature doesn't check out, and event_type. Processors whose parsed event can't be serialized override event_payload; Stripe overrides queue? to skip test-mode events.

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
# File 'app/controllers/pay/webhooks/base_controller.rb', line 11

def create
  event = verified_event
  queue_event(event) if queue?(event)
  head :ok
end