Sha256: 4c1f1ece8dbdf7143b920f2e902d60d9f4f5824861a8f364b6c472677f54195a
Contents?: true
Size: 669 Bytes
Versions: 10
Compression:
Stored size: 669 Bytes
Contents
module Pay module Stripe module Webhooks class SubscriptionRenewing def call(event) # Event is of type "invoice" see: # https://stripe.com/docs/api/invoices/object subscription = Pay.subscription_model.find_by( processor: :stripe, processor_id: event.data.object.subscription ) notify_user(subscription.owner, subscription) if subscription.present? end def notify_user(user, subscription) if Pay.send_emails Pay::UserMailer.subscription_renewing(user, subscription).deliver_later end end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems