Sha256: a3c0ae514027b34a69e4df805e7fcaad4f97ead75de5b614e1e72dfd373f16f0

Contents?: true

Size: 414 Bytes

Versions: 7

Compression:

Stored size: 414 Bytes

Contents

module Pay
  module Stripe
    module Webhooks
      class ChargeSucceeded
        def call(event)
          pay_charge = Pay::Stripe::Charge.sync(event.data.object.id, stripe_account: event.try(:account))

          if pay_charge && Pay.send_emails
            Pay::UserMailer.with(pay_customer: pay_charge.customer, charge: pay_charge).receipt.deliver_later
          end
        end
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
pay-3.0.24 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.23 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.22 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.21 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.20 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.19 lib/pay/stripe/webhooks/charge_succeeded.rb
pay-3.0.18 lib/pay/stripe/webhooks/charge_succeeded.rb