Receipt
public class Receipt
You can get a copy of the receipt for an individual transaction by creating a Receipt Object and calling .completion(() -> ())
including the receipt ID for the transaction in the path.
Alternatively, you can receive a list of all the transactions. By default it will return 10 transactions. These results are returned in time-descending order by default, so it will return the latest 10 transactions.
Receipt by ID
myJudoSession.receipt(receiptId).completion({ (dict, error) -> () in
if let = error {
// error
} else {
// success
}
})
All receipts
myJudoSession.receipt(nil).completion({ (dict, error) -> () in
if let = error {
// error
} else {
// success
}
})
-
The current Session to access the Judo API
Declaration
Swift
public var APISession: Session?
-
apiSession caller - this method sets the session variable and returns itself for further use
Parameter
Parameter session: the API session which is used to call the Judo endpoints
Returns
reactive self
Declaration
Swift
public func apiSession(session: Session) -> Self
Parameters
session
the API session which is used to call the Judo endpoints
Return Value
reactive self
-
Completion caller - this method will automatically trigger a Session Call to the judo REST API and execute the request based on the information that were set in the previous methods.
Parameter
Parameter block: a completion block that is called when the request finishes
Returns
reactive self
Declaration
Swift
public func completion(block: JudoCompletionBlock) -> Self
Parameters
block
a completion block that is called when the request finishes
Return Value
reactive self
-
This method will return a list of receipts
See List all transactions for more information.
Parameter
Parameter pagination: The offset, number of items and order in which to return the itemsParameter
Parameter block: a completion block that is called when the request finishesDeclaration
Swift
public func list(pagination: Pagination, block: JudoCompletionBlock)
Parameters
pagination
The offset, number of items and order in which to return the items
block
a completion block that is called when the request finishes