Sha256: 0ce21debe9d68b3e7df105ce68174638e8966a823a0e039ecb51b1cd0075d097
Contents?: true
Size: 696 Bytes
Versions: 16
Compression:
Stored size: 696 Bytes
Contents
module Pay module Paddle module Webhooks class SubscriptionCancelled def call(event) subscription = Pay.subscription_model.find_by(processor: :paddle, processor_id: event["subscription_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.zone.parse(event["cancellation_effective_date"])) if subscription.ends_at.blank? && event["cancellation_effective_date"].present? end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems