You are here

public static function Braintree_TransparentRedirect::updateCreditCardData in Commerce Braintree 7

Returns the trData string for updating a credit card.

The paymentMethodToken of the credit card to update is required.

<code> $trData = Braintree_TransparentRedirect::updateCreditCardData(array( 'redirectUrl' => 'http://example.com/redirect_here', 'paymentMethodToken' => 'token123', )); </code>

Parameters

array $params:

Return value

string

3 calls to Braintree_TransparentRedirect::updateCreditCardData()
Braintree_CreditCardTest::updateCreditCardViaTr in braintree_php/tests/integration/CreditCardTest.php
Braintree_TransparentRedirectTest::testUpdateCreditCardFromTransparentRedirect in braintree_php/tests/integration/TransparentRedirectTest.php
commerce_braintree_form_commerce_cardonfile_update_form_alter in ./commerce_braintree.module
Implements hook_form_FORM_ID_alter().

File

braintree_php/lib/Braintree/TransparentRedirect.php, line 202

Class

Braintree_TransparentRedirect
Static class providing methods to build Transparent Redirect urls

Code

public static function updateCreditCardData($params) {
  Braintree_Util::verifyKeys(self::$_updateCreditCardSignature, $params);
  if (!isset($params['paymentMethodToken'])) {
    throw new InvalidArgumentException('expected params to contain paymentMethodToken.');
  }
  $params["kind"] = Braintree_TransparentRedirect::UPDATE_PAYMENT_METHOD;
  return self::_data($params);
}