Class: Ibandit::GermanDetailsConverter::Rule000200

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

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



83
84
85
86
87
88
89
90
91
# File 'lib/ibandit/german_details_converter.rb', line 83

def converted_details
  if @account_number.rjust(10, "0")[7] == "6" ||
      @account_number.rjust(10, "0").slice(7, 2) == "86"
    msg = "Account does not support payment transactions"
    raise UnsupportedAccountDetails, msg
  else
    { bank_code: @bank_code, account_number: @account_number }
  end
end