Get Reports request
An overview of the Get Reports request message for iOS.
Our ‘Viva.com Terminal’ application (tap-on-phone) supports Apple Tap to Pay in the UK, the Netherlands, France, Austria, Czech Republic, Ireland, Romania, and Sweden, Italy & Germany.
Overview
👉 The Get Reports request is used to retrieve the batch reports of the Viva.com Terminal App.
The client app must implement a mechanism to send messages using URL schemes and to receive the result in a custom URI callback.
- Get Reports request originating from the client app to get the Viva.com Terminal App’s batch reports.
- Get Reports Settings response originating from the Viva.com Terminal App to return the result of batch reports.
Get Reports request
For a typical Get Reports request, the client app must provide the following information:
Field | Description | Example |
---|---|---|
scheme | The Viva's custom URL scheme, the host and the version | vivapayclient://pay/v1 |
merchantKey | The merchant's key. Deprecated: you may pass any value. |
SG23323424EXS3 |
appId | The client app id. | com.example.myapp |
action | Get Report | getReport |
command | Specifies the request action: ‘summary’ to retrieve the summary for a certain batch | summary |
batchName | morningShift | |
batchId | summary | |
callback | The URI callback that will handle the result. | interapp-callback |
createGetReportRequest(command: "summary", batchName: "morningShift", batchUUID: nil)
func createGetReportRequest(command: String, batchName: String?, batchUUID: String?) {
// construct getReport url
var endGetReportActionURL = "vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=getReport"
endGetReportActionURL += "&command=" + command
if let batchName = batchName, batchName.isValidName {
endGetReportActionURL += "&batchName=" + batchName // name of batch to get the summary
}
if let batchUUID = batchUUID, batchUUID.isValidName {
endGetReportActionURL += "&batchId=" + batchUUID // uuid of batch to get the summary
}
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: endGetReportActionURL)
}
Example
vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=getReport&command=summary&batchName=morningShift
Get Reports response
The response will return the get reports along with all the batch’s values of the Viva.com Terminal App.
The table below summarizes the contents of an approved response.
Field | Description | Example |
---|---|---|
callback | The URI callback that will handle the result | 'interapp-callback://result' |
action | The action | 'getReport' |
command | Informs that the command was ‘summary' for the action ‘getReport’ | 'summary' |
batchName | The name of the batch | 'morningShift' |
batchId | The UUID of the batch | 7885F4F1-59CA-42C2-81BB-6DB48AA138A6 |
status | The status of the batch request. | success |
message | A string containing information about the transaction status. | Transaction summary fetched successfully |
data | Json data as a string |
{ "command": "summary", "action": "getReport", "status": "success", "data": { "insDateFrom": "2024-03-15T10:48:05.359 02:00", "personId": "efa75715-8449-4c70-903e-5fe2f2c3bc7f", "insDateTo": "2024-03-15T10:48:44.466 02:00", "stats": [{ "amount": 7.89, "totalCommission": 0, "currencyCode": "826", "count": 1, "type": "Sale", "tipAmount": 0 }], "totals":[{ "amount": 7.89, "totalCommission": 0, "currencyCode": "826", "count": 1, "tipAmount": 0 } ] }, "batchName": "test", "message": "Transaction summary fetched successfully" } |
Example
interapp-callback://result?status=success&message=Transaction%2520summary%2520fetched%2520successfully&action=getReport&batchName=test&data=%7B%22insDateFrom%22:%222024-03-14T17:39:43.466+02:00%22,%22insDateTo%22:%222024-03-15T10:28:14.392+02:00%22,%22stats%22:%5B%7B%22amount%22:7.97,%22totalCommission%22:0,%22currencyCode%22:%22826%22,%22count%22:2,%22type%22:%22Sale%22,%22tipAmount%22:0%7D%5D,%22personId%22:%22efa75715-8449-4c70-903e-5fe2f2c3bc7f%22,%22totals%22:%5B%7B%22amount%22:7.97,%22totalCommission%22:0,%22currencyCode%22:%22826%22,%22count%22:2,%22tipAmount%22:0%7D%5D%7D&command=summary
Get Support
If you would like to integrate with Viva, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!