Class: Ibandit::GermanDetailsConverter::Rule002002
- Defined in:
- lib/ibandit/german_details_converter.rb
Defined Under Namespace
Classes: Check63
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
507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 |
# File 'lib/ibandit/german_details_converter.rb', line 507 def converted_details unpadded_account_number = @account_number.gsub(/\A0+/, '') if unpadded_account_number == '9999' && @bank_code == '50070010' return { bank_code: '50070010', account_number: '92777202' } end updated_account_number = case unpadded_account_number.size when 5, 6 then unpadded_account_number + '00' when 7 then if Check63.new(unpadded_account_number + '00').valid? unpadded_account_number + '00' else unpadded_account_number end when 8, 9 then unpadded_account_number else msg = 'Account does not support payment transactions' raise UnsupportedAccountDetails, msg end { bank_code: @bank_code, account_number: updated_account_number } end |