Sha256: 4aa216717c61af888300ce1283ed6d0c1a78eda54373f3c84f76a441ddc600af

Contents?: true

Size: 412 Bytes

Versions: 7

Compression:

Stored size: 412 Bytes

Contents

module Pay
  module Stripe
    module Webhooks
      class ChargeRefunded
        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).refund.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_refunded.rb
pay-3.0.23 lib/pay/stripe/webhooks/charge_refunded.rb
pay-3.0.22 lib/pay/stripe/webhooks/charge_refunded.rb
pay-3.0.21 lib/pay/stripe/webhooks/charge_refunded.rb
pay-3.0.20 lib/pay/stripe/webhooks/charge_refunded.rb
pay-3.0.19 lib/pay/stripe/webhooks/charge_refunded.rb
pay-3.0.18 lib/pay/stripe/webhooks/charge_refunded.rb