AddDeviceParam Method
Adds a device parameter to the collection.
Syntax
client.addDeviceParam(field, value, valueType, category, [callback])
Callback
The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).
The callback for this method is defined as:
function(err){ }
'err' is the error that occurred. If there was no error, then 'err' is 'null'.
'err' has 2 properties which hold detailed information:
err.code err.message
Remarks
AddDeviceParam adds a new device parameter to the DeviceParams collection. These parameters should be obtained from the consumer device and a full list of available parameters can be found in the EMV® 3-D Secure SDK-Device Information document provided by EMVCo.
The ValueType parameter specifies the type of the value. Possible values are:
- 1 (Array)
- 2 (String)
Most parameters will have a value type of 2 (String), which will contain a single, string value. Some parameters, however, may require an array of strings. For example, the A040 parameter is defined as containing a set of paired Bluetooth devices. All of these devices can be specified via an array like so:
client.addDeviceParam("A040", "[\"firstDevice\", \"secondDevice\", \"thirdDevice\"]", 1, 1);
There are four categories of device information parameters:
DV - Data Version
This is the version of the data being specified. This is 1.0 by default, but can be set to a different value as shown below. When setting the data version, only the value of the parameter needs to be specified.
client1.AddDeviceParam("", "1.1", 2, 0);
DD - Device Data
This category is used to specify the device parameters collected from the mobile platform.
// the device platform is Android
client1.AddDeviceParam("C001", "Android", 2, 1);
// the device model is an HTC One (M8)
client1.AddDeviceParam("C002", "HTCOne_M8", 2, 1);
DPNA - Device Parameter Not Available
This category is used to specify reasons for unavailable device parameters.
// IP Address couldn't be specified because of a "market or regional restriction on the parameter."
client1.AddDeviceParam("C010", "RE01", 2, 2);
SW - Security Warning
This category of parameter is used to specify security warnings. These are used to let the directory server know of the result of checks made by your application upon initialization. When setting security warning parameters, only the name of the parameter needs to be specified.
// the device is jailbroken
client1.AddDeviceParam("SW01", "", 2, 3);
// A debugger is attached to the app
client1.AddDeviceParam("SW04", "", 2, 3);