class SepaClearer::PaymentProvider

Constants

SERVICES

Attributes

b2b[RW]
bic[RW]
cor1[RW]
core[RW]
name[RW]
sct[RW]

Public Class Methods

new(options = {}) click to toggle source
# File lib/sepa_clearer/payment_provider.rb, line 7
def initialize(options = {})
  self.name = options[:name]
  self.bic = options[:bic]
  self.sct = options[:sct] || false
  self.core = options[:core] || false
  self.cor1 = options[:cor1] || false
  self.b2b = options[:b2b] || false
end

Public Instance Methods

capabilities() click to toggle source
# 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() click to toggle source

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

# File lib/sepa_clearer/payment_provider.rb, line 23
def direct_debit_instruments
  (capabilities & [:core, :cor1]).sort
end
to_a() click to toggle source
# File lib/sepa_clearer/payment_provider.rb, line 31
def to_a
  to_hash.values
end
to_hash() click to toggle source
# 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