Sha256: 4a711b3dad570dafa89fc9a3f76dd334c47960b5f723dfbd6bf36659d52d5737

Contents?: true

Size: 1009 Bytes

Versions: 16

Compression:

Stored size: 1009 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

16 entries across 16 versions & 1 rubygems

Version Path
pay-8.3.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.2.2 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.2.1 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.2.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.1.3 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.1.2 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.1.1 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.1.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-8.0.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-7.3.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-7.2.1 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-7.1.1 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-7.1.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-7.0.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-6.8.1 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb
pay-6.8.0 lib/pay/braintree/webhooks/subscription_charged_unsuccessfully.rb