Printing settings request

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

Printing settings request

Using set printing options action, the user can apply changes to printing settings of the 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 Card terminal support
scheme The Viva's custom URL scheme, the host and the version. 'vivapayclient://pay/v1' Viva Wallet POS app for Android
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3' Viva Wallet POS app for Android
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp' Viva Wallet POS app for Android
action Set printing settings. For successful validation, should not be empty. 'set_printing_settings' Viva Wallet POS app for Android
businessDescriptionEnabled A flag indicating whether the business description identifier will be printed on the receipt 'true' Viva Wallet POS app for Android
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' Viva Wallet POS app for Android
printLogoOnMerchantReceipt A flag indicating whether the logo will be printed on the receipt of the merchant 'true' Viva Wallet POS app for Android
printVATOnMerchantReceipt A flag indicating whether the vat number will be printed on the receipt of the merchant 'true' Viva Wallet POS app for Android
isBarcodeEnabled A flag indicating whether the barcode will be printed on the receipt 'true' Viva Wallet POS app for Android
printAddressOnReceipt A flag indicating whether the address will be printed on the receipt 'true' Viva Wallet POS app for Android
isMerchantReceiptEnabled A flag indicating whether the receipt of the merchant will be printed 'true' Viva Wallet POS app for Android
isCustomerReceiptEnabled A flag indicating whether the receipt of the customer will be printed 'true' Viva Wallet POS app for Android
callback The URI callback that will handle the result. For successful validation, should not be empty. 'mycallbackscheme://result' Viva Wallet POS app for Android

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

String reqStr = "vivapayclient://pay/v1"
		+ "?merchantKey="MY_MERCHANT_KEY"
		+ "&appId=com.example.myapp"
		+ "&action=set_printing_settings"
		+ "&callback=mycallbackscheme://result"
		+ "&businessDescriptionEnabled=true"
		+ "&businessDescriptionType=businessName"
		+ "&printLogoOnMerchantReceipt=true"
		+ "&printVATOnMerchantReceipt=true"
		+ "&isBarcodeEnabled=true"
		+ "&printAddressOnReceipt=true"
		+ "&isMerchantReceiptEnabled=true"
		+ "&isCustomerReceiptEnabled=true";

Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse( reqStr));
payIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);

Printing settings 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. The response from the abort action is actually the response of a failed transaction.

The result is received as a URI in the callback activity intent:

Uri result = getIntent().getData();

The table below summarises the contents of an approved response.

Field Description Example Card terminal support
callback The URI callback that will handle the result. 'mycallbackscheme://result' Viva Wallet POS app for Android
status The status of the transaction 'success' Viva Wallet POS app for Android
message A string containing information about the transaction status. 'Transaction successful' Viva Wallet POS app for Android
action Set printing settings. For successful validation, should not be empty. 'set_printing_settings' Viva Wallet POS app for Android
businessDescriptionEnabled A flag indicating whether the business description identifier will be printed on the receipt 'true' Viva Wallet POS app for Android
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' Viva Wallet POS app for Android
printLogoOnMerchantReceipt A flag indicating whether the logo will be printed on the receipt of the merchant 'true' Viva Wallet POS app for Android
printVATOnMerchantReceipt A flag indicating whether the vat number will be printed on the receipt of the merchant 'true' Viva Wallet POS app for Android
isBarcodeEnabled A flag indicating whether the barcode will be printed on the receipt 'true' Viva Wallet POS app for Android
printAddressOnReceipt A flag indicating whether the address will be printed on the receipt 'true' Viva Wallet POS app for Android
isMerchantReceiptEnabled A flag indicating whether the receipt of the merchant will be printed 'true' Viva Wallet POS app for Android
isCustomerReceiptEnabled A flag indicating whether the receipt of the customer will be printed 'true' Viva Wallet POS app for Android

A cancel response result for an approved refund looks as follows:

mycallbackscheme://result?status=success&message=Printing settings updated&action=set_printing_settings&businessDescriptionType=businessName&printLogoOnMerchantReceipt=false&printVATOnMerchantReceipt=false&isBarcodeEnabled=false&businessDescriptionEnabled=false&printAddressOnReceipt=false&isMerchantReceiptEnabled=false&isCustomerReceiptEnabled=false

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.