Class: Payflow::Webhooks::StripeController
- Inherits:
-
ApplicationController
- Object
- ActionController::API
- ApplicationController
- Payflow::Webhooks::StripeController
- Defined in:
- app/controllers/payflow/webhooks/stripe_controller.rb
Instance Method Summary collapse
Instance Method Details
#receive ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'app/controllers/payflow/webhooks/stripe_controller.rb', line 6 def receive verifier = SignatureVerifier.new(provider: :stripe, request: request) return head :unauthorized unless verifier.valid? payload = JSON.parse(request.raw_post) WebhookJob.perform_later(provider: :stripe, payload: payload) head :ok rescue JSON::ParserError head :bad_request end |