Module: Braintree::TransparentRedirect


The TransparentRedirect module provides methods to build the tr_data param that must be submitted when using the transparent redirect API. For more information about transparent redirect, see (TODO).

You must provide a redirect_url that the gateway will redirect the user to when the action is complete.

  tr_data = Braintree::TransparentRedirect.create_customer_data(
    :redirect_url => "http://example.com/redirect_back_to_merchant_site
  )

In addition to the redirect_url, any data that needs to be protected from user tampering should be included in the tr_data. For example, to prevent the user from tampering with the transaction amount, include the amount in the tr_data.

  tr_data = Braintree::TransparentRedirect.transaction_data(
    :redirect_url => "http://example.com/complete_transaction",
    :transaction => {:amount => "100.00"}
  )

Public Class Methods
confirm(query_string)
create_credit_card_data(params)

Returns the tr_data string for creating a credit card.

create_customer_data(params)

Returns the tr_data string for creating a customer.

transaction_data(params)

Returns the tr_data string for creating a transaction.

update_credit_card_data(params)

Returns the tr_data string for updating a credit card. The payment_method_token of the credit card to update is required.

  tr_data = Braintree::TransparentRedirect.update_credit_card_data(
    :redirect_url => "http://example.com/redirect_here",
    :payment_method_token => "token123"
  )
update_customer_data(params)

Returns the tr_data string for updating a customer. The customer_id of the customer to update is required.

  tr_data = Braintree::TransparentRedirect.update_customer_data(
    :redirect_url => "http://example.com/redirect_here",
    :customer_id => "customer123"
  )
url()

Returns the URL to which Transparent Redirect Requests should be posted


© Copyright 2009 Braintree Payment Solutions. All Rights Reserved.