Notice
Transaction status is an important indicator for third-party applications. It tells you what state the transaction is in and whether the transaction can be retried. It says nothing about the success/failure of the transaction.
Request [transactionId]
The TransactionId input value is generated in step 1 - Transaction registration.
void stateRequest(String transactionId, IStateResultListener listener) throws RemoteException
Response [StateResultEntity]
States
Once the status you receive is, FINISHED (currently values 6,7 and 8), you can consider the request complete. In the case of the status COMPLETED (state 6), you should start calling the transaction details query to get the result of the transaction, see „4.Getting transaction details„
- If isRepeatable == true, then you can repeat the transaction with the same transactionId value, see Step 2: Transaction Request
- If isRepeatable == false, then you cannot repeat a transaction with the same transactionId value, see Step 2: Transaction Request, and you must generate a new transactionId, see Step 1: Register the transaction.
- If the status returns IN_PROGRESS, you must wait for the transaction to complete, i.e. ask again in 500 ms for example.
If the IN_PROGRESS state is older than 5 minutes, you can process the transaction as a failure.
Example of a response to a condition:
{„created“:“2023-09-11T12:29:11.300Z“, “error“:{„code“:43, “internalErrorCode“:0, “internalErrorSubCode“:0, “platform“: “TOM_APP“}, “isRepeatable“:false, “resultCode“:0, “state“:8, “transactionId“: “d03484bc-509e-11ee-ba37-77691fde9486″, “updated“: “2023-09-11T12:30:34.337Z“}
Explanation: resultCode=0 means that the request has been processed successfully, status=8 means that the transaction is in the „error“ state, code=43 gives a detailed error why the task ended in error according to the documentation here, the value „isRepeatable=false“ means that you cannot call TransactionRequestV2 again with the same TransactionID value.
