ExternalTransaction
- class q2_sdk.hq.db.external_transaction.ExternalTransactionRow(element, row_class=None, rename_fields=None)[source]
Bases:
TableRow
- class q2_sdk.hq.db.external_transaction.ExternalTransaction(logger, hq_credentials=None, ret_table_obj=None)[source]
Bases:
DbObjectProgrammatic access to the Q2 database. Not as flexible as a true ORM, but takes the guesswork out of database schemas and ensures safety in the transactions.
- Parameters:
logger – Reference to calling request’s logger (self.logger in your extension)
hq_credentials (
Optional[HqCredentials]) – HQ Connectivity Information (Defaults to settings file)ret_table_obj (
Optional[bool]) – Flag to return list of LXML elements ifFalseor TableRow objects from DB calls ifTrue(Defaults to settings file)
- NAME = 'ExternalTransaction'
- REPRESENTATION_ROW_CLASS
alias of
ExternalTransactionRow
- async add_update(transaction, wire=None, details=None)[source]
Add or update an external wire transaction.
Calls the Q2 core proc bsp_AddUpdateExternalTransaction with an
<ET><Txn><D/><Wire/></Txn></ET>XML payload built from the given dicts (the D and Wire nodes are children of Txn, matching the paths the proc reads:/ET/Txn/Dand//Wire). The proc upserts on ExternalTransactionID or ExternalTrackingNumber: include either intransactionto force an update, omit both to insert.- Parameters:
transaction (
dict) – Txn-node attributes. Requires TxnType, TxnStatus, CreatedDate, InsertedDate, Description.wire (
Optional[dict]) – optional Wire-node attributes (Sender, FromAccount, Recipient, ReceivingInstitution, ToAccount, ToRouting, BeneFi*, IntermedFi*, …). NOTE: when a wire row already exists for the transaction, the platform proc updates ONLY the Imad field.details (
Optional[List[dict]]) – optional list of D-node dicts (ShortName, CreateDate, DataValue). Omit DataValue to remove a detail element.
- Return type:
- Returns:
rows of ExternalTransactionID, ExternalTrackingNumber, updated, inserted