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 repeated. It does not say anything 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 state you receive is FINISHED (currently values 6,7 and 8), you can consider the request as finished. In case of COMPLETED (state 6), you should start calling the transaction details query to get the transaction result, 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 the transaction with the same transactionId value, see Step 2: Request a transaction, and you must generate a new transactionId, see Step 1: Register a transaction.
- If the status returns IN_PROGRESS, you must wait for the transaction to complete, i.e. ask again in 500 ms.
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 was successfully processed, status=8 means that the transaction is in the "error" state, code=43 gives a detailed error why it ended with a task error, according to the documentation here, the value "isRepeatable=false" means that you cannot call TransactionRequestV2 again with the same TransactionID value.
