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

For a typical Decimal Amount Mode request, the client app must provide the following information:

Field Description Example Card terminal support
scheme The Viva custom URL scheme, the host and the version. 'vivapayclient://pay/v1' Android Card Terminals
merchantKey The merchant's key. For successful validation, should not be empty. Deprecated: you may pass any value 'SG23323424EXS3' Android Card Terminals
action AmountDecimalMode. For successful validation, should not be empty. ‘amountDecimalMode’ Android Card Terminals
decimalMode A unique description of the decimal mode option such as 0 for ‘Decimal Amount’ or 1 for ‘No Decimal Amount’ '0' Android Card Terminals
callback The URI callback that will handle the result. For successful validation, should not be empty. 'mycallbackschme://result' Android Card Terminals

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.

Field Description Example Card terminal support
callback The URI callback that will handle the result. 'mycallbackscheme://result' Android Card Terminals
status The status of the request. 'success' Android Card Terminals
message A string containing information about the request status. 'Set decimal amount successful' Android Card Terminals
action amountDecimalMode ‘amountDecimalMode’ Android Card Terminals

A decimal Amount Mode response result for an approved request looks as follows:

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!