You are here

function hook_commerce_coupon_final_checkout_validate in Commerce Coupon 7.2

Transaction related modules, such as Usage and Giftcards, do their transactions in this hook, which fires before the payment validator that actually processes payments.

Parameters

array $form: The checkout form

array $form_state: The checkout form state

object $order_wrapper: The checkout order

Return value

$transaction_ids

See also

commerce_coupon_usage_commerce_coupon_final_checkout_validate().

1 function implements hook_commerce_coupon_final_checkout_validate()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

commerce_coupon_usage_commerce_coupon_final_checkout_validate in modules/usage/commerce_coupon_usage.module
Implements hook_commerce_coupon_final_checkout_validate().
1 invocation of hook_commerce_coupon_final_checkout_validate()
commerce_coupon_commerce_checkout_form_review_validate in ./commerce_coupon.module
Form validate callback: validate and record coupon transactions.

File

./commerce_coupon.api.php, line 93

Code

function hook_commerce_coupon_final_checkout_validate(&$form, &$form_state, $order_wrapper) {
  $transaction_ids = array();
  $transaction = mymodule_do_transaction($order_wrapper);
  if (!$transaction) {
    form_set_error('', t('Transaction failed'));
  }
  else {
    $transaction_ids[] = $transaction;
  }
  return $transaction_ids;
}