class Sepa::DirectDebitOrder::BankAccount

Attributes

iban[RW]
swift[RW]

Public Class Methods

new(iban, swift) click to toggle source
# File lib/sepa/direct_debit_order.rb, line 231
def initialize iban, swift
  @iban, @swift = iban, swift
end

Public Instance Methods

to_properties(prefix, opts) click to toggle source
# File lib/sepa/direct_debit_order.rb, line 235
def to_properties prefix, opts
  bic_tag = ( opts[:pain_008_001_version] == "04" ? "bic_fi" : "bic" )

  if swift.nil?
    { "#{prefix}_account.identification.iban"                                     => iban.gsub(/\s/, ''),
      "#{prefix}_agent.financial_institution_identification.other.identification" => "NOTPROVIDED" }
  else
    { "#{prefix}_account.identification.iban"                           => iban.gsub(/\s/, ''),
      "#{prefix}_agent.financial_institution_identification.#{bic_tag}" => swift }
  end
end