Transparent Redirect
Note
The integration method outlined below is deprecated.
Learn more about upgrading to the Braintree SDKs.
HTML fields
id can be whatever you want, only name matters for Braintree
transaction[customer][first_name]
transaction[customer][last_name]
transaction[customer][company]
transaction[customer][email]
transaction[customer][phone]
transaction[customer][fax]
transaction[customer][website]
transaction[credit_card][cardholder_name]
transaction[credit_card][number]
transaction[credit_card][cvv]
transaction[credit_card][expiration_date]
transaction[credit_card][expiration_month]
transaction[credit_card][expiration_year]
transaction[credit_card][expiration_date]
or separate fields,transaction[credit_card][expiration_month]
andtransaction[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]
transaction[shipping][first_name]
transaction[shipping][last_name]
transaction[shipping][company]
transaction[shipping][street_address]
transaction[shipping][extended_address]
transaction[shipping][locality]
transaction[shipping][region]
transaction[shipping][postal_code]
transaction[shipping][country_code_alpha2]
transaction[shipping][country_code_alpha3]
transaction[shipping][country_code_numeric]
transaction[shipping][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, if you’re building a donation site and asking
users to enter the amount they would like to donate, you would want to make amount an HTML field.
tr_data
.
tr_data = Braintree::TransparentRedirect.transaction_data(
:redirect_url => "http://example.com",
:transaction => {
:type => "sale",
:amount => "10.00"
}
)
tr_data
ensures that the parameters can't be tampered with.
store_in_vault
option
intr_data
. If you have a process where you want to ask the user whether they would like
their credit card kept on file for easy checkout on future purchases, then you can exposestore_in_vault
as a checkbox input.
transaction[merchant_account_id]
transaction[options][add_billing_address_to_payment_method]
transaction[options][store_shipping_address_in_vault]
transaction[options][store_in_vault_on_success]
Mandatory protected fields
These fields must be included intr_data
and can't be passed as a regular input field.
transaction[type]
transaction[order_id]
transaction[customer][id]
transaction[credit_card][token]
transaction[options][submit_for_settlement]
transaction[customer_id]
transaction[payment_method_token]
transaction[customer][id]
. If you’re creating a transaction using a customer
that’s already in the vault, specify the id of the customer to charge
usingtransaction[customer_id]
. Similarly with credit cards,transaction[credit_card][token]
is for specifying the token of a new credit card.transaction[payment_method_token]
is
for referencing an existing payment method in the vault to charge it.
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:
transaction[customer_id]
becomestransaction__customer_id
transaction[options][store_in_vault]
becomestransaction__options__store_in_vault