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
TransactionState
is 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
TransactionState
of “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
TransactionState
of “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
transactionId
will 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
TransactionState
andCaptureState
of each transaction. - During transaction authorization, be sure to set a unique
OrderNumber
for 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
transactionId
and Transaction State. In these cases, the client application must call theQueryTransactionsSummary
orQueryTransactionsDetail
operation provided by the Transaction Management Service (TMS) API to retrieve thetransactionId
usingOrderNumber
(or other available query parameters) from the request. - Transactions returned with a
TransactionState
of “ErrorUnknown” must be resolved immediately by the client application. - The
QueryBatch
operation 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
TransactionState
is set to “ErrorValidation”. - CWS sends a response message to the client application containing the
transactionId
and theTransactionState
of “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
TransactionState
is 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
TransactionState
is updated to “ErrorConnecting”. - CWS reports an error to the client application containing the
transactionId
and theTransactionState
of “ErrorConnecting”.
Resolution
- Resubmit the transaction request. Performing an
Undo
on 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
TransactionState
is 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
TransactionState
is updated to “ErrorConnecting”. - CWS reports an error to the client application containing the
transactionId
and theTransactionState
of “ErrorConnecting”.
Resolution
- Resubmit the transaction request. Performing an
Undo
on 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
TransactionState
is 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
TransactionState
to “ErrorUnknown”. - CWS sends a response message to the client application containing the
transactionId
and theTransactionState
of “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
Undo
on the previously authorized or returned transaction. Upon receipt of a successful response message by the client application, theTransactionState
is 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
TransactionState
is 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
TransactionState
is 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
OrderNumber
parameter assigned during authorization to retrieve thetransactionId
and associatedTransactionState
as part of the response message.
TransactionState
returned by the RequestTransaction
operation, additional troubleshooting may be necessary to resolve the error condition.