Class: Ibandit::GermanDetailsConverter::Rule003301

Inherits:
BaseRule
  • Object
show all
Defined in:
lib/ibandit/german_details_converter.rb

Constant Summary collapse

PSEUDO_ACCOUNT_NUMBER_MAPPING =
{
  "0000022222" => "5803435253",
  "0001111111" => "0039908140",
  "0000000094" => "0002711931",
  "0007777777" => "5800522694",
  "0000055555" => "5801800000",
}.freeze

Instance Method Summary collapse

Methods inherited from BaseRule

#initialize

Constructor Details

This class inherits a constructor from Ibandit::GermanDetailsConverter::BaseRule

Instance Method Details

#converted_detailsObject



825
826
827
828
829
830
831
832
833
834
835
836
837
# File 'lib/ibandit/german_details_converter.rb', line 825

def converted_details
  updated_bank_code = Rule003101::BANK_CODE_MAPPING.fetch(
    @account_number.rjust(10, "0").slice(0, 3),
    @bank_code,
  )

   = PSEUDO_ACCOUNT_NUMBER_MAPPING.fetch(
    @account_number.rjust(10, "0"),
    @account_number,
  )

  { bank_code: updated_bank_code, account_number:  }
end