iOS app

Applies to: Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the Viva Wallet POS app for iOS.

The Viva Wallet POS App for iOS can receive requests for initiating transactions from third-party apps installed on the same iOS mobile device. Communication with the VW POS App is done through the use of URL schemes and by implementing UIApplicationDelegate ’s instance method application(_:open:options:) on the AppDelegate file of the client’s app project. The client app should create an URL scheme using specific parameters that will initiate the VW POS App’s pay activity. When the VW POS App’s pay activity finishes it returns the transaction result to the caller app..

Get it on the App Store

sample app is also available for download from our public GitHub account. It demonstrates the inter-app communication ability and contains all necessary info.

Messages

The client app must implement a mechanism to send messages using URL schemes and to receive the result in a custom URI callback. Overall the following messages are available:

Callback activity

The card terminal app will deliver the URL to your app by calling your app delegate’s application(_:open:options:) method. The following code should be added to the method in order to parse the contents of the URL and take the appropriate actions. To ensure the URL is parsed correctly, use NSURLComponents APIs to extract the components.

func application(_ app: UIApplication, open url: URL, options: [UIApplication.OpenURLOptionsKey : Any] = [:]) -> Bool {

        guard let components = NSURLComponents(url: url, resolvingAgainstBaseURL: true),
            let path = components.path,
            let params = components.queryItems else {
                print("Invalid URL or path missing")
                return false
        }
        print("Path: \(path)\nComponents: \(params)")

        //MARK: - Do any additional actions after parsing the data
        return true
 }

 func performInterAppRequest(request: String){
        guard let url = URL(string: request) else { return } // url with constructed parameters
        UIApplication.shared.open(url) { (result) in
            print("InterApp Request URL:\n", url)
            if result {
                // The URL was delivered successfully!
            }
        }
    }

Sale request 

For a typical sale request the client app must provide the following information:

Field Description Example
scheme The Viva custom URL scheme, the host and the version. 'vivapayclient://pay/v1'
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3'
appId The client app id. 'com.example.myapp'
action Sale transaction. 'sale'
clientTransactionId A unique transaction ID transmitted to the host for storage with the transaction. Note that this value will be provided in the Merchant Reference field provided in the sales export response. '12345678901234567890123456789012'
amount Amount in cents without any decimal digits. '1200' = 12 euro
tipAmount How much of the amount in cents is considered as tip without any decimal digits. '200' = 2 euro
withInstallments Enable installments. 'true'
preferredInstallments Number of preferred installments. If the number is between the allowed range and the card supports installments then the flow complete without any prompt for installments. If the number is 0 or > max allowed number of installments then the user will be prompt to enter the number in the app. If the card does not support installments then the app will request from the user how to proceed with the flow. '10'
show_receipt Option to show the receipt screen, before returning to the InterApp, after performing a sale on VW POS. 'true'
show_rating Option to show the rating/feedback screen, before returning to the InterApp, after performing a sale on Viva Wallet POS. 'false'
show_transaction_result Option to show the transaction result screen, before returning to the InterApp, after performing a sale on VW POS. If show_receipt is set to 'true’ this value will be neglected, therefore the transaction result screen will be shown. 'false'
ISV_amount The fee charged by the ISV on the sale. Amount in cents. '10' =0.1€
ISV_clientId The id of the ISV client. It is mandatory that if client id is provided the ISV_amount and ISV_clientSecret parameters should be provided too.
Refer to note below.
'auyf99x03sachvn3f5ogldykz8214c2o4vl8cvvs97p19.apps.vivapayments.com'
ISV_clientSecret The secret of the ISV client.
Refer to note below.
'qwerty123456'
ISV_sourceCode The reseller source code of the ISV.
Refer to note below.
'qwerty123456'
callback Your custom URI callback that will handle the result. 'interapp-callback'

ISV parameter info:

Using the information above, our custom URI should be created like this.

typealias ISVDetails = (clientId: String, amount: Decimal, clientSecret: String, sourceCode: String?)

