Commit cedcda97 authored by jsacksick's avatar jsacksick

Issue #3043112 by jsacksick: Add a hook_commerce_paypal_checkout_update_order_request_alter().

parent aa6ded5a
......@@ -17,3 +17,16 @@
function hook_commerce_paypal_checkout_create_order_request_alter(&$request_body, $order) {
// No example.
}
/**
* Allows modules to alter the request body before the update order API call is
* made to PayPal.
*
* @param array $request_body
* The request body.
* @param $order
* The order.
*/
function hook_commerce_paypal_checkout_update_order_request_alter(&$request_body, $order) {
// No example.
}
......@@ -922,6 +922,7 @@ function commerce_paypal_checkout_update_order($order, $payment_method) {
'value' => $request_body['purchase_units'][0],
),
);
drupal_alter('commerce_paypal_checkout_update_order_request', $update_params, $order);
$api_client = commerce_paypal_checkout_api_client($payment_method['settings']);
try {
$api_client->updateOrder($remote_id, $update_params);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment