Transparent Redirect
Customer Fields
Note
The integration method outlined below is deprecated.
Learn more about upgrading to the Braintree SDKs.
HTML fields
- HTML
<!-- Example -->
<input type="text" name="transaction[customer][first_name]" />
<!-- id can be whatever you want, only name matters for Braintree -->
<input type="text" name="transaction[customer][first_name]" id="whateverYouWant" />
customer[first_name]
customer[last_name]
customer[company]
customer[email]
customer[phone]
customer[fax]
customer[website]
customer[credit_card][cardholder_name]
customer[credit_card][number]
customer[credit_card][cvv]
customer[credit_card][expiration_date]
customer[credit_card][expiration_month]
customer[credit_card][expiration_year]
customer[credit_card][expiration_date]
or separate fields,customer[credit_card][expiration_month]
andcustomer[credit_card][expiration_year]
.
transaction[billing][first_name]
transaction[billing][last_name]
transaction[billing][company]
transaction[billing][street_address]
transaction[billing][extended_address]
transaction[billing][locality]
transaction[billing][region]
transaction[billing][postal_code]
transaction[billing][country_code_alpha2]
transaction[billing][country_code_alpha3]
transaction[billing][country_code_numeric]
transaction[billing][country_name]
customer[credit_card][billing_address][first_name]
customer[credit_card][billing_address][last_name]
customer[credit_card][billing_address][company]
customer[credit_card][billing_address][street_address]
customer[credit_card][billing_address][extended_address]
customer[credit_card][billing_address][locality]
customer[credit_card][billing_address][region]
customer[credit_card][billing_address][postal_code]
customer[credit_card][billing_address][country_code_alpha2]
customer[credit_card][billing_address][country_code_alpha3]
customer[credit_card][billing_address][country_code_numeric]
customer[credit_card][billing_address][country_name]
Protected fields
Any parameters that you want to submit without letting your users select the value should be
included in thetr_data
. For example, you want to ensure a specific billing country is
submitted, include it in thetr_data
. Generating the TR Data:
- Python
tr_data = braintree.Customer.tr_data_for_create({
"customer": {
"credit_card": {
"billing_address": {
"country_code_alpha2": "US"
}
}
}
}, "http://example.com/url_to_redirect_to");
tr_data
ensures that the parameters can't be tampered with.
- HTML
<!-- DO NOT DO THIS -->
<input type="hidden" name="customer[credit_card][billing_address][country_code_alpha2]" value="CA" />
Mandatory protected fields
These fields must be included in tr_data
and can't be passed as a regular input field.
customer[id]
customer[credit_card][token]
customer[credit_card][options][verify_card]
customer[credit_card][options][verification_merchant_account_id]
customer[credit_card][options][fail_on_duplicate_payment_method]
Custom fields
Custom fields need to
be configured in the Control Panel.
Once they are, they can be submitted by creating form fields namedtransaction[custom_fields][name_that_was_configured_in_control_panel]
Underscore field name variation
Some frameworks have trouble parsing square brackets in HTML field names. For this reason, the
gateway supports an alternate field name notation using double underscores instead of square
brackets to delimit keys in the field name. So, for example:
customer[first_name]
becomescustomer__first_name
customer[credit_card][cvv]
becomescustomer__credit_card__cvv