You are here

function uc_payment_load_payments in Ubercart 7.3

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. 6.2 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.

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_uc_order in payment/uc_payment/uc_payment.module
Implements hook_uc_order().

File

payment/uc_payment/uc_payment.module, line 581

Code

function uc_payment_load_payments($order_id) {
  $payments = db_query("SELECT * FROM {uc_payment_receipts} WHERE order_id = :id ORDER BY received ASC", array(
    ':id' => $order_id,
  ))
    ->fetchAll();
  if (count($payments) == 0) {
    $payments = FALSE;
  }
  return $payments;
}