For more information about this gateway, please refer to http://www.braintreepaymentsolutions.com/
- Gateway type code:
braintree
- Production API endpoint: Multiple
- Sandbox API endpoint: Not Supported
- Supported payment types: Credit Card, Gateway payment method token
- Supported operations: Authorization, Capture, Charge, Void, Refund
Currency restrictions
It is important to note that only one currency is permitted per merchant account; a separate gateway token is required for each currency you wish to support, and thus merchant account you need. If you send a different currency than what the merchant account is configured for, the transaction will display it as the attempted currency, but BrainTree will in fact process the amount as the currency configured for that merchant account, with no conversion.
There are actually two different “modes” that you can use to authenticate with the BrainTree gateway: Blue and Orange. To add an Braintree gateway, use the following settings:
Blue Mode
{
"mode" : "blue",
"merchant_id" : "Your Merchant Id",
"public_key" : "Your Public Key",
"private_key" : "Your Private Key",
"map_to_customer_id": "false" (optional)
}
Blue Mode with Merchant Account ID
{
"mode" : "blue",
"merchant_id" : "Your Merchant Id",
"public_key" : "Your Public Key",
"private_key" : "Your Private Key",
"merchant_account_id" : "Your Merchant Account ID",
"map_to_customer_id": "false" (optional)
}
Orange Mode
{
"mode" : "orange",
"login" : "Your Login",
"password" : "Your Password",
"map_to_customer_id": "false" (optional)
}
Gateway Specific Fields
Custom fields: Custom fields allow you to collect specific information about your customer and a purchase. If you have any custom fields that you would like to pass through Braintree, you can do so within gatewaySpecificFields
. The name of the fields inside the custom_fields
node can by anything, thus making is dynamic. The structure inside custom_fields
must be valid JSON .
NOTE: custom fields cannot be created via an API request. You’ll need to configure them directly in the Control Panel. Review Braintree’s custom fields documentation for more information.
"gatewaySpecificFields": {
"braintree": {
"custom_fields": {
"custom_field1" : "custom_field_value1",
"custom_field2" : "custom_field_value2"
}
}
}
}
Braintree has 3 fields that allow the merchant to skip gateway fraud checking when creating the transaction via API: skip_advanced_fraud_checking, skip_avs, and skip_cvv
You can set map_to_customer_id as true to indicate that the customer_id of a specific transaction should be use as the payment method. The value passed on a gateway specific field will overwrite the gateway configuration.
"gatewaySpecificFields": {
"braintree": {
"skip_advanced_fraud_checking": "true",
"skip_avs": "true",
"skip_cvv": "true",
"map_to_customer_id": "true",
"descriptor_name": "value",
"descriptor_phone": "value",
"descriptor_url": "value",
"tax_amount": "value"
}
}
Gateway Specific Response Fields
A response from Braintree gateway may contain the following fields: additional_processor_response
, risk_data_decision
, risk_data_device_data_captured
, risk_data_id
which you can find in the gateway_specific_response_fields. For example, a transaction could have something like this:
"gatewaySpecificResponseFields" : {
"braintree" : {
"additional_processor_response" : "2004",
"risk_data_decision" : "Approve",
"risk_data_device_data_captured" : "True",
"risk_data_id" : "123"
}
}