Checking transaction status

  • Updated

 

A transaction status request retrieves the outcome of a previous transaction. Its main use is recovery: if your app lost connection or restarted mid-payment and never saw the response, a status request tells you what actually happened so you don't double-charge or leave a sale in limbo. 

Prerequisite: a live session.


The call

viewModelScope.launch {
    clientSDK.sendTransactionStatusRequest(
        RetailerMessageArguments.StatusRequestMessageArguments(
            MessageReference(messageCategory = "Payment")
        )
    )
}
  • MessageReference — identifies which message/transaction to check. The messageCategory selects the kind of operation (e.g. a payment). See the API reference for the full MessageReference fields if you need to target a specific message rather than the last one.

By default this retrieves the status of the last completed transaction in the referenced category.


Reading the result

when (message) {
    is SuccessRetailerTransactionStatusResponse -> { /* read the recovered outcome */ }
    is ErrorRetailerTransactionStatusResponse   -> { /* no matching transaction / failed */ }
    is RetailerDisplayRequest                   -> { /* progress, if any */ }
}

A successful status response carries the original transaction's result, including its POITransactionID — which makes a status request a way to recover a POI transaction ID you need for a reversal but didn't store. See Guide: reversing a transaction.


When to use it

  • After a lost connection during a payment — confirm whether the payment went through before retrying.
  • After your app restarted mid-transaction — recover the outcome you missed.
  • To retrieve a POITransactionID for a reversal when you didn't capture it at payment time.

For routine payments where you received the response normally, you don't need a status request — you already have the outcome.


Related

  • Guide: taking a payment — the transaction whose status you check.
  • Guide: reversing a transaction — uses the POITransactionID a status request can recover.
  • Session and login lifecycle — the lost-connection scenarios that make status checks necessary.
  • API reference (sdk-doc.zip) — full MessageReference fields.

Was this article helpful?

0 out of 0 found this helpful