Decimal Amount Mode request
An overview of the Decimal Amount Mode request message for Android.
Overview
👉 The Decimal Amount Mode request is used to turn Decimal Amount Mode on or off. This setting determines whether or not payment amounts are provided to the ‘Viva.com Terminal’ application in decimal format.
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.
- Decimal Amount Mode request originating from the client app to initiate a request for a decimal amount mode.
- Decimal Amount Mode response originating from the ‘Viva.com Terminal’ application to return the result of a decimal amount mode.
Decimal Amount Mode request
For a typical Decimal Amount Mode request, the client app must provide the following information:
The above information elements must create a URI call. i.e.
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
"vivapayclient://pay/v1"
+ "?merchantKey=""MY_MERCHANT_KEY""
+ "&appId=com.example.myapp"
+ "&action=amountDecimalMode"
+ "&callback=mycallbackscheme://result"
+ "&decimalMode=0"))
payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);
Decimal Amount Mode response
After executing a decimal amount mode request the ‘Viva.com Terminal’ application responds with a decimal amount mode response.
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.
A decimal Amount Mode response result for an approved request looks as follows:
If decimalMode=0
mycallbackscheme://result?status=success&message=Set decimal amount successful&action=amountDecimalMode&cashless=false
If decimalMode=1
mycallbackscheme://result?status=success&message=Set no decimal amount successful&action=amountDecimalMode&cashless=false
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!