Please check my comment about the missing "break" in the code below (uc_payment_pack.module)

function uc_payment_method_cod($op, &$arg1) {
  switch ($op) {
    case 'order-submit':
      if ($arg1->payment_method == 'cod' &&
          ($max = variable_get('uc_cod_max_order', 0)) > 0 &&
          is_numeric($max) &&
          $arg1->order_total > $max) {
          $result[] = array(
            'pass' => FALSE,
            'message' => t('Your final order total exceeds the maximum for COD payment.  Please go back and select a different method of payment.')
          );
          $_SESSION['expanded_panes'][] = 'payment';
          return $result;
      }
      // I guess a "break;" is missing from here!
    case 'order-save':
      db_query("DELETE FROM {uc_payment_cod} WHERE order_id = %d", $arg1->order_id);
      db_query("INSERT INTO {uc_payment_cod} VALUES (%d, %d, %d, %d)",
               $arg1->order_id, $arg1->payment_details['delivery_month'],
               $arg1->payment_details['delivery_day'], $arg1->payment_details['delivery_year']);
      break;

Comments

Island Usurper’s picture

Status: Active » Closed (works as designed)

Actually, I think it's meant to fall through there, but only because of the DELETE query in the 'order-save' part. This means that both order-submit and order-save can be run, but only one payment is actually entered on the order.

gabor_h’s picture

Yes, you are right. Thanks.