Get Last Transaction
Get Last Transaction
The get last transaction action can be run by calling the getLastTransaction method.
getLastTransaction
suspend fun getLastTransaction( <br> getLastTransactionData: GetLastTransactionData, operationListener: OperationListener <br> )
The getLastTransaction method takes an instance of GetLastTransactionData as an argument and an operationListener, which will propagate the operation outcome to the caller application.
GetLastTransactionData
data class GetLastTransactionData( val callerName: String?, <br> val terminalId: String?, <br> val callerTrxId: String? <br>
OperationListener
interface OperationListener { <br> fun onSuccess(response: A2ASDKResponse? = null) <br> fun onFailure(error: A2ASDKResponse? = null)
GetLastTransactionData
The GetLastTransactionData class is used for holding information related to the getLastTransaction operation. Class properties are detailed below:
Name parameter | Description | Type | Mandatory |
---|---|---|---|
callerName | Represents the name of the caller app | String | yes |
terminalId | Represents the merchant terminal ID | String | yes |
callerTrxId | Represents the transaction ID associated with the caller | String | yes |
The last transaction related to the given terminalId will be returned by back deeplink, containing all receipt parameters. The parameters will be returned through receipt field keys (documented in app2app specifications > SoftPOS Android > Receipt Field Keys) for both MPOS and SOFTPOS transactions.
Moreover, to maintain the same signature of payment and reversal operations, the amount field is also returned via deeplink, valued with the same content of f30 receipt field.
Coherently with transaction result, the result key will contain 0 in case of success call. In case of missing receipt error, the result key will contain the value -41.
Back Deeplink Example
demonexi://last_transaction?operationType=LAST_TRANSACTION&callerTrxId=123123&result=0&amount =000000025200&terminalType=SOFTPOS&f30=25200&f32=09517&F42=8994712%20%20%20%20%20%20 %20%20&f53=01014&f12=172617&f11=000344&CT121=VIA%20CARLO%20CATTANEO%207%2C%2087100 %2C%20COSENZA%20(CS)&ABI=38937&CT120=STUDIO%20MEDICO%20DR%20ROMANO&f38=401531&9F 14=1100&f37=430517222236&f39=000&CT118=978&CT117=Online&CT116=00034&CT115=Contactless&C T114=NEXI%20Core&CT112=************7937&CT111=2&acquirerId=909517&CT119=Grazie%20e%20arr ivederci&CURRENCY=EUR&f41=97943348&f43=STUDIO%20MEDICO%20DR%20ROMANO%20VIA%20CARL O%20CATTANEO%207%2C%2087100%2C%20COSENZA%20(CS)&f42=8994712%20%20%20%20%20%20%2 0%20&CT110=2024-10- 31T17%3A27%3A07%2B01%3A00&f03=000000&f02=516795******7937&f49=978&f04=000000025200&f 28=241031&CT107=17%3A26&CT106=31%2F10%2F2024&CT105=ACQUISTO&CT104=STUDIO%20MEDICO %20DR%20ROMANO%20VIA%20CARLO%20CATTANEO%207%2C%2087100%2C%20COSENZA%20(CS)&CT1 03=430517222236&CT102=A0000000041010&CT123=***&CT101=46&CT100=7937&PROVINCE=PALERMO &CT109=Debit%20Mastercard&CT108=Mastercard&autoClose=false