Class: SepaClearer::PaymentProvider
- Inherits:
-
Object
- Object
- SepaClearer::PaymentProvider
- Defined in:
- lib/sepa_clearer/payment_provider.rb
Constant Summary collapse
- SERVICES =
[:sct, :core, :cor1, :b2b]
Instance Attribute Summary collapse
-
#b2b ⇒ Object
Returns the value of attribute b2b.
-
#bic ⇒ Object
Returns the value of attribute bic.
-
#cor1 ⇒ Object
Returns the value of attribute cor1.
-
#core ⇒ Object
Returns the value of attribute core.
-
#name ⇒ Object
Returns the value of attribute name.
-
#sct ⇒ Object
Returns the value of attribute sct.
Instance Method Summary collapse
- #capabilities ⇒ Object
-
#direct_debit_instruments ⇒ Object
Returns a list of provided direct debit methods sorted by there speed :cor1 => 2 business days :core => 3 business days (recurring) & 6 business days for first.
-
#initialize(options = {}) ⇒ PaymentProvider
constructor
A new instance of PaymentProvider.
- #to_a ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ PaymentProvider
Returns a new instance of PaymentProvider.
7 8 9 10 11 12 13 14 |
# File 'lib/sepa_clearer/payment_provider.rb', line 7 def initialize( = {}) self.name = [:name] self.bic = [:bic] self.sct = [:sct] || false self.core = [:core] || false self.cor1 = [:cor1] || false self.b2b = [:b2b] || false end |
Instance Attribute Details
#b2b ⇒ Object
Returns the value of attribute b2b.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def b2b @b2b end |
#bic ⇒ Object
Returns the value of attribute bic.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def bic @bic end |
#cor1 ⇒ Object
Returns the value of attribute cor1.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def cor1 @cor1 end |
#core ⇒ Object
Returns the value of attribute core.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def core @core end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def name @name end |
#sct ⇒ Object
Returns the value of attribute sct.
5 6 7 |
# File 'lib/sepa_clearer/payment_provider.rb', line 5 def sct @sct end |
Instance Method Details
#capabilities ⇒ Object
16 17 18 |
# File 'lib/sepa_clearer/payment_provider.rb', line 16 def capabilities SERVICES.map { |s| [s, send(s)] }.select { |_,v| v }.map { |k,v| k } end |
#direct_debit_instruments ⇒ Object
Returns a list of provided direct debit methods sorted by there speed :cor1 => 2 business days :core => 3 business days (recurring) & 6 business days for first
23 24 25 |
# File 'lib/sepa_clearer/payment_provider.rb', line 23 def direct_debit_instruments (capabilities & [:core, :cor1]).sort end |
#to_a ⇒ Object
31 32 33 |
# File 'lib/sepa_clearer/payment_provider.rb', line 31 def to_a to_hash.values end |
#to_hash ⇒ Object
35 36 37 38 39 40 41 42 43 44 |
# File 'lib/sepa_clearer/payment_provider.rb', line 35 def to_hash { name: name, bic: bic, sct: sct, core: core, cor1: cor1, b2b: b2b, } end |