Check Transaction Status
You can check the status of a payment or refund transaction using the IPCGetTransactionStatus method. This is helpful for confirming if a transaction was completed, failed, or is still pending.
How It Works
The method allows you to:
- Choose the transaction type:
PurchaseorRefund - Specify the Order ID associated with the transaction
- Retrieve the following:
- Transaction status
- Transaction reference
- Order ID
- Transaction type
Implementation Example
IPCGetTransactionStatus ipcGetTransactionStatus = new IPCGetTransactionStatus();
ipcGetTransactionStatus.setOrderId(orderId);
ipcGetTransactionStatus.setTxtType(txnType);
ipcGetTransactionStatus.setOnCommandCompleteListener(new IPCGetTransactionStatus.OnCommandCompleteListener() {
@Override
public void onCommandComplete(final int transactionStatus, final String
transactionReference) {
}
@Override
public void onError(final int status) {
}
});
ipcGetTransactionStatus.sendRequest();
Make sure that txnType is set to either MyPos.TRANSACTION_TYPE_PURCHASE or MyPos.TRANSACTION_TYPE_REFUND.
Use Cases
- Confirming if a payment was processed successfully
- Verifying whether a refund was issued
- Resolving failed or unknown transaction states
- Automating transaction status checks in batch processing or background tasks