Class: Pay::Stripe::Webhooks::CheckoutSessionAsyncPaymentSucceeded

Inherits:
Object
  • Object
show all
Defined in:
lib/pay/stripe/webhooks/checkout_session_async_payment_succeeded.rb

Instance Method Summary collapse

Instance Method Details

#call(event) ⇒ Object


5
6
7
8
9
10
11
# File 'lib/pay/stripe/webhooks/checkout_session_async_payment_succeeded.rb', line 5

def call(event)
  # TODO: Also handle payment intents

  if event.data.object.subscription
    Pay::Stripe::Subscription.sync(event.data.object.subscription, stripe_account: event.try(:account))
  end
end