func createSaleRequest(amount: Decimal, tipAmount: Decimal?, clientTransactionId: String?, isvDetails: ISVDetails?, numberOfInstallments: Int?) -> String {
// construct sale action url
var saleActionURL = Constants.saleUrlString // vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=sale

saleActionURL += "&amount=\(((amount * 100) as NSDecimalNumber).intValue)" // The amount in cents without any decimal digits.

if let tip = tipAmount {
    saleActionURL += "&tipAmount=\(((tip * 100) as NSDecimalNumber).intValue)" // The tip amount in cents without any decimal digits.
}

// append clientTransactionId parameter (if any)
if let transactionId = clientTransactionId, transactionId != "" {
    saleActionURL += "&clientTransactionId=\(transactionId)"
}

// append number of installments parameter (if any)
if let preferredInstallments = numberOfInstallments, preferredInstallments > 1 {
    saleActionURL += "&withInstallments=true" // enable installments parameter
    saleActionURL += "&preferredInstallments=\(preferredInstallments)"
}
else {
    saleActionURL += "&withInstallments=false" // no installments parameter (should be used)
}

if let isvDetails = isvDetails {
    saleActionURL += "&ISV_clientId=\(isvDetails.clientId)"
    saleActionURL += "&ISV_amount=\(((isvDetails.amount * 100) as NSDecimalNumber).intValue)" // The ISV amount in cents without any decimal digits.
    saleActionURL += "&ISV_clientSecret=\(isvDetails.clientSecret)"
    if let sourceCode = isvDetails.sourceCode {
        saleActionURL += "&ISV_sourceCode=\(sourceCode)"
    }
}

let showReceipt = UserDefaults.standard.value(forKey: "show_receipt") as? Bool ?? true
saleActionURL += "&show_receipt=\(showReceipt)"

let showRating = UserDefaults.standard.value(forKey: "show_rating") as? Bool ?? true
saleActionURL += "&show_rating=\(showRating)"

let showResult = UserDefaults.standard.value(forKey: "show_transaction_result") as? Bool ?? true
saleActionURL += "&show_transaction_result=\(showResult)"

return saleActionURL
}

//USE LIKE THIS
let saleActionURL = createSaleRequest(amount: 12.00, tipAmount: 2.00, clientTransactionId: nil, isvDetails: nil, numberOfInstallments: nil)
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: saleActionURL)

Request example

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=sale&amount=1200&tipAmount=200&withInstallments=false&show_receipt=false&show_rating=true

Sale response

After executing a Sale transaction the card terminal app responds with a Sale Response result to indicate if the transaction has been approved or not.

The result is received as a URI in the callback activity.

The table below summarises the contents of an approved response.

Field Description Example
callback The URI callback that will handle the result. 'interapp-callback://result'
status The status of the transaction. 'success'
message A string containing information about the transaction status. 'Transaction successful'
action Sale transaction. 'sale'
clientTransactionId The client transaction ID. '12345678901234567890123456789012'
amount The amount in cents without any decimal digits. '1200' = 12 euro
tipAmount How much of the amount in cents is considered as tip without any decimal digits. '200' = 2 euro
verificationMethod The verification method used. 'Contactless'
rrn The retrieval reference number of the transaction RRN. '123456833121'
cardType The card type. 'Debit Mastercard'
accountNumber The card number masked. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars. '537489******1831'
referenceNumber A 6-digit number indicating the transaction's STAN number. '833121'
authorisationCode A 6-digit number indicating the transaction's Authorisation code provided by the host. '690882'
tid A 12 character string indicating the terminal's TID number. '16016684'
orderCode The order code. '1091166300000136'
shortOrderCode The order code in short format. '1091166300'
installments Number of installments. '10'
transactionDate The transaction date in ISO 8601 format. '2019-09-13T12:14:19.8703452+03:00'
transactionId A unique identifier for the transaction. 'a78e045c-49c3-4743-9071-f1e0ed71810c'

A Sale response result for an approved transaction looks as follows:

interapp-callback://result?status=success&message=Transaction%2520successful&action=sale&accountNumber=537489******1831&amount=1400&authorisationCode=006373&cardType=Debit%2520Mastercard&orderCode=1091166300000136&shortOrderCode=1091166300&referenceNumber=27388&rrn=109113027388&tid=16000136&tipAmount=200&transactionDate=2021-04-01T16%253A47%253A59.251+0300&transactionId=728d7fe1-4426-4d29-8fee-510ae6c932e5&verificationMethod=Contactless

It is expected that certain transactions will fail for various reasons. A Sale response result for a failed transaction looks as follows:

interapp-callback://result?status=failure&message=Transaction%2520declined&action=sale&amount=101&orderCode=1092136112000136&shortOrderCode=1092136112&rrn=109210030077&tid=16000136&tipAmount=0&transactionDate=2021-04-02T13%253A26%253A09.158+0300

The structure of the message is the same as in the case of an approved transaction. Fields such as referenceNumber and authorisationCode may not have values since there is no STAN code available, nor an authorisation code.

Cancel request 

For a typical cancel 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. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3'
appId The client app id. 'com.example.myapp'
action Cancel transaction. 'cancel'
amount The amount to refund in cents, without any decimal digits. If no amount provided, a full refund will be performed. '600' = 6 euro (optional)
referenceNumber The STAN number of the transaction to be cancelled. '833121' (optional)
orderCode The order code of the transaction to be cancelled. When provided, it will act as a search parameter and if a transaction with the same order code is found, the cancel/refund will take place. If a reference number has also been provided, only the order code will be taken into consideration. '109113919500020' (optional)
shortOrderCode Same as order code but in shorter length, although when provided, it will be reconstructed into a full length order code based on the terminal used. If the original sale has been made in a different terminal, the transaction won’t be retrieved and therefore cancelled. If both orderCode and shortOrderCode are provided, only the shortOrderCode will be taken into consideration. '1091139195’ (optional)
txnDateFrom Specifies the minimum date on which the transaction search will take place. if txnDateFrom is provided and txnDateTo is not, the current date will be assigned as the value of txnDateTo. The date should be in ISO 8601 format. '2021-03-29T00:00:00.000+0300' (required if txnDateTo has been set, otherwise optional)
txnDateTo Specifies the maximum date on which the transaction search will take place. if txnDateFrom has not been provided but a txnDateTo has, an error is returned. The date should be in ISO 8601 format. '2021-03-30T00:00:00.000+0300' (optional)
show_receipt Option to show the receipt screen, before returning to the InterApp, after performing a refund on VW POS. 'true'
show_transaction_result Option to show the transaction result screen, before returning to the InterApp, after performing a refund on VW POS. If show_receipt is set to 'true’ this value will be neglected, therefore the transaction result screen will be shown. 'false'
callback Your custom URI callback that will handle the result. 'interapp-callback'

The above information elements must create a URI call, i.e.

func createCancelRequest(refundAmount: Decimal?, reference: String?, orderCode: String?, shortOrderCode: String?, dateFrom: String?, dateTo: String?) -> String {

        // construct cancel action url
        var cancelActionURL = Constants.cancelUrlString // vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=cancel

        if let amount = refundAmount {
            cancelActionURL += "&amount=\(((amount * 100) as NSDecimalNumber).intValue)" // The amount in cents without any decimal digits.
        }

        if let unwrappedReference = reference, unwrappedReference != "" {
            cancelActionURL += "&referenceNumber=\(unwrappedReference)" // transaction reference number
        }

        if let unwrappedOrderCode = orderCode, unwrappedOrderCode != ""  {
            cancelActionURL += "&orderCode=\(unwrappedOrderCode)" // transaction order code
        }

        if let unwrappedShortOrderCode = shortOrderCode, unwrappedShortOrderCode != ""  {
            cancelActionURL += "&shortOrderCode=\(unwrappedShortOrderCode)" // transaction short Order Code
        }

        if let dateFrom = dateFrom {
            cancelActionURL += "&txnDateFrom=\(dateFrom)"
        }

        if let dateTo = dateTo {
            cancelActionURL += "&txnDateTo=\(dateTo)"
        }

        let showReceipt = UserDefaults.standard.value(forKey: "show_receipt") as? Bool ?? true
        cancelActionURL += "&show_receipt=\(showReceipt)"

        let showResult = UserDefaults.standard.value(forKey: "show_transaction_result") as? Bool ?? true
        cancelActionURL += "&show_transaction_result=\(showResult)"

        return cancelActionURL
    }
    //USE LIKE THIS
        let canceRequestStringURL: String = createCancelRequest(refundAmount: 5, reference: nil, orderCode: nil, shortOrderCode: "1091139195",, dateFrom: "2021-03-29T00:00:00.000+0300", dateTo: nil)
        (UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: canceRequestStringURL)

