Unreferenced Refund
An overview of the Unreferenced Refund request message for Android.
Our ‘Viva.com Terminal’ application (tap-on-phone) supports Apple Tap to Pay in the UK, the Netherlands, France, Austria, Czech Republic, Ireland, Romania, and Sweden, Italy & Germany.
Overview
👉 The Unreferenced Refund request allows you to process a refund without a need of prior transaction or an existing order.
The Unreferenced Refund feature is not enabled by default. To activate it, please reach out to your sales representative or contact our support team.
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.
- Unreferenced Refund request originating from the client app to initiate a request for an Unreferenced Refund transaction.
- Unreferenced Refund response originating from the ‘Viva.com Terminal’ application to return the result of an Unreferenced Refund transaction.
The Unreferenced Refund functionality is currently not available in standalone mode.
Unreferenced Refund request
For a typical Unreferenced Refund request, the client app must provide the following information:
Field | Description | Example | Required |
---|---|---|---|
scheme | The Viva's custom URL scheme, the host and the version. | 'vivapayclient://pay/v1' | ✅ |
appId | The client app id. | 'com.example.myapp' | ✅ |
action | Unreferenced refund transaction. | 'unreferenced_refund' | ✅ |
amount | The amount to refund in cents, without any decimal digits. If no amount provided, a full refund will be performed. | '600' = 6 euro (optional) | ✅ |
show_receipt | Option to show the receipt screen, before returning to the InterApp, after performing a refund on Viva.com Terminal App. | 'true' | |
show_transaction_result | Option to show the transaction result screen, before returning to the InterApp, after performing a refund on Viva.com Terminal App. If show_receipt is set to 'true’ this value will be neglected, therefore the transaction result screen will be shown. | 'false' | |
callback | Your custom URI callback that will handle the result. | 'interapp-callback' | ✅ |
aadeProviderId [*] | 👉 Integration with Provider (ΥΠΑΗΕΣ) Set the Unique Number to identify your Provider. To learn more about all licensed AADE providers, please visit this page. 👉 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) For integration through ΦΗΜΑΣ, please specify as `aadeProviderId' the value 800 |
Integration with Provider (ΥΠΑΗΕΣ) 999 Integration with ΦΗΜΑΣ (Φορολογικός Ηλεκτρονικός Μηχανισμός Ασφαλείας) 800 |
|
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 |
|
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==" |
[*] These parameters are only applicable in Greece.
The above information elements must create a URI call, i.e.
func createUnreferencedRefundRequest(refundAmount: Decimal?) -> String {
// construct cancel action url
var actionURL = Constants.cancelUrlString // vivapayclient://pay/v1?callback=interapp-callback&appId=com.vivawallet.InterAppDemo&action=unreferenced_refund
if let amount = refundAmount {
actionURL += "&amount=\(((amount * 100) as NSDecimalNumber).intValue)" // The amount in cents without any decimal digits.
}
let showReceipt = UserDefaults.standard.value(forKey: "show_receipt") as? Bool ?? true
actionURL += "&show_receipt=\(showReceipt)"
let showResult = UserDefaults.standard.value(forKey: "show_transaction_result") as? Bool ?? true
actionURL += "&show_transaction_result=\(showResult)"
return actionURL
}
//USE LIKE THIS
let UnreferencedRefundRequestStringURL: String = createUnreferencedRefundRequest(refundAmount: 5, reference: "123456789")
(UIApplication.shared.delegate as? AppDelegate)?.performInterAppRequest(request: UnreferencedRefundRequestStringURL)
The above information elements must create a URI call. i.e.
Request example
Request sample:vivapayclient://pay/v1?callback=interapp-callback&appId=com.vivawallet.InterAppDemo&action=unreferenced_refund&amount=600&show_receipt=false
Request sample for merchants registered in Greece(including AADE parameters):vivapayclient://pay/v1?callback=interapp-callback&appId=com.vivawallet.InterAppDemo&action=unreferenced_refund&amount=600&show_receipt=false&aadeProviderId=999&aadeProviderSignatureData=AD33729F4ED749928AAFA00B90EE4EA91551BAC1;;20231204080313;1051;10000;2400;12400;POS_1&aadeProviderSignature=o0094r3Yk3KTqASLkW3evlDsnIg/ZAdUUf6UCXDtjqpI/dquzAT4WNX3yzS/GLciVNbT75H4pj8hLOV0EpHtzw==
Unreferenced Refund response
After executing an Unreferenced Refund transaction, the ‘Viva.com Terminal’ application responds with an Unreferenced Refund response result to indicate if the refund has been approved or not.
The result is received as a URI in the callback activity.
The table below summarises the contents of an approved response:
Field | Description | Example |
---|---|---|
callback | The URI callback that will handle the result. | 'interapp-callback://result' |
status | The status of the transaction. | 'success' |
message | A string containing information about the transaction status. | 'Transaction successful' |
action | Unreferenced refund transaction. | 'unreferenced_refund' |
amount | The amount in cents without any decimal digits. | '1200' = 12 euro |
cardType | The card type. | 'Debit Mastercard' |
accountNumber | The card number. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars. | '537489******1831' |
orderCode | The order code. | '1091159196000136' |
shortOrderCode | The order code in short format. | '1091159196' |
tid | A 12 character string indicating the terminal's TID number. | '16016684' |
transactionDate | The transaction date in ISO 8601 format. | '2021-03-30T00:00:00.000+0300' |
transactionId | A unique identifier for the transaction. | 'a78e045c-49c3-4743-9071-f1e0ed71810c' |
aadeTransactionId | An AADE-specific transaction ID. Format: Acquirer Unique code + RRN + Authorization code. Example: ‘116’ + ‘123456833121’ + ‘690882’ = '116123456833121690882' |
'116123456833121690882' |
Examples
A Cancel/Refund response result for an approved transaction looks as follows:
interapp-callback://result?status=success&message=Transaction%2520successful&action=unreferenced_refund&accountNumber=537489******1831&amount=500&cardType=Debit%2520Mastercard&orderCode=1092156115000136&shortOrderCode=1092156115& referenceNumber=30378&rrn=109212030376&tid=16000136&tipAmount=0&transactionDate=2021-04-02T15%253A18%253A51.416+0300&transactionId=063c17d5-f5f5-4ee3-8524-6dbb0d09ebeb
A Cancel/Refund response result for an approved transaction using AADE parameters looks as follows looks as follows:
interapp-callback://result?status=success&message=Transaction%2520successful&action=unreferenced_refund&accountNumber=537489******1831&amount=500&cardType=Debit%2520Mastercard&orderCode=1092156115000136&shortOrderCode=1092156115& referenceNumber=30378&rrn=109212030376&tid=16000136&tipAmount=0&transactionDate=2021-04-02T15%253A18%253A51.416+0300&transactionId=063c17d5-f5f5-4ee3-8524-6dbb0d09ebeb&aadeTransactionId=116407412859062859062
It is expected that certain transactions will fail for various reasons. A Cancel response result for a failed transaction looks as follows:
interapp-callback://result?status=failure&message=Transaction%2520declined&action=unreferenced_refund&accountNumber=537489******1831&amount=159&cardType=Debit%2520Mastercard&orderCode=1092156114000136&shortOrderCode=1092156114&rrn= 109212030372&tid=16000136&tipAmount=0&transactionDate=2021-04-02T15%253A12%253A16.068+0300
The structure of the message is the same as in the case of an approved transaction.
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!