Acquire.Client._account module

class Account(user=None, account_name=None, accounting_service=None, accounting_url=None)[source]

Bases: object

This is the client-side handle that is used to interact with an account on the service. If the account is created with a valid user login then you can perform tasks such as making payments, or issueing receipts or refunds. Otherwise, this is a simple interface that allows the account to be used as a receiver of value

accounting_service()[source]

Return the accounting service managing this account

balance(force_update=False)[source]

Return the current balance of this account

description()[source]

Return the description of this account

guid()[source]

Return the globally unique UID of this account. This is a combination of the UID of the accounting service and the UID of the account

is_beyond_overdraft_limit(force_update=False)[source]

Return whether or not the current balance is beyond the overdraft limit

is_logged_in()[source]

Return whether or not the user has an authenticated login to this account

is_null()[source]

Return whether or not this is a null account

last_update_time()[source]

Return the time of the last update of the balance

liability(force_update=False)[source]

Return the current total liability of this account

name()[source]

Return the name of this account

overdraft_limit(force_update=False)[source]

Return the overdraft limit of this account

owner()[source]

Return the user who owns this account

perform(transaction, credit_account, is_provisional=False)[source]

Tell this accounting service to apply the transfer described in ‘transaction’ from this account to the passed account. Note that the user must have logged into this account so that they have authorised this transaction. This returns the record of this transaction

receipt(credit_note, receipted_value=None)[source]

Receipt the passed credit note that contains a request to transfer value from another account to the passed account

receivable(force_update=False)[source]

Return the current total accounts receivable of this account

refund(credit_note)[source]

Refunds the passed credit note that contained a transfer of from another account to the passed account

spent_today(force_update=False)[source]

Return the current amount spent today on this account

uid()[source]

Return the UID of this account

user()[source]

Synonym for owner

get_accounts(user, accounting_service=None, accounting_url=None)[source]

Return all of the accounts of the passed user. Note that the user must be authenticated to call this function

create_account(user, account_name, description=None, accounting_service=None, accounting_url=None)[source]

Create an account on the accounting service for the passed user, calling the account ‘account_name’ and optionally passing in an account description. Note that the user must have authorised the login

deposit(user, value, description=None, accounting_service=None, accounting_url=None)[source]

Tell the system to allow the user to deposit ‘value’ from their (real) financial account to the system accounts

withdraw(user, value, description=None, accounting_service=None, accounting_url=None)[source]

Tell the system to allow the user to withdraw ‘value’ from the system accounts back to their (real) financial account