Acquire.Client._account module¶
-
class
Account(user=None, account_name=None, accounting_service=None, accounting_url=None)[source]¶ Bases:
objectThis 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
Returns: Accounting service managing this account Return type: Service
-
balance(force_update=False)[source]¶ Return the current balance of this account
Parameters: force_update (bool, default=False) – Force the refresh Returns: Balance of the account Return type: Decimal
-
description()[source]¶ Return the description of this account
Returns: Description of account Return type: str
-
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
Returns: Globally unique UID of this account Return type: str
-
is_beyond_overdraft_limit(force_update=False)[source]¶ Return whether or not the current balance is beyond the overdraft limit
Parameters: force_update (bool, default=False) – Force the refresh Returns: True if account over overdraft limit, else False Return type: bool
-
is_logged_in()[source]¶ Return whether or not the user has an authenticated login to this account
Returns: True if user logged in, else False Return type: bool
-
is_null()[source]¶ Return whether or not this is a null account
Returns: True if account null, else False Return type: bool
-
last_update_time()[source]¶ Return the time of the last update of the balance
Returns: Datetime of last update of the account balance Return type: datetime
-
liability(force_update=False)[source]¶ Return the current total liability of this account
Parameters: force_update (bool, default=False) – Force the refresh Returns: Liability of the account Return type: Decimal
-
overdraft_limit(force_update=False)[source]¶ Return the overdraft limit of this account
Parameters: force_update (bool, default=False) – Force the refresh Returns: Overdraft limit of account Return type: Decimal
-
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
Parameters: - transaction (Transaction) – Transaction to perform
- credit_account (Account) – Account to credit
- is_provisional (bool, default=False) – Is transaction
- provisional –
-
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
Parameters: - credit_note (CreditNote) – CreditNote to use to create
- receipt –
- receipted_value – Receipted value
-
receivable(force_update=False)[source]¶ Return the current total accounts receivable of this account
Parameters: force_update (bool, default=False) – Force the refresh Returns: Accounts receivable of the account Return type: Decimal
-
refund(credit_note)[source]¶ Refunds the passed credit note that contained a transfer of from another account to the passed account
Parameters: credit_note (CreditNote) – Credit note to refund Returns: Record of this transaction Return type: TransactionRecord
-
-
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
- Args:
- user (User): User for query accounting_service (Service, default=None): Accounting service to check accounting_url (str, default=None): Accounting URL
- Returns:
- list: List of accounts of the passed user
-
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
Parameters: Returns: New account
Return type: