Class: Ibandit::GermanDetailsConverter::Rule001001

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

Constant Summary collapse

PSEUDO_ACCOUNT_NUMBER_MAPPING =
{
  '50050201_0000002000' => '0000222000',
  '50050201_0000800000' => '0000180802'
}.freeze
BANK_CODE_MAPPING =
{
  '50050222' => '50050201'
}.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



408
409
410
411
412
413
414
415
416
# File 'lib/ibandit/german_details_converter.rb', line 408

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

  { bank_code: updated_bank_code, account_number:  }
end