Sha256: eb44a715fdb2293da9050cd71908135903935d1bff61680e8952f1e24ec2bd93
Contents?: true
Size: 1001 Bytes
Versions: 36
Compression:
Stored size: 1001 Bytes
Contents
# A subscription successfully moves to the next billing cycle. This will also occur when either a new transaction is created mid-cycle due to proration on an upgrade or a billing cycle is skipped due to the presence of a negative balance that covers the cost of the subscription. module Pay module Braintree module Webhooks class SubscriptionChargedUnsuccessfully def call(event) subscription = event.subscription return if subscription.nil? pay_subscription = Pay::Subscription.find_by_processor_and_id(:braintree, subscription.id) return unless pay_subscription.present? # pay_customer = pay_subscription.customer # pay_charge = Pay::Braintree::Billable.new(pay_customer).save_transaction(subscription.transactions.first) # if Pay.send_emails # Pay.mailer.with(pay_customer: pay_charge.customer, charge: pay_charge).receipt.deliver_later # end end end end end end
Version data entries
36 entries across 36 versions & 1 rubygems