Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Retrieve a Transaction in Amatino Swift - A double-entry accounting library for iOS & MacOS
// Amatino Swift: https://github.com/amatino-code/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)")
return
})
@hwjeremy

This comment has been minimized.

Copy link
Owner Author

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
You can’t perform that action at this time.