Class: Ibandit::GermanDetailsConverter::Rule003400
- Defined in:
- lib/ibandit/german_details_converter.rb
Constant Summary collapse
- PSEUDO_ACCOUNT_NUMBER_MAPPING =
{ '0500500500' => '4340111112', '0000000502' => '4340118001' }.freeze
Instance Method Summary collapse
Methods inherited from BaseRule
Constructor Details
This class inherits a constructor from Ibandit::GermanDetailsConverter::BaseRule
Instance Method Details
#converted_details ⇒ Object
841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 |
# File 'lib/ibandit/german_details_converter.rb', line 841 def converted_details if @account_number.to_i.between?(800000000, 899999999) msg = 'Account does not support payment transactions' raise UnsupportedAccountDetails, msg end updated_bank_code = Rule003101::BANK_CODE_MAPPING.fetch( @account_number.rjust(10, '0').slice(0, 3), @bank_code ) updated_account_number = PSEUDO_ACCOUNT_NUMBER_MAPPING.fetch( @account_number.rjust(10, '0'), @account_number ) { bank_code: updated_bank_code, account_number: updated_account_number } end |