Sha256: 1fdb705e62bf8b1175cd485dda48b13afa141a3c6f2d71757868511fe83c07b5
Contents?: true
Size: 985 Bytes
Versions: 15
Compression:
Stored size: 985 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_model.find_by(processor: :braintree, processor_id: subscription.id) return unless pay_subscription.present? # billable = pay_subscription.owner # charge = Pay::Braintree::Billable.new(billable).save_transaction(subscription.transactions.first) # if Pay.send_emails # Pay::UserMailer.with(billable: billable, charge: charge).receipt.deliver_later # end end end end end end
Version data entries
15 entries across 15 versions & 1 rubygems