Printing settings request

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

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

Get Support

If you have any questions about our solutions, or questions about how to integrate with our solutions, please refer to our Get Support page.