You are here

function uc_payment_load_payments in Ubercart 6.2

Same name and namespace in other branches
  1. 8.4 payment/uc_payment/uc_payment.module \uc_payment_load_payments()
  2. 5 payment/uc_payment/uc_payment.module \uc_payment_load_payments()
  3. 7.3 payment/uc_payment/uc_payment.module \uc_payment_load_payments()

Loads an array of all the payments for an order.

Parameters

$order_id: The order's id.

$action: Unused...

Return value

Array of payment objects or FALSE if there are none.

3 calls to uc_payment_load_payments()
uc_payment_balance in payment/uc_payment/uc_payment.module
Returns the balance of payments on an order.
uc_payment_by_order_form in payment/uc_payment/uc_payment.admin.inc
Displays a list of payments attached to an order.
uc_payment_order in payment/uc_payment/uc_payment.module
Implements hook_order().

File

payment/uc_payment/uc_payment.module, line 750

Code

function uc_payment_load_payments($order_id, $action = NULL) {
  $payments = array();
  $result = db_query("SELECT * FROM {uc_payment_receipts} WHERE order_id = %d " . "ORDER BY received ASC", $order_id);
  while ($payment = db_fetch_object($result)) {
    $payments[] = $payment;
  }
  if (count($payments) == 0) {
    $payments = FALSE;
  }
  return $payments;
}