Querying country implementation details

Use the hook BWG_HOOK_META_DATA to query the implementation details of a Bank Wizard country. You can use this to write generic applications that can support a large number of countries. The hook returns colon (:) separated data that depends upon the setting of the BWG_HOOK_META_CONTROL parameter. Set this parameter by calling BWISetValue passing the appropriate BWG_HOOK_META value. For example, to recover the standard data, call:

BWISetValue(h,BWG_HOOK_META_CONTROL,BWG_HOOK_META_STD);

This query returns all of the available metadata, including the metadata for any unlicensed options. For example, this will return the SWIFT metadata even if you do not have a SWIFT licence.

BWG_HOOK_META_CONTROL set to BWG_HOOK_META_STD

BWI_V_PAR1 Validation level flags, BWG_G_BRANCH_CHECK, BWG_G_INSTITUTION_CHECK and BWG_G_BIC_CHECK. Shows whether the validation level is licensed (1 or 0). You can use this to build menus because it shows which options should be disabled.
For example, for France this returns: "102:1:103:1:104:0", which shows BWG_G_BIC_CHECK is not available (104:0). Therefore the licence key for France does not allow BIC checking.
BWI_V_PAR2 Validation level name. You can display this to describe the functionality when a flag is set. The first string is the description when no flags are set and is typically Account. For France the list would be: "Account:Branch:Institution:BIC"
BWI_V_PAR3 This string depends upon which, if any, flags are set. It contains 5 field descriptions (BWI_V_PAR1 to BWI_V_PAR5) and the maximum number of characters for each field. These strings must be set by BWISetString before calling BWICheck. This allows your application to change the fields and field size based upon the country and the validation level.
For example, France with no flags set returns: "Bank Code:5:Branch Code:5:Account Number:11:Check Digits:2:-:0" and with the BWG_G_BRANCH_CHECK flag set, returns: "Bank Code:5:Branch Code:5:-:0:-:0:-:0"
Where - shows any input field which does not need to be set.
BWI_V_PAR4 Unique number showing which field you access to get to a field in the data set and the length of the field. The data set is: bank or institution name (BWG_MD_BANK_NAME), branch name (BWG_MD_BRANCH_NAME), address lines 1 to 5 (BWG_MD_ADDRESS#, where # is 1 to 5), post code (BWG_MD_POST_CODE), telephone number (BWG_MD_PHONE_NUMBER), fax number (BWG_MD_FAX_NUMBER), closure date (BWG_MD_CLOSURE_DATE) and where accounts are redirected to (BWG_MD_REDIRECTION_TO).
You can use this to design a generic interface that can cope with some countries having more branch data. If a field does not exist in the current data, the number is set to -1.
For example, to access the telephone number, your application must call BWIGetString using a symbolic name. In the UK, the symbolic name is BWI_UK_TEL_NUMBER which maps to 1068, but in Ireland, the symbolic name is BWI_IE_TELEPHONE which maps to 1008. If the country data does not include a branch phone number, there is no symbolic name.
For France this would return: 1004:20:1005:30:1013:8:1014:10:1015:12:-1:0:-1:0:1016:10. This shows that there is no data for Phone or Fax.
Data can be split over two fields. To show that the application must access and join two fields, + follows the major field number.
For the UK, because the phone and post code are split across two fields, this would return:
1006:10:1005:10:1059:10:1060:10:1061:10:1067+:10:-1:0:1065+:10

All characters except colon (:) between values are separators which should be placed between the fields. For example in the UK :1065 1066: indicates that string fields 1065 and 1066 should be displayed in a single output field, separated by a space.

The returned list depends on the validation level set. For example, for France, if you set the BWG_G_INSTITUTION_CHECK flag, institution data is validated and therefore a different field list is returned.

BWI_V_PAR5 If BWI_V_PAR4 ends with a colon (:) then BWI_V_PAR5 contains additional output field definitions. These must be appended to the string returned by BWI_V_PAR4.

BWG_HOOK_META_CONTROL set to BWG_HOOK_META_NAMES

BWI_V_PAR1 to BWI_V_PAR5 are set to a colon separated list of field headings that you can use when displaying branch data.

BWG_HOOK_META_CONTROL set to BWG_HOOK_META_EXTENDED

Set this to return extended information about a country's capabilities. You only need this if you are creating an application with generic graphical screens.

BWI_V_PAR1 This maps fields returned during a search to fields used for validating. The data returned depends upon which flags are set. If no flags are set, then branch level (not account level) data is returned. If the institution flag is set, the institution data is returned. The BIC checking flag does not currently affect this data. You can copy these data fields to the input field to validate account information.
For example when searching United Kingdom branch data, you access the sort code by calling BWIGetString passing item BWI_UK_SORT_CODE_FIELD.
The string has the following format: 1001:-:-:-:- (where a value indicates that the data field should be copied to input field 1).
If a country has a bank code and a branch code, you can specify more than one input field.
BWI_V_PAR2 This shows whether the country supports sub-branch information (any none zero value). The value specifies which field should be displayed in a list of sub-branches. For example, for the UK the string is 1053, indicating that BWI_UK_BRANCH_NAME_PLACE should be displayed. This string can have separators indicating two fields should be joined together, for example "1002 / 1090" or "1002+".

Example

To query how Bank Wizard implements a country, call BWISetValue with item BWG_HOOK_META_FIELD_NAMES set to 1, then call the hook BWG_HOOK_META_DATA a second time to populate the strings BWI_V_PAR1 to BWI_V_PAR5 with strings describing the data fields.

BWICreateHandle h

/* Set the country to the UK */

BWISetValue(h,BWI_V_COUNTRY_CHECK,BWI_C_UK)

BWIHook(BWG_HOOK_META_DATA)

BWIGetString(h,BWI_V_PAR1,flags)

BWIGetString(h,BWI_V_PAR2,checkingLevels)

BWIGetString(h,BWI_V_PAR3,inputFields)

BWIGetString(h,BWI_V_PAR4,availableOutputFieldNumbers)

..

BWISetValue(BWG_HOOK_META_FIELD_NAME,1)

outputFieldDescriptions = " "

/*

Iterate through the strings set by the hook. If the string ends with a colon (:) additional fields are in the next BWI_V_PAR so your application must call BWIGetString again.

*/

for(i = BWI_V_PAR1; i <= BWI_V_PAR5, ++i) {

BWIGetString(h,i,str)

/* Concatenate the strings to form a single string */

outputFieldDescriptions = outputFieldDescriptions + str

}