Sha256: f0b136ea3e9402b63d385a31f6d3b5be44dccc9ea3c691a2dee7b08559a3e63d
Contents?: true
Size: 667 Bytes
Versions: 13
Compression:
Stored size: 667 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
13 entries across 13 versions & 1 rubygems