Sha256: 9d2be24d6903e817e1f5b239f9237bd5a8bc0200b4cba81c2b8234950365ce5e
Contents?: true
Size: 674 Bytes
Versions: 10
Compression:
Stored size: 674 Bytes
Contents
module Pay module Stripe module Webhooks class SubscriptionDeleted def call(event) object = event.data.object subscription = Pay.subscription_model.find_by(processor: :stripe, processor_id: object.id) # We couldn't find the subscription for some reason, maybe it's from another service return if subscription.nil? # User canceled subscriptions have an ends_at # Automatically canceled subscriptions need this value set subscription.update!(ends_at: Time.at(object.ended_at)) if subscription.ends_at.blank? && object.ended_at.present? end end end end end
Version data entries
10 entries across 10 versions & 1 rubygems