The Descriptor File

H-Sphere Merchant Gateway SDK uses main.xml as the descriptor to specify components of the Merchant Gateway package. The syntax of the descriptor file is described bellow. All tags and attributes are case sensitive.

Tag merchgateway

The descriptor file must contain the merchgateway tag. The following tags are defined inside of the merchgateway tag:

nameName of the package (usually, the merchant gateway's name).
Example: AuthorizeNet
versionVersion of the package
Example: 1.2
titleTitle of the merchant gateway. It should be defined in the language file (see the template tag).
Example: admin.epayment.mygateway = MyGateway
formDefines the merchant gateway settings that are later loaded via the MerchantGatewayManager class. It also defines the HTML form where the admin enters these settings.Yes
classesSpecifies where the classes for the merchant gateway are located. By default, it should be set to buildYes
langLanguage filesNo

Tag form

The form tag defines the input form for merchant gateway settings. Input fields are defined by the field tags inside the form tag. Each field tag corresponds to an input element in the form where the admin enters the merchant gateway settings, like server, port, login and password. The field tag has the following attributes:

nameField name - corresponds to the name attribute of the input tag in HTMLYes
labelText label of the field, which is displayed in HTML form. Labels must be defined in the language files, and here, the value of the label attribute is the label identifier from the lang file.
Example: admin.epayment.port
typeType of the field - corresponds to the type attribute for the input tag in HTML. At present, only text and password types are supported. Yes
defaultSets the default value of the input field in HTMLNo
defaultLangDefault value of the field is defined in the lang file. This attribute is checked only if the default attribute is not set.
Example: admin.epayment.mygateway
checkYAFV constraint for client-side input validation in HTML formNo

Tag lang

lang tag defines language files. The following tags are used within the lang tag to define different language files:

templateThe language file for templates. The file is defined in H-Sphere as hsphere_lang.propertiesNo
userThe language file for Java classes. The file is defined in H-Sphere as messages.propertiesNo
menuThe language file for menus. The file is defined in H-Sphere as

You must specify the full path to lang files! Each of those tags can have the encoding attribute to define the encoding for the given lang file. You can have multiple tags of each type, as long as encodings are different. Encodings can be like en_US or ru_RU, etc... If no encoding is specified, the file will be used as the "default" encoding (no encoding will be appended to its name in the package).