Class: AdvancedBilling::InvoiceEventPaymentMethod
- Inherits:
-
Object
- Object
- AdvancedBilling::InvoiceEventPaymentMethod
- Defined in:
- lib/advanced_billing/models/invoice_event_payment_method.rb
Overview
Invoice Event Payment Method.
Constant Summary collapse
- INVOICE_EVENT_PAYMENT_METHOD =
[ # TODO: Write general description for APPLE_PAY APPLE_PAY = 'apple_pay'.freeze, # TODO: Write general description for BANK_ACCOUNT BANK_ACCOUNT = 'bank_account'.freeze, # TODO: Write general description for CREDIT_CARD CREDIT_CARD = 'credit_card'.freeze, # TODO: Write general description for EXTERNAL EXTERNAL = 'external'.freeze, # TODO: Write general description for PAYPAL_ACCOUNT PAYPAL_ACCOUNT = 'paypal_account'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = APPLE_PAY) ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/advanced_billing/models/invoice_event_payment_method.rb', line 32 def self.from_value(value, default_value = APPLE_PAY) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'apple_pay' then APPLE_PAY when 'bank_account' then BANK_ACCOUNT when 'credit_card' then CREDIT_CARD when 'external' then EXTERNAL when 'paypal_account' then PAYPAL_ACCOUNT else default_value end end |
.validate(value) ⇒ Object
26 27 28 29 30 |
# File 'lib/advanced_billing/models/invoice_event_payment_method.rb', line 26 def self.validate(value) return false if value.nil? INVOICE_EVENT_PAYMENT_METHOD.include?(value) end |