Sha256: 4c7f9a51b6d73b70afc183f62bacaca9842e117fbc8ca536fdcd1457569462ae
Contents?: true
Size: 705 Bytes
Versions: 16
Compression:
Stored size: 705 Bytes
Contents
# A subscription has moved from the Active status to the Past Due status. This will only be triggered when the initial transaction in a billing cycle is declined. Once the status moves to past due, it will not be triggered again in that billing cycle. module Pay module Braintree module Webhooks class SubscriptionWentPastDue def call(event) subscription = event.subscription return if subscription.nil? pay_subscription = Pay.subscription_model.find_by(processor: :braintree, processor_id: subscription.id) return unless pay_subscription.present? pay_subscription.update!(status: :past_due) end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems