Premium Fraud Management Tools
Client-Side Implementation
Collecting device data
BraintreeDataCollector
enables you to collect data about a customer's device and correlate it with a session identifier on your server.
Get the SDK
CocoaPods
Include Braintree/DataCollector
in your Podfile:
- Ruby
# Podfile
pod 'Braintree/DataCollector'
Swift Package Manager
Include the BraintreeDataCollector
framework.
Carthage
Include the BraintreeDataCollector
and PPRiskMagnes
frameworks.
Implementation
BraintreeDataCollector collects data about a customer's device and returns a device_data
string that contains one or more identifiers that correlate with the collected data. Collecting and passing this data with transactions helps reduce decline rates.
- Before making a request to your server, get the device data string by intializing a
BTDataCollector
instance and callingcollectDeviceData
.
- Swift
let apiClient = BTAPIClient("<TOKENIZATION_KEY_OR_CLIENT_TOKEN>")
let dataCollector = BTDataCollector(apiClient: apiClient)
dataCollector.collectDeviceData { deviceData, error in
// print("Send this device data to your server: (deviceData)")
}
- Send the device data string to your server along with transaction or verification data (e.g.
Transaction.sale
calls). Your server will include thisdevice_data
parameter when submitting the request to the Braintree gateway.
PayPal
If you're accepting PayPal using the Vault flow, collecting device data via BraintreeDataCollector
is required.
Next Page: Server-side →