BankValUK
Unified Software © 2010
SYNOPSIS
require 'rubygems' #using uppercase letters may load the file more than once which can cause 'already set constant' warnings
require 'bankval::uk'
obj = BankVal::UK.new
ans = obj.bank_val_uk('json','00-01-26','abcd123','12345')
Description
This Gem controls the calling of REST web services from Unified Software’s UK Bank Validation services. It will transparently call Unified’s back up servers in the unlikely event of any issues with the main servers. The services which can be used from this Gem are:
[BankValPlus2]Validates UK bank sort code / account numbers. Returns transposed sort code and account number plus latest EISCD (Extended Industry Sorting Code Directory) data.
object = BankVal::UK.new
method = object.bank_val_uk(format,sortcode,accountno,userid,pin)
[getBranchDetails2]Look up UK bank branch information using latest EISCD (Extended Industry Sorting Code Directory) data.
object = BankVal::UK.new
method = object.bank_val_uk(format,sortcode,userid,pin)
Including the Gem
To allow the usage of this gem you must have RubyGems installed. To check if you have, open a command prompt (win) or console window (*nix) and type ‘gem’. If RubyGems is installed you will see a help message. If it isn’t a command unrecognised message will appear.
To install RubyGems please refer to :
docs.rubygems.org/read/chapter/3
Once Rubygems is installed you can install the BankValUK gem from Rubygems.org by either;
*searching for BankValUK from within your IDE (e.g. in netbeans tool>RubyGems)
*opening a command prompt (win) or a console window (*nix) and typing ‘gem install BankValInt’
Once the BankValInt gem is installed on your system it can be included in your code by adding the following two lines:
require ‘rubygems’ require ‘bankval’
Calling the services
To call the services simply create an instance of the relevant class (as shown in the description above) and call the exposed method (again as shown above)
Parameters
The required parameters for the services are as follows:
- Format
-
the response format (either xml, json or csv)
- Sort Code
-
the IBAN to be validated
- Account Number
-
the account number to be validated (optional)
- UserID
-
available from www.unifiedsoftware.co.uk
- PIN
-
available from www.unifiedsoftware.co.uk
The parameters must be passed in the order shown although account number is optional. In the case of an account number not being passed in the web service getBankDetails2 will be called rather than bankValUKPlus2.
Method Returns
The methods will return the web services response as a string formatted in either xml, json, or csv depending on the format parameter