You are here

function pay_activity::balance in Pay 7

Same name and namespace in other branches
  1. 6 includes/handlers/pay_activity.inc \pay_activity::balance()

The transaction balance as of this payment's completion.

File

includes/handlers/pay_activity.inc, line 99
A base class for payment activities.

Class

pay_activity
@file A base class for payment activities.

Code

function balance() {
  return (double) db_query("SELECT t.total - SUM(a.transaction_total)\n      FROM {pay_activity} a\n      INNER JOIN {pay_transaction} t USING (pxid)\n      WHERE t.pxid = :t.pxid AND a.paid <= :a.paid", array(
    ':t.pxid' => $this->pxid,
    ':a.paid' => $this->paid,
  ))
    ->fetchField();
}