You are here

function commerce_braintree_hostedfields_sale_data_alter in Commerce Braintree 7.2

Same name and namespace in other branches
  1. 7.3 modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.api.php \commerce_braintree_hostedfields_sale_data_alter()

Alter sale data before transaction sent to Braintree.

Parameters

array $sale_data: The array that is passed to Braintree_Transaction::sale().

mixed $order: The commerce order object that built the sale.

See also

https://developers.braintreepayments.com/javascript+php/sdk/server/trans...

File

modules/commerce_braintree_hostedfields/commerce_braintree_hostedfields.api.php, line 18
Provides API methods exposed by this module.

Code

function commerce_braintree_hostedfields_sale_data_alter(array &$sale_data, $order) {

  // Change the sale amount to $100.00.
  $sale_data['amount'] = '100.00';
}