function uc_payment_balance in Ubercart 6.2
Same name and namespace in other branches
- 8.4 payment/uc_payment/uc_payment.module \uc_payment_balance()
- 5 payment/uc_payment/uc_payment.module \uc_payment_balance()
- 7.3 payment/uc_payment/uc_payment.module \uc_payment_balance()
Returns the balance of payments on an order.
6 calls to uc_payment_balance()
- uc_credit_terminal in payment/
uc_credit/ uc_credit.admin.inc - Displays the credit card terminal page.
- uc_credit_terminal_form in payment/
uc_credit/ uc_credit.admin.inc - Displays the credit card terminal form for administrators.
- uc_order_pane_payment in payment/
uc_payment/ uc_payment_order_pane.inc - Handles the Payment order pane.
- uc_payment_condition_order_balance in payment/
uc_payment/ uc_payment.ca.inc - Check the current order balance.
- uc_payment_pack_receive_check_form in payment/
uc_payment_pack/ uc_payment_pack.admin.inc - Receives a check for an order and put in a clear date.
File
- payment/
uc_payment/ uc_payment.module, line 710
Code
function uc_payment_balance($order) {
$total = $order->order_total;
$payments = uc_payment_load_payments($order->order_id);
if ($payments === FALSE) {
return $total;
}
foreach ($payments as $payment) {
$total -= $payment->amount;
}
return $total;
}