I have encountered a condition when processing an order for an anonymous user following payment using the pxpay module, and there are no payment records available. In this case, the "foreach" loop on line 77 in function "uc_dps_pxpay_complete" generates a warning message.

The warning message can be avoided by enclosing the foreach loop in a test for returned payment records as the function "uc_payment_load_payments" will return FALSE if none are available. See below:

      if ($payments = uc_payment_load_payments($order_id)) {
        foreach ($payments as $payment) {
          if ($payment->comment == $comment) {
            $duplicate_flag = TRUE;
          }
        }
      }

Comments

jayelless’s picture

Status: Active » Needs review
StatusFileSize
new1.02 KB

Patch attached.

xurizaemon’s picture

Status: Needs review » Closed (duplicate)