Set printing settings request

An overview of the Set printing settings request message.

Overview

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

Set 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'.

⚠️This field is mandatory.
'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'
isPrintingReceiptEnabled A flag indicating whether printing receipts will take place or not. '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
        case isPrintingReceiptEnabled
    }

    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&isPrintingReceiptEnabled=true

Set 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'
isPrintingReceiptEnabled A flag indicating whether printing receipts will take place or not. 'true'

Example

Get Support

If you would like to integrate with Viva Wallet, or if you have any queries about our products and solutions, please see our Get Support page to see how we can help!