Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Retrieve a Transaction in Amatino Swift - A double-entry accounting library for iOS & MacOS
// Amatino Swift:
// Double entry accounting API
try Transaction.retrieve(
session: session,
entity: starkIndustries,
transactionId: borrowedCashTxId,
callback: { (error: Error?, transaction: Transaction?) in
guard error == nil else {
// Handle error. E.g. 404 for an unknown Transaction, or 403
// for a Transaction you are not authorised to retrieve.
guard let borrowedCash: Transaction = transaction {
// Should never happen, but we guard against nil because we
// are good little Swift programmers
// Do cool stuff with the newly retrieved Transaction
print("Retrieved Transaction: \(borrowedCash.description)")

This comment has been minimized.

Copy link
Owner Author

@hwjeremy hwjeremy commented Jul 17, 2018

#The parameters supplied to Transaction.retrieve() come from the following examples:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment