Constructor
new DataCollector()
Do not use this constructor directly. Use braintree-web.data-collector.create instead.
- Source:
Members
deviceData :string
JSON string to pass with server transactions.
- Source:
rawDeviceData :object
The device data as an object instead of a string.
- Source:
Methods
getDeviceData(optionsopt, stringifyopt, callbackopt) → {Promise|void}
Resolves with device data once it is ready.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
options |
object |
<optional> |
Options for how device data is resolved. |
|
stringify |
boolean |
<optional> |
false |
Whether or not to return the device data as a JSON string. |
callback |
callback |
<optional> |
Called on completion. If no callback is provided, |
- Source:
Examples
dataCollectorInstance.getDeviceData();
dataCollectorInstance.getDeviceData().then(function (deviceData) {
// typeof deviceData === 'string'
// pass onto your server with the payment method nonce
});
dataCollectorInstance.getDeviceData({
raw: true
}).then(function (deviceData) {
// typeof deviceData === 'object'
// for if you'd like to parse the data before sending it to your server
});
teardown(callbackopt) → {Promise|void}
Cleanly remove anything set up by create.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
callback |
<optional> |
Called on completion. If no callback is provided, |
- Source: