Commerce Web Services
Transaction Reporting – Payments Status Messaging
There are situations when a merchant may need to perform specific error resolution steps based on the TransactionState of a transaction.
Consider the following transaction management guidelines associated with the resolution of TransactionState error conditions:
- TransactionState: ErrorValidation – CWS is unable to properly validate the transaction request message. The
TransactionStateis set to “ErrorValidation”. - TransactionState: ErrorConnecting – A communication issue prevents the validated transaction request message to be sent to the service provider for processing, resulting in a
TransactionStateof “ErrorConnecting”. - TransactionState: ErrorUnknown – A communication issue prevents CWS from receiving the transaction response message from the service provider. As a result, CWS is unable to determine the status of the transaction. The response ultimately returned to the client application indicates a
TransactionStateof “ErrorUnknown”. - No Response Received from CWS – A communication issue prevents the client application from receiving the response message from CWS. As a result, the application is unable to determine the
TransactionState.
Best Practices
- Regardless of whether the transaction request was successful or an error condition occurred, the
transactionIdwill always be returned in the response message to the client application where it can be used for subsequent transactions related to the original transaction. - All transaction responses returned by CWS include the
TransactionStateandCaptureStateof each transaction. - During transaction authorization, be sure to set a unique
OrderNumberfor the transaction. This ensures fast and convenient recovery in the event of communication failures. - In the event that no response is received from CWS, the application must query the transaction database for the appropriate
transactionIdand Transaction State. In these cases, the client application must call theQueryTransactionsSummaryorQueryTransactionsDetailoperation provided by the Transaction Management Service (TMS) API to retrieve thetransactionIdusingOrderNumber(or other available query parameters) from the request. - Transactions returned with a
TransactionStateof “ErrorUnknown” must be resolved immediately by the client application. - The
QueryBatchoperation will return all transactions matching the specified filter criteria regardless ofCaptureState.
For more information about the TransactionState enumeration, refer to the following CommerceDocs resources:
- Understanding Transaction States
- BankcardTransaction Enumeration Reference in the CWS Developer API Reference.
- QueryTransactionsParameters and TransactionInformation objects in the Transaction Management Developer’s Guide.
CWS is unable to properly validate the transaction request message. The TransactionState is set to “ErrorValidation”.
Error Validation Steps:
- Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
- CWS attempts to validate the transaction request message before transmitting the request to the service provider, but the validation fails. The
TransactionStateis set to “ErrorValidation”. - CWS sends a response message to the client application containing the
transactionIdand theTransactionStateof “ErrorValidation”.
Resolution
- Validation errors are typically discovered during pre-certification integration testing. It is possible that these types of errors can present themselves post-certification, typically as a result of a business rule conflict. The client application must handle the possibility of receiving transactions with a TransactionState of “ErrorValidation” by logging the condition and informing the user that they should contact their support service for further assistance.
A communication issue prevents the validated transaction request message to be sent to the service provider for processing, resulting in a TransactionState of “ErrorConnecting”.
Error Connecting Steps:
- Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
- The authorization request is received by CWS, the message is validated, and the
TransactionStateis set to “InProcess”. - CWS attempts to route the transaction to the service provider for processing, but a communication issue prevents the message from reaching the processing host. The
TransactionStateis updated to “ErrorConnecting”. - CWS reports an error to the client application containing the
transactionIdand theTransactionStateof “ErrorConnecting”.
Resolution
- Resubmit the transaction request. Performing an
Undoon the transaction is not necessary.
A communication issue prevents the validated transaction request message to be sent to the service provider for processing, resulting in a TransactionState of “ErrorConnecting”.
Error Connecting Steps:
- Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
- The authorization request is received by CWS, the message is validated, and the
TransactionStateis set to “InProcess”. - CWS attempts to route the transaction to the service provider for processing, but a communication issue prevents the message from reaching the processing host. The
TransactionStateis updated to “ErrorConnecting”. - CWS reports an error to the client application containing the
transactionIdand theTransactionStateof “ErrorConnecting”.
Resolution
- Resubmit the transaction request. Performing an
Undoon the transaction is not necessary.
A communication issue prevents CWS from receiving the transaction response message from the service provider. As a result, CWS is unable to determine the status of the transaction. The response ultimately returned to the client application indicates a TransactionState of “ErrorUnknown”.
Error Unknown Steps:
- Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
- The authorization request is received by CWS, the message is validated, and the
TransactionStateis set to “InProcess”. - CWS routes the transaction to the service provider for processing.
- Once successfully processed, the service provider attempts to return a response message to CWS but a communication issue prevents the response from reaching CWS within the configurable time period.
- CWS updates the
TransactionStateto “ErrorUnknown”. - CWS sends a response message to the client application containing the
transactionIdand theTransactionStateof “ErrorUnknown”.
The use of the Undo operation is restricted to transactions that have a TransactionState of “ErrorUnknown”, or any other valid transaction state. Performing an Undo on transactions with a TransactionState of “InProcess”, “ErrorConnecting”, or “ErrorValidation” will not be processed and an error is reported to the client application.
Resolution
- Perform an
Undoon the previously authorized or returned transaction. Upon receipt of a successful response message by the client application, theTransactionStateis updated to “Undone”. - Once successful, the client application can send a new request for processing.
Undo operations. The Undo operation can be called as many times as necessary until a successful transaction response has been received.A communication issue prevents the client application from receiving the response message from CWS. As a result, the application is unable to determine the TransactionState.
No Response Received from CWS steps:
- Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
- The authorization request is received by CWS, the message is validated, and the
TransactionStateis set to “InProcess”. - CWS routes the transaction to the service provider for processing.
- If processing is successful, the service provider sends a response message to CWS.
- The response is received by CWS and the
TransactionStateis updated from “InProcess” to the appropriateTransactionState(Authorized, ErrorUnknown, etc). - TPS attempts to send a response message to the client application, but a communication issue prevents the client application from receiving the response (which includes the
transactionId). Therefore, the application does not know the current state of the transaction.
Resolution
- Call the QueryTransactionsSummary or QueryTransactionsDetail operation and pass the
OrderNumberparameter assigned during authorization to retrieve thetransactionIdand associatedTransactionStateas part of the response message.
TransactionState returned by the RequestTransaction operation, additional troubleshooting may be necessary to resolve the error condition.