You are here

function payment_commerce_commerce_order_update in Payment for Drupal Commerce 7

Same name and namespace in other branches
  1. 7.2 payment_commerce.module \payment_commerce_commerce_order_update()

Implements hook_ENTITY_TYPE_ACTION().

File

./payment_commerce.module, line 48
Hook implementations and shared functions.

Code

function payment_commerce_commerce_order_update($order) {
  if ($order->uid != $order->original->uid) {
    $pids = payment_commerce_pids_load($order->order_id);
    $payments = entity_load('payment', $pids);
    foreach ($payments as $payment) {
      $payment->uid = $order->uid;
      entity_save('payment', $payment);
    }
  }
}