Acquire.Accounting._refund module

class Refund(credit_note=None, authorisation=None)[source]

Bases: object

This class holds the refund for a transaction. This is sent by the credited account or other authorised party to refund a transaction. Refunds must succeed, so potentially they can allow accounts to breach overdraft limits etc.

authorisation()[source]

Return the authorisation for the refund

Authorisation: Authorisation for this refund

static create(credit_notes, authorisation)[source]

Construct a series of refunds from the passed credit notes, each of which is authorised using the passed authorisation. This will refund all of the transactions passed in full

Parameters:
  • credit_notes (list) – Credit notes to process
  • authorisation (Authorisatin) – Authorisation for refunds
Returns:

Processed refunds for credit notes

Return type:

Refund or list[Refunds]

credit_account_uid()[source]

Return the UID of the account from which this refund will be drawn

Returns:UID of account to draw refund from
Return type:str
credit_note()[source]

Return the credit note that this is refunding

Returns:CreditNote related to this Refund
Return type:CreditNote
debit_account_uid()[source]

Return the UID of the account from which this refund will return value

Returns:UID of account to return value to
Return type:str
debit_note_uid()[source]

Return the UID of the debit note that this is refunding

Returns:UID of debit note this is refunding
Return type:str
static from_data(data)[source]

Return a Refund from the passed JSON-decoded dictionary

Parameters:dict – JSON-decoded dictionary
Returns:Refund object created from JSON
Return type:Refund
is_null()[source]

Return whether or not this Refund is null

Returns:True if refund is null, else False
Return type:bool
to_data()[source]

Return the data for this object as a dictionary that can be serialised to JSON

Returns:Dictionary to serialise to JSON
Return type:dict
transaction()[source]

Return a transaction that corresponds to the real transfer of value back from the credit to debit accounts (remembering that the original debit account will be the new credit account, and the original credit account will be the new debit account).

Returns:Transaction related to this refund
Return type:Transaction
transaction_uid()[source]

Return the UID of the transaction for which this is the refund. The transaction UID is the same as the UID for the original debit note

Returns:UID of transaction this is refunding
Return type:str
value()[source]

Return the value of the refund

Decimal: Value of this refund