function hook_commerce_braintree_dropin_sale_data_alter in Commerce Braintree 7.3
Same name and namespace in other branches
- 7.2 modules/commerce_braintree_dropin/commerce_braintree_dropin.api.php \hook_commerce_braintree_dropin_sale_data_alter()
Allows other modules to alter the sale data before it is submitted to Braintree
Parameters
$sale_data: The array that is passed to Braintree_Transaction::sale(). @see https://developers.braintreepayments.com/javascript+php/sdk/server/trans...
$order: The commerce order object that built the sale.
2 invocations of hook_commerce_braintree_dropin_sale_data_alter()
- commerce_braintree_cardonfile_charge in ./
commerce_braintree.module - Commerce Card on File charge callback.
- commerce_braintree_js_form_submit in ./
commerce_braintree.module - Submit callback for the Braintree JS based payment methods.
File
- modules/
commerce_braintree_dropin/ commerce_braintree_dropin.api.php, line 18 - Provies API methods exposed by this module.
Code
function hook_commerce_braintree_dropin_sale_data_alter(&$sale_data, $order) {
// Change the sale amount to $100.00.
$sale_data['amount'] = '100.00';
}