Over a million developers have joined DZone.

Check German Account Numbers And Bank Codes

·

require 'ktoblzcheck'

$bc="20030700"
$an="0"

puts "Testing Bank Code: #{$bc} / Account No. #{$an}"

KtoBlzCheck.new do |kbc|
  name,location=kbc.find($bc)
  if name
    puts "Bank found! #{name} located in #{location}"
  else
    puts "Bank not found!"
  end
  case kbc.check($bc,$an)
    when KtoBlzCheck::ERROR
      puts "Failed, bank code and account number don't match"
    when KtoBlzCheck::OK
      puts "Success, valid combination of bank code and account number"
    when KtoBlzCheck::UNKNOWN
      puts "Unknown."
    when KtoBlzCheck::BANK_NOT_KNOWN
      puts "Unknown bank code"
    else
      puts "Never reached :)"
  end
end



Resources: Fotos bearbeiten
Topics:

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}