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

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
  • If a value in this parameter specified, then will be exposed that's batch’s summary.
  • If the specified batch name does not exists or is wrong then will be exposed the current active batch.
  • If no batch name specified and there isn’t an active batch, a batch "not found error" will be exposed in the reponse.
  • morningShift
    batchId
  • If a value in this parameter specified, then will be exposed that's batch’s summary.
  • If the specified batch id does not exists or is wrong then will be exposed the current active batch.
  • If no batch id specified and there isn’t an active batch, a batch "not found error" will be exposed in the reponse.
  • 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

    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!