The above information elements must create a URI call. i.e.

Request example

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=cancel&amount=600&shortOrderCode=1091139195&txnDateFrom=2021-03-29T00:00:00.000+0300&show_receipt=false

Cancel response

After executing a Cancel transaction, the VW POS app responds with a Cancel response result to indicate if the transaction has been approved or not.

The result is received as a URI in the callback activity.

The table below summarises the contents of an approved response:

Field Description Example
callback The URI callback that will handle the result. 'interapp-callback://result'
status The status of the transaction. 'success'
message A string containing information about the transaction status. 'Transaction successful'
action Cancel transaction. 'cancel'
amount The amount in cents without any decimal digits. '1200' = 12 euro
cardType The card type. 'Debit Mastercard'
accountNumber The card number. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars. '537489******1831'
orderCode The order code. '1091159196000136'
shortOrderCode The order code in short format. '1091159196'
tid A 12 character string indicating the terminal's TID number. '16016684'
transactionDate The transaction date in ISO 8601 format. '2021-03-30T00:00:00.000+0300'
transactionId A unique identifier for the transaction. 'a78e045c-49c3-4743-9071-f1e0ed71810c'

A Cancel response result for an approved transaction looks as follows:

interapp-callback://result?status=success&message=Transaction%2520successful&action=cancel&accountNumber=537489******1831&amount=500&cardType=Debit%2520Mastercard&orderCode=1092156115000136&shortOrderCode=1092156115&referenceNumber=30378&rrn=109212030376&tid=16000136&tipAmount=0&transactionDate=2021-04-02T15%253A18%253A51.416+0300&transactionId=063c17d5-f5f5-4ee3-8524-6dbb0d09ebeb

It is expected that certain transactions will fail for various reasons. A Cancel response result for a failed transaction looks as follows:

interapp-callback://result?status=failure&message=Transaction%2520declined&action=cancel&accountNumber=537489******1831&amount=159&cardType=Debit%2520Mastercard&orderCode=1092156114000136&shortOrderCode=1092156114&rrn=109212030372&tid=16000136&tipAmount=0&transactionDate=2021-04-02T15%253A12%253A16.068+0300

The structure of the message is the same as in the case of an approved transaction.

Abort request

For aborting an ongoing request the client app must provide the following parameters:

Field Description Example
scheme The Viva's custom URLscheme, the host and the version. 'vivapayclient://pay/v1'
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3'
appId The client app id. 'com.example.myapp'
action Abort request. abort
callback Your custom URI callback that will handle the result. 'interapp-callback'

The above information elements must create a URI call, i.e.

let abortAction = "&action=abort"

func createAbortRequest() {
    let abortActionURL = schemeURL + callback + merchantKey + clientAppID + abortAction
    return abortActionURL
}

func performInterAppRequest(request: String){
    guard let url = URL(string: request) else { return } // url with constructed parameters
    UIApplication.shared.open(url) { (result) in
        if result {
            // The URL was delivered successfully!
        }
    }
}

//USE LIKE THIS
let abortActionURL = createAbortRequest()
performInterAppRequest(request: abortActionURL)

Example:

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=abort

Abort response

After executing an abort request the VW POS app may or may not respond depending on its state. E.g. if the VW POS app is in the middle of a sale you won’t receive an abort response but you will receive the sale response.

The result is received as a URI in the callback activity.

The table below summarizes the contents of a response.

Field Description Example
callback The URI callback that will handle the result. 'interapp-callback://result'
action The action. 'abort'
status The status of the abort. 'success'
message A string containing information about the abort status. 'nothing to abort / aborted'

An Abort response result for an approved transaction looks as follows:

Examples

Successful abort:

interapp-callback://result?status=success&message=Aborted&action=abort

Nothing to abort:

interapp-callback://result?status=failure&message=Nothing%2520to%2520abort&action=abort

Abort request that cannot be processed because of a sale transaction:

interapp-callback://result?status=success&message=Transaction%2520successful&action=sale&accountNumber=537489******8493&amount=500&authorisationCode=654321&cardType=Debit%2520Mastercard&orderCode=0287160005000168&referenceNumber=800594&rrn=028713800594&tid=16000168&tipAmount=0&transactionDate=2020-10-13T16%253A59%253A44.973+0300&transactionId=bef6653d-913c-4dda-b97b-8b0bebbc47f7&verificationMethod=Contactless

Batch request

For opening or closing a batch with a request, the client app must provide all the necessary parameters from the table below.

Field Description Example
scheme The Viva's custom URL scheme, the host and the version. 'vivapayclient://pay/v1'
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3'
appId The client app id. 'com.example.myapp'
action Batch request. 'batch'
command Specifies the request action: 'open' to create a new batch, 'close' to end an active batch. 'open'
batchName When opening a new batch this name will be given to the batch. If no value is provided, the batch will be named automatically.
When closing a batch this parameter will attempt to close any open batch with this specific name. If no value is provided, the currently active batch will end. (Optional)
'morningShift'
batchId Works only when closing a batch. This parameter will attempt to close any open batch with this specific UUID. (Optional) '7885F4F1-59CA-42C2-81BB-6DB48AA138A6'
callback The URI callback that will handle the result. 'interapp-callback'
// USE LIKE THIS
func createBatchRequest(command: String, batchName: String?, batchUUID: String?) {
    // construct batch url
    var endBatchActionURL = Constants.batchUrlString //vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=set_printing_settings
    endBatchActionURL += "&command=" + command
    if let batchName = batchName, batchName.isValidName {
        endBatchActionURL += "&batchName=" + batchName // name of batch to end
    }
    if let batchUUID = batchUUID, batchUUID.isValidName  {
        endBatchActionURL += "&batchId=" + batchUUID // uuid of batch to end
    }
    (UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: endBatchActionURL)
}

Examples

Open batch:

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=batch&command=open&batchName=morningShift

Close batch:

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action&command=close=batch&batchName=morningShift

Batch response

After executing a Batch request the VW POS app will respond accordingly to the type of command you sent.

The table below summarizes the contents of a response.

Field Description Example
callback The URI callback that will handle the result. 'interapp-callback://result'
action The action. 'batch'
command Specifies the action taken: 'open' for creating a new batch, 'close' for ending an active batch. 'close'
batchName The name of the batch opened/closed. 'morningShift'
batchId The UUID of the batch opened/closed.
status The status of the batch request. 'success'
message A string containing information about the batch status. 'Batch closed’

A Batch response result for an successful batch open or close looks as follows:

Examples

Open Batch:

interapp-callback://?status=success&message=Batch%2520successfully%2520created!&action=batch&batchName=morningShift&batchId=7885F4F1-59CA-42C2-81BB-6DB48AA138A6&command=open

Close Batch:

interapp-callback://?status=success&message=Batch%2520closed&action=batch&batchName=morningShift&batchId=7885F4F1-59CA-42C2-81BB-6DB48AA138A6&command=close

Printing settings request

Using set printing options action user can apply changes to printing settings of the VW POS application from a third-party app. For a typical set printing options 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. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3'
appId The client app id. 'com.example.myapp'
action Set printing settings. 'set_printing_settings'
businessDescriptionEnabled A flag indicating whether the business description identifier will be printed on the receipt. 'true'
businessDescriptionType The business description identifier that will be printed on the receipt if it is enabled. For successful validation, should be one of the following values: 'businessName', 'tradeName', 'storeName'. 'businessName'
printLogoOnMerchantReceipt A flag indicating whether the logo will be printed on the receipt of the merchant. 'true'
printVATOnMerchantReceipt A flag indicating whether the vat number will be printed on the receipt of the merchant. 'true'
isBarcodeEnabled A flag indicating whether the barcode will be printed on the receipt. 'true'
printAddressOnReceipt A flag indicating whether the address will be printed on the receipt. 'true'
isMerchantReceiptEnabled A flag indicating whether the receipt of the merchant will be printed. 'true'
isCustomerReceiptEnabled A flag indicating whether the receipt of the customer will be printed. 'true'
callback The URI callback that will handle the result. 'interapp-callback'
// USE LIKE THIS
    enum PrinterSettingsKeys: String, CaseIterable {
        case businessDescriptionEnabled
        case businessDescriptionType
        case printLogoOnMerchantReceipt
        case printVATOnMerchantReceipt
        case isBarcodeEnabled
        case printAddressOnReceipt
        case isMerchantReceiptEnabled
        case isCustomerReceiptEnabled
    }

    enum BusinessDescriptionType: String {
        case businessName
        case tradeName
        case storeName
    }

    var printerSettingsDictionary: [String: String] = [:]


    func applySettingsButtonTapped(_ sender: Any) {
        PrinterSettingsKeys.allCases.forEach { (key) in
            printerSettingsDictionary[key.rawValue] = "true"
        }
        printerSettingsDictionary[PrinterSettingsKeys.businessDescriptionType.rawValue] = BusinessDescriptionType.businessName.rawValue

        var printerSettingsURL = Constants.printerSettingsUrlString
        printerSettingsDictionary.forEach { (setting) in
            printerSettingsURL += "&" +  setting.key + "=" + setting.value
        }
        (UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: printerSettingsURL)
    }

Example

vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=set_printing_settings&businessDescriptionEnabled=true&printAddressOnReceipt=true&businessDescriptionType=businessName&isBarcodeEnabled=true&isMerchantReceiptEnabled=true&printLogoOnMerchantReceipt=true&isCustomerReceiptEnabled=true&printVATOnMerchantReceipt=true

Printing settings response

The response will return the status request along with all the printing settings values of the VW POS 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'
status The status of the request. 'success'
message A string containing information about the transaction status. 'Printer settings updated'
action Set printing settings. 'set_printing_settings'
businessDescriptionEnabled A flag indicating whether the business description identifier will be printed on the receipt. 'true'
businessDescriptionType The business description identifier that will be printed on the receipt if it is enabled. For successful validation, should be one of the following values: 'businessName', 'tradeName', 'storeName' 'businessName'
printLogoOnMerchantReceipt A flag indicating whether the logo will be printed on the receipt of the merchant. 'true'
printVATOnMerchantReceipt A flag indicating whether the vat number will be printed on the receipt of the merchant. 'true'
isBarcodeEnabled A flag indicating whether the barcode will be printed on the receipt. 'true'
printAddressOnReceipt A flag indicating whether the address will be printed on the receipt. 'true'
isMerchantReceiptEnabled A flag indicating whether the receipt of the merchant will be printed. 'true'
isCustomerReceiptEnabled A flag indicating whether the receipt of the customer will be printed. 'true'

Example

interapp-callback://result?status=success&message=Printer%2520settings%2520updated&action=set_printing_settings&businessDescriptionType=businessName&businessDescriptionEnabled=true&printLogoOnMerchantReceipt=true&printVATOnMerchantReceipt=true&isBarcodeEnabled=true&printAddressOnReceipt=true&isMerchantReceiptEnabled=true&isCustomerReceiptEnabled=true

Send logs request

Using send logs action user can trigger the application to upload the application logs.

Field Description Example
scheme The Viva's custom URL scheme, the host and the version. 'vivapayclient://pay/v1'
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value
'SG23323424EXS3'
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp'
action Cancel transaction. For successful validation, should not be empty. 'sendLogs'
callback The URI callback that will handle the result. For successful validation, should not be empty. 'interapp-callback’

The above information elements must create a URI call, i.e.

   // USE LIKE THIS
    func sendLogs() {
        let sendLogsUrlString = Constants.sendLogsUrlString //"vivapayclient://pay/v1?callback=interapp-callback&merchantKey=SG23323424EXS3&appId=com.vivawallet.InterAppDemo&action=sendLogs"
        (UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: Constants.sendLogsUrlString)
    }

Send logs response

After executing an abort transaction, the card terminal app responds with an abort response result to indicate if the abort request has been successful or not. Also, we should state that the response from the abort action is actually a response of a failed transaction.

The result is received as a URI in the application(_:open:options:) method on the AppDelegate file.

The table below summarises the contents of a successful response.

Field Description Example
callback The URI callback that will handle the result. 'interapp-callback://result'
status The status of the request. 'success'
message A string containing information about the send logs status. 'Logs sent!'
action Send logs. 'sendLogs'

A send logs response result looks as follows:

"interapp-callback://result?status=success&message=Logs%2520sent!&action=sendLogs"