I'm trying to wrap my head around the different fields returned from a transactionquery. I see that actionCode has many different values which can translate to different results of the transaction, but I also see there's also statusCodes COMPLETE, IN_PROGRESS, FAILED etc. My question is how do these actionCodes and statusCodes relate to each other? For example an actionCode of 00 I would imagine should never have a FAILED statusCode, similarly IN_PROGRESS I imagine should never appear with many actionCodes. Can anyone advise on how these two are related?
Please refer to the Request & Response Codes page here: https://developer.visa.com/request_response_codes#account_identifier_type_code
I have already looked at these documents but they are not sufficient. They are quite vague as to how to handle responseCodes vs actionCodes vs statusCodes. There are both old and new actionCode and responseCode. There is no real description as to how to handle any responseCode other than 5 or V which indicates success. If it is non successful it is ambiguous as to whether the transaction was declined or in progress or should be queried using the query API.
The same can be said for actionCode. It is also unclear what order of precedence these codes should be read in order to decipher next steps. Should we read response code and if it is non 5 or V, read actionCode to determine if it was successful or needs to be queried? Or should we read actionCode always to determine if transaction was successful (i.e. if response code is 5 or V read action code and check if it was successful or we need to use the query API). If this is the case why do we need the responseCode if we can figure everything out from actionCode?
Finally in the case where we need to use the query API, we now get a new value called statusCode. This adds further complications. Should we read the statusCode then responseCode then actionCode? Which code takes precedence in determining result and correct next steps (retry etc)
If you get a 2xx code (e.g. 200 OK) then the request/response payload is a success. If you get a 4xx or 5xx code then there is an error. You can refer to the Visa Developer Error Codes page here.