Set Printing Settings request
An overview of the Set Printing Settings 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 Set Printing settings request is used to configure and apply changes to the printing-related settings 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.
- Set Printing Settings request originating from the client app to set the Viva.com Terminal App printing settings.
- Set Printing Settings response originating from the Viva.com Terminal App to return the result of an printing settings request.
Set Printing Settings request
For a typical Set Printing Settings 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 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' |
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
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&isPrintingReceiptEnabled=true
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!