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.
- Abort request originating from the client app to abort (if possible) the last Sale request.
- Abort response originating from the card terminal app to return the result of an Abort request.
Using abort action user tries to abort a transaction he started from the third-party app. Abort will not always succeed as in some cases it is not possible to abort the transaction. For a typical abort transaction request, the client app must provide the following information:
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=abort" + "&referenceNumber=123456" + "&callback=mycallbackscheme://result")); payIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); payIntent.addFlags(Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); startActivity(payIntent);
After executing an abort transaction, the Card Terminal App responds with an abort response result to indicate if the abort request has been successful or not. Also, we should state that the response from the abort action is actually a response of a failed transaction.
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 cancel response result for an approved refund looks as follows:
It is expected that if we have not started a transaction the Abort action will respond (-55) NOTHING_TO_ABORT. A failed Abort action response looks as follows:
In some cases (when the transaction has been sent to server for approval / user selected payment with QR) the transaction cannot be aborted, and the Card Terminal app will not send the Abort response.
If you have any questions about our solutions, or questions about how to integrate with our solutions, please refer to our Get Support page.