Sha256: 2b12cd5c3c770236393178a52b7022de04bc592110910e89cf9c80de8cb39619
Contents?: true
Size: 542 Bytes
Versions: 17
Compression:
Stored size: 542 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)) notify_user(pay_charge.customer.owner, pay_charge) if pay_charge end def notify_user(billable, charge) if Pay.send_emails && charge.respond_to?(:receipt) Pay::UserMailer.with(billable: billable, charge: charge).receipt.deliver_later end end end end end end
Version data entries
17 entries across 17 versions & 1 rubygems