Sha256: 610797aaf5128e355829ad9e6f8eca3f08fc7474aac1e2f7983192e7176b8e34
Contents?: true
Size: 696 Bytes
Versions: 30
Compression:
Stored size: 696 Bytes
Contents
module Pay module Stripe module Webhooks class CustomerDeleted def call(event) object = event.data.object billable = Pay.find_billable(processor: :stripe, processor_id: object.id) # Couldn't find user, we can skip return unless billable.present? billable.update( processor_id: nil, trial_ends_at: nil, card_type: nil, card_last4: nil, card_exp_month: nil, card_exp_year: nil ) billable.subscriptions.update_all( trial_ends_at: nil, ends_at: Time.zone.now ) end end end end end
Version data entries
30 entries across 29 versions & 1 rubygems