Class: AdvancedBilling::FailedPaymentAction

Inherits:
Object
  • Object
show all
Defined in:
lib/advanced_billing/models/failed_payment_action.rb

Overview

Action taken when payment for an invoice fails: - ‘leave_open_invoice` - prepayments and credits applied to invoice; invoice status set to “open”; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history. This is the default option.

  • ‘rollback_to_pending` - prepayments and credits not applied; invoice

remains in “pending” status; no email sent to the customer; payment failure recorded in the invoice history. - ‘initiate_dunning` - prepayments and credits applied to the invoice; invoice status set to “open”; email sent to the customer for the issued invoice (if setting applies); payment failure recorded in the invoice history; subscription will most likely go into “past_due” or “canceled” state (depending upon net terms and dunning settings).

Constant Summary collapse

FAILED_PAYMENT_ACTION =
[
  # TODO: Write general description for LEAVE_OPEN_INVOICE
  LEAVE_OPEN_INVOICE = 'leave_open_invoice'.freeze,

  # TODO: Write general description for ROLLBACK_TO_PENDING
  ROLLBACK_TO_PENDING = 'rollback_to_pending'.freeze,

  # TODO: Write general description for INITIATE_DUNNING
  INITIATE_DUNNING = 'initiate_dunning'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.validate(value) ⇒ Object



31
32
33
34
35
# File 'lib/advanced_billing/models/failed_payment_action.rb', line 31

def self.validate(value)
  return false if value.nil?

  FAILED_PAYMENT_ACTION.include?(value)
end