You are here

public static function Braintree_CreditCard::updateSignature in Commerce Braintree 7

4 calls to Braintree_CreditCard::updateSignature()
Braintree_CreditCard::update in braintree_php/lib/Braintree/CreditCard.php
updates the creditcard record
Braintree_Customer::updateSignature in braintree_php/lib/Braintree/Customer.php
creates a full array signature of a valid update request
Braintree_CustomerTest::testUpdateSignature_doesNotAlterOptionsInCreditCardUpdateSignature in braintree_php/tests/unit/CustomerTest.php
Braintree_TransparentRedirect::init in braintree_php/lib/Braintree/TransparentRedirect.php
create signatures for different call types @ignore

File

braintree_php/lib/Braintree/CreditCard.php, line 458

Class

Braintree_CreditCard
Creates and manages Braintree CreditCards

Code

public static function updateSignature() {
  $signature = self::baseSignature(self::baseOptions());
  $updateExistingBillingSignature = array(
    array(
      'options' => array(
        'updateExisting',
      ),
    ),
  );
  foreach ($signature as $key => $value) {
    if (is_array($value) and array_key_exists('billingAddress', $value)) {
      $signature[$key]['billingAddress'] = array_merge_recursive($value['billingAddress'], $updateExistingBillingSignature);
    }
  }
  return $signature;
}