Class: Ibandit::GermanDetailsConverter::Rule005200

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

Constant Summary collapse

PSEUDO_ACCOUNT_NUMBER_MAPPING =
{
  "67220020_5308810004" => "0002662604",
  "67220020_5308810000" => "0002659600",
  "67020020_5203145700" => "7496510994",
  "69421020_6208908100" => "7481501341",
  "66620020_4840404000" => "7498502663",
  "64120030_1201200100" => "7477501214",
  "64020030_1408050100" => "7469534505",
  "63020130_1112156300" => "0004475655",
  "62030050_7002703200" => "7406501175",
  "69220020_6402145400" => "7485500252",
}.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



1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
# File 'lib/ibandit/german_details_converter.rb', line 1085

def converted_details
   = PSEUDO_ACCOUNT_NUMBER_MAPPING.fetch(
    "#{@bank_code}_#{@account_number.rjust(10, '0')}",
    nil,
  )

  if .nil?
    msg = "Bank code #{@bank_code} is not used for payment transactions"
    raise UnsupportedAccountDetails, msg
  end

  { bank_code: "60050101", account_number:  }
end