Pre-auth request
An overview of the Pre-auth request message for Android.
Overview
👉 The Pre-auth request is used to initiate a pre-authorisation transaction.
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.
- Pre-auth request originating from the client app to initiate a request for a new Pre-auth transaction
- Pre-auth response originating from the ‘viva.com | Terminal’ application to return the result of a Pre-auth transaction
If you wish to activate preAuth functionality in your terminals, please contact your Viva sales representative.
Pre-auth request
For a typical Pre-auth request, the client app must provide the following information:
Please note: ISV parameters are not included, as pre-authorizations are not supported for card-present payments using the ISV schema
[*] These parameters are only applicable in Greece
The above parameters must be used to create a URI call. Please see the below example:
Intent payIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(
"vivapayclient://pay/v1"
+ "?merchantKey="MY_MERCHANT_KEY""
+ "&appId=com.example.myapp"
+ "&action=pre_auth"
+ "&clientTransactionId=1234567801234"
+ "&amount=1200"
+ "&show_receipt="+true
+ "&show_transaction_result="+true
+ "&show_rating="+true
+ "&aadeProviderId=999"
+ "&aadeProviderSignatureData=AD33729F4ED749928AAFA00B90EE4EA91551BAC1;;20231204080313;1051;10000;2400;12400;POS_1"
+ "&aadeProviderSignature=o0094r3Yk3KTqASLkW3evlDsnIg/ZAdUUf6UCXDtjqpI/dquzAT4WNX3yzS/GLciVNbT75H4pj8hLOV0EpHtzw=="
+ "&callback=mycallbackscheme://result"));
payIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
startActivity(payIntent);
Pre-auth response
After executing a Pre-auth transaction the ‘viva.com | Terminal’ application responds with a Pre-auth response result to indicate if the transaction 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' | |
status | The status of the transaction. | 'success' | |
message | A string containing information about the transaction status. | 'Transaction successful' | |
action | Pre-auth transaction. | 'pre_auth' | |
clientTransactionId | The client transaction ID. | '12345678901234567890123456789012' | |
amount | The amount in cents without any decimal digits. If action is cancel and amount is not empty must be integer and bigger than zero. (Used in successful and declined receipts) |
'1200' = 12 euro | |
verificationMethod | The verification method used. | 'CHIP-PIN' | |
rrn | The Retrieval Reference Number of the transaction RRN. (Used in successful and declined receipts) |
'123456833121' | |
cardType | The card type. | 'VISA' | |
accountNumber | The card number masked. Note that only the 6 first and the 4 last digits are provided. All other digits are masked with stars. (Used in successful and declined receipts) |
'479275\*\*\*\*\*\*9999' | |
referenceNumber | A 6-digit number indicating the transaction's STAN number. | '833121' | |
authorisationCode | A 6-digit number indicating the transaction's Authorisation code provided by the host. | '690882' | |
tid | A 12 character string indicating the terminal's TID number. | ' 16016684' | |
orderCode | The order code. | ' 9256110059000200' | |
shortOrderCode | 10-digit integer. | '1234567890' | |
transactionDate | The transaction date in ISO 8601 format. (Used in successful and declined receipts) |
'2019-09-13T12:14:19.8703452+03:00' | |
transactionId | A unique identifier for the transaction. | 'a78e045c-49c3-4743-9071-f1e0ed71810c' | |
aid | A string indicating the AID of the card. (Used in successful receipts) |
'A000000003101001' | |
vatNumber | The VAT number of merchant. (if print VAT is enabled in the 'viva.com | Terminal' application settings) (Used in successful and declined receipts) |
'123412341' | |
address | The address of merchant (if print address is enabled in the 'viva.com | Terminal' application settings) (Used in successful receipts) |
‘Main St 123, 12312 Anytown’ | |
businessDescription | Merchant’s Business/Trade/Store name (depending on what option is selected in the 'viva.com | Terminal' application settings), (Used in successful receipts) |
'Wonka Industries' | |
printLogoOnMerchantReceipt | A boolean indicating weather the VivaWallet logo should be printed on merchant receipt. (Used in successful receipts) |
'false' | |
merchantReceiptPAN | This field contains the value of the PAN (and additional clipping) that should be printed in merchant receipt. If is empty, then apply the default clipping. (Used in successful receipts) |
'629914XXXXXXXXX6770' | |
cardholderReceiptPAN | This field contains the value of the PAN (and additional clipping) that should be printed in customer receipt. If is empty, then apply the default clipping. | '629914XXXXXXXXX6770' | |
transactionReceiptAcquirerZone | If it is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | |
cardholderReceiptText | If is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | |
merchantReceiptText | If is not empty then this value should be printed at the end of the customer receipt. (Used in successful receipts) |
'qwerty123456' | |
cardholderName | Name of the cardholder. (Used in successful receipts) |
'JOHN DOE' | |
cardExpirationDate | Expiration date of the card (YYMM). (Used in successful receipts) |
'2212' | |
cardholderNameExpirationDateFlags | Each char may be 0 (false) or 1 (true) and indicates if the cardholder name and the expiration date should be printed on the merchant/cardholder receipts) 1st char: if 1 then the Cardholder Name should be printed in the merchant's receipt. If 0, then it should not. 2nd char: if 1 then the Cardholder Name should be printed in the cardholder's receipt. If 0, then it should not. 3rd char: if 1 then the Expiration Date should be printed in the merchant's receipt. If 0, then it should not. 4rd char: if 1 then the Expiration Date should be printed in the cardholder's receipt. If 0, then it should not. (Used in successful receipts) |
'1010' | |
needsSignature | A boolean indicating if the receipt needs a signature section. (Used in successful receipts) |
false | |
addQRCode | A boolean indicating if the order code should be printed as a QR. (Used in successful receipts) |
false | |
terminalSerialNumber | The serial number of the terminal. (Used in successful receipts) |
“1234567891“ | |
currency | The currency of the transaction. (Used in successful receipts) |
“EUR“ | |
errorText | Text to print on the receipt stating the error description and the error ccode. (Used in declined receipts) |
“Transaction failed - Z-3“ | |
applicationVersion | The version off the application. (Used in declined receipts) |
'v3.7.0(1956)' | |
oldBalance | The old balance of the cardholder. (Used in successful receipts) |
'200' = 2 euro | |
newBalance | The new balance of the cardholder. (Used in successful receipts) |
'200' = 2 euro | |
entryMode | Indicates the method used for PAN entry to initiate a transaction. You may find all the POS Entry Modes here. | '07' | |
aadeTransactionId | An AADE-specific transaction ID. Format: Acquirer Unique code + RRN + Authorization code. Example: ‘116’ + ‘123456833121’ + ‘690882’ = '116123456833121690882' |
'116123456833121690882' |
A Pre-auth response result for an approved transaction looks as follows:
mycallbackscheme://result?status=success&message=Transaction successful&action=pre_auth&amount=10&verificationMethod=CONTACTLESS - NONE&rrn=235313357087&cardType=VISA TEST&referenceNumber=357087&accountNumber=405106******0178&authorisationCode=000445&tid=16022145&orderCode=2353151181022145&transactionDate=2022-12-19T15:53:46.1130595+02:00&transactionId=b709ea4c-ed2a-48f1-881c-6a6ca624076a&shortOrderCode=2353151181&aid=A0000000031010&vatNumber=EL096019265&address=kifisias 10, 12342 Athens&businessDescription=AGROTIKOS SYNETAIRISMOS MESOLOGGIOU NAUPAKTIAS I ENOSI&printLogoOnMerchantReceipt=false&cardholderNameExpirationDateFlags=0000&needsSignature=false&addQRCode=false&terminalSerialNumber=1490355478¤cy=EUR&applicationVersion=v4.11.0(4800)&entryMode=07
A sale response for a successful pre-auth transaction using AADE parameters looks as follows:
mycallbackscheme://result?status=success&message=Transaction successful&action=pre_auth&amount=10&verificationMethod=CONTACTLESS&rrn=235313357087&cardType=MASTERCARD&referenceNumber=357087&accountNumber=405106******0178&authorisationCode=000445&tid=16022145&orderCode=2353151181022145&transactionDate=2024-02-19T15:53:46.1130595+02:00&transactionId=b709ea4c-ed2a-48f1-881c-6a6ca624076a&shortOrderCode=2353151181&aadeTransactionId=116407412859078859078
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!