Fast Refund request

An overview of the Fast Refund message for Android.

Overview

👉 The Fast Refund request is used to perform a ‘fast refund’ for a payment made with a Visa, Mastercard, or Maestro card.

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.

Fast Refund request

For a typical Fast Refund request, or refund, the client app must provide the following information:

Field Description Example Required Card terminal support Character limit Type
scheme The Viva's custom URL scheme, the host and the version. 'vivapayclient://pay/v1' 'viva.com | Terminal' application for Android
merchantKey The merchant's key. For successful validation, should not be empty.
Deprecated: you may pass any value.
'SG23323424EXS3' 'viva.com | Terminal' application for Android
appId The client app ID. For successful validation, should not be empty. 'com.example.myapp' 'viva.com | Terminal' application for Android
action Fast Refund. For successful validation, should not be empty. 'send_money_fast_refund' 'viva.com | Terminal' application for Android
referenceNumber The STAN number of the transaction to be cancelled. If empty, after card presentment, the app will provide a list of the last 3 transactions made with the presented card, allowing the user to select the transaction to be canceled. If action is cancel and if not empty should be integer bigger than zero. '123789' integer (int32)
amount The amount to be refunded in cents '100' 'viva.com | Terminal' application for Android 10 integer (int32)
show_receipt A flag indicating if the receipt and transaction result will be shown. If true both transaction result and receipt will be shown. If false receipt will not be shown and result will be shown if show_transaction_result is true. 'true' 'viva.com | Terminal' application for Android Boolean
show_transaction_result A flag indicating if transaction result will be shown. 'true' 'viva.com | Terminal' application for Android Boolean
show_rating A flag indicating if the rating flow will be shown. 'true' 'viva.com | Terminal' application for Android Boolean
callback The URI callback that will handle the result. For successful validation, should not be empty. 'mycallbackscheme://result' 'viva.com | Terminal' application for Android

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=send_money_fast_refund"
				+ "&callback=mycallbackscheme://result"
				+ "&amount=100"
				+ "&show_receipt="+true
				+ "&show_transaction_result="+true
				+ "&show_rating="+true ));


payIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
//        Those two flags should be added for paydroid implementations
//        payIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);
//        payIntent.addFlags(Intent.FLAG_ACTIVITY_NO_HISTORY);
                startActivity(payIntent);

Fast Refund response

After executing a Fast Refund transaction, or refund, the ‘viva.com | Terminal’ application responds with a Fast Refund response result to indicate if the refund has been approved or not.

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.com | Terminal' application for Android
status The status of the transaction 'success' 'viva.com | Terminal' application for Android
message A string containing information about the transaction status. 'Transaction successful' 'viva.com | Terminal' application for Android
action Fast Refund transaction. 'send_money_fast_refund' 'viva.com | Terminal' application for Android
amount The amount in cents without any decimal digits. '1200' = 12 euro 'viva.com | Terminal' application for Android
cardType The card type. 'Mastercard' 'viva.com | Terminal' application for Android
accountNumber The card number. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars. '479275\*\*\*\*\*\*9999' 'viva.com | Terminal' application for Android
tid A 12-character string indicating the terminal's TID number. '16016684' 'viva.com | Terminal' application for Android
orderCode 16-digit integer. '1020304050607080' 'viva.com | Terminal' application for Android
transactionId A unique identifier for the transaction. 'a78e045c-49c3-4743-9071-f1e0ed71810c' 'viva.com | Terminal' application for Android

A Fast Refund response result for an approved refund looks as follows:

It is expected that certain transactions will fail for various reasons. A Fast Refund response result for a failed refund looks as follows:

The structure of the message is the same as in the case of an approved Fast Refund.

Key to card terminal product categories

To understand the icons used on the above tables, see the below table.

Product category Terminal models Icon
Android Card Terminals Android Card Terminal Ethernet, Android Card Terminal 4G, Mobile Card Terminal Plus, Mobile Card Terminal. Android Card Terminals
'viva.com | Terminal' application for Android Mini Card Reader, Pocket Card Terminal connected via Bluetooth or USB to the 'viva.com | Terminal' application for Android. Android Card Terminals
Linux Card Terminals Countertop, IM20, S900, S800, D200. Linux Card Terminals

Get Support

If you would like to integrate with Viva Wallet, or if you have any queries about our products and solutions, please see our Contact & Support page to see how we can help!