Fast Refund request
An overview of the Fast Refund message for Android.
- Overview
- Fast Refund request
- Fast Refund response
- Key to card terminal product categories
- Get Support
Overview
👉 The Fast Refund request is used to perform a ‘fast refund’ for a payment made with a Visa, Mastercard, or Maestro card (where supported by the customer’s bank).
Fast Refund functionality is not enabled by default, and is subject to approval. Please contact your sales representative.
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 originating from the client app to initiate a request for a Fast Refund transaction.
- Fast Refund response originating from the ‘Viva.com Terminal’ application to return the result of a Fast Refund transaction.
Fast Refund functionality is also available standalone
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' | ✅ | |||
appId | The client app ID. For successful validation, should not be empty. | 'com.example.myapp' | ✅ | |||
action | Fast Refund. For successful validation, should not be empty. | 'send_money_fast_refund' | ✅ | |||
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' | ✅ | 10 | integer (int32) | |
sourceCode | The store/source code that will be linked to the transaction.
|
[A payment source (physical store) that is associated with the transaction] How to create a payment source for CP payments |
20 | 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' | Boolean | |||
show_transaction_result | A flag indicating if transaction result will be shown. | 'true' | Boolean | |||
show_rating | A flag indicating if the rating flow will be shown. | 'true' | Boolean | |||
callback | The URI callback that will handle the result. For successful validation, should not be empty. | 'mycallbackscheme://result' | ✅ | |||
aadeProviderId [*] | 👉 Integration with Provider (ΥΠΑΗΕΣ) Set the Unique Number to identify your Provider 👉 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) For integration through ΦΗΜΑΣ, please specify as `aadeProviderId' the value 800 |
Integration with Provider (ΥΠΑΗΕΣ) 999 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) 800 |
3 | Numeric | ||
aadeProviderSignatureData [*] | 👉 Integration with Provider (ΥΠΑΗΕΣ) The unencrypted signature that includes the fields below with semicolon as a delimiter “;”: 👉 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) Use ECR TOKEN as in A.1098/2023 Request A/S< session number>/F< amount>:978:2 /D< datetime>/R< ecr-id>/H< operator-number>/T0 /M/Q< mac>} Result R/S< session number>/R< ecr-id>/T< receipt-number> /Μ/C00/D< trans-data>{/P< prn-data>}} |
Integration with Provider (ΥΠΑΗΕΣ) AD33729F4ED749928AAFA00B90EE4EA91551BAC1;;20231204080313;1051;10000;2400;12400;POS_1 |
200 | Alphanumeric | ||
aadeProviderSignature [*] | 👉 Integration with Provider (ΥΠΑΗΕΣ) The fields of providerSignatureFields encrypted using a public key and the Elliptic Curve Digital Signature Algorithm (ECDSA): 👉 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) Use SessionKey as in A.1098/2023 |
Integration with Provider (ΥΠΑΗΕΣ) o0094r3Yk3KTqASLkW3evlDsnIg/ZAdUUf6UCXDtjqpI/dquzAT4WNX3yzS/GLciVNbT75H4pj8hLOV0EpHtzw==" |
Alphanumeric |
[*] These parameters are only applicable in Greece
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
+ "&sourceCode=6532"
+ "&show_transaction_result="+true
+ "&show_rating="+true
+ "&aadeProviderId=999"
+ "&aadeProviderSignatureData=AD33729F4ED749928AAFA00B90EE4EA91551BAC1;;20231204080313;1051;10000;2400;12400;POS_1"
+ "&aadeProviderSignature=o0094r3Yk3KTqASLkW3evlDsnIg/ZAdUUf6UCXDtjqpI/dquzAT4WNX3yzS/GLciVNbT75H4pj8hLOV0EpHtzw=="));
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.
A Fast Refund response result for an approved refund looks as follows:
mycallbackscheme://result?status=success&message=Transaction successful&action=send_money_fast_refund&clientTransactionId=&amount=1200&tipAmount=0&verificationMethod=CONTACTLESS - NO CVM&rrn=107715996464&cardType=Mastercard&referenceNumber=996471&accountNumber=************9666&tid=16000223&transactionDate=2021-03-18T17:09:50.8747721+02:00&transactionId=5f3ecbbe-d2da-4e59-9d38-610fddd79c73&sourceCode=1234
A sale response for a successful Fast Refund transaction using AADE parameters looks as follows:
mycallbackscheme://result?status=success&message=Transaction successful&action=send_money_fast_refund&clientTransactionId=&amount=1200&tipAmount=0&verificationMethod=CONTACTLESS - NO CVM&rrn=107715996464&cardType=MASTERCARD&referenceNumber=996471&accountNumber=661542******9666&tid=16000223&transactionDate=2024-02-18T17:09:50.8747721+02:00&transactionId=5f3ecbbe-d2da-4e59-9d38-610fddd79c73&aadeTransactionId=116407412859072859072&sourceCode=1234
It is expected that certain transactions will fail for various reasons. A Fast Refund response result for a failed refund looks as follows:
mycallbackscheme://result?status=fail&message=(-24) REFUND_INVALID_AMOUNT&action=send_money_fast_refund&amount=10000&tipAmount=0&verificationMethod=CONTACTLESS - NO CVM&cardType=Mastercard&referenceNumber=0&accountNumber=537488******9666&tid=16000223&sourceCode=1234
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. | |
'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. | |
Linux Card Terminals | Countertop, IM20, S900, S800, D200. |
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!