You are here

function payment_module_implements_alter in Payment 7

Implements hook_module_implements_alter().

File

./payment.module, line 91
Hook implementations and shared functions.

Code

function payment_module_implements_alter(array &$implementations, $hook) {
  if ($hook == 'payment_method_load') {

    // Commerce Payment has a function called commerce_payment_method_load(),
    // which looks like Commerce's implementation of
    // hook_payment_method_load(), but in fact is a Commerce Payment CRUD
    // function.
    unset($implementations['commerce']);
  }
  if (in_array($hook, array(
    'payment_update',
    'payment_insert',
  ))) {

    // Move our implementations of hook_payment_update() and
    // hook_payment_insert() to the top. This way all other implementations can
    // rely on the line items and status items being already saved.
    $group = $implementations['payment'];
    unset($implementations['payment']);
    $implementations = array(
      'payment' => $group,
    ) + $implementations;
  }
}