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
512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 |
# File 'lib/ibandit/german_details_converter.rb', line 512 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 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 |