Class: Pay::Stripe::Webhooks::PaymentIntentSucceeded
- Inherits:
-
Object
- Object
- Pay::Stripe::Webhooks::PaymentIntentSucceeded
- Defined in:
- lib/pay/stripe/webhooks/payment_intent_succeeded.rb
Instance Method Summary collapse
-
#call(event) ⇒ Object
This webhook does NOT send notifications because stripe sends both ‘charge.succeeded` and `payment_intent.succeeded` events.
Instance Method Details
#call(event) ⇒ Object
This webhook does NOT send notifications because stripe sends both ‘charge.succeeded` and `payment_intent.succeeded` events.
We use ‘charge.succeeded` as the single place to send notifications
10 11 12 13 14 |
# File 'lib/pay/stripe/webhooks/payment_intent_succeeded.rb', line 10 def call(event) object = event.data.object payment_intent = ::Stripe::PaymentIntent.retrieve({id: object.id}, {stripe_account: event.try(:account)}.compact) Pay::Stripe::Charge.sync(payment_intent.latest_charge, stripe_account: event.try(:account)) end |