Class: Ibandit::GermanDetailsConverter::Rule004900

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

Constant Summary collapse

PSEUDO_ACCOUNT_NUMBER_MAPPING =
{
  "0000000036" => "0002310113",
  "0000000936" => "0002310113",
  "0000000999" => "0001310113",
  "0000006060" => "0000160602",
}.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



1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
# File 'lib/ibandit/german_details_converter.rb', line 1031

def converted_details
   = @account_number.rjust(10, "0")

   =
    if [4] == "9"
      "#{[4, 6]}#{[0, 4]}"
    else
      @account_number
    end

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

  { bank_code: @bank_code, account_number:  }
end