Integration Guidance: 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 and CaptureState 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 the QueryTransactionsSummary or QueryTransactionsDetail operation provided by the Transaction Management Service (TMS) API to retrieve the transactionId using OrderNumber (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 of CaptureState.

For more information about the TransactionState enumeration, refer to the following CommerceDocs resources:

 


 

TransactionState: ErrorValidation

CWS is unable to properly validate the transaction request message. The TransactionState is set to "ErrorValidation".

Figure 4: ErrorValidation

  1. Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
  2. 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".
  3. CWS sends a response message to the client application containing the transactionId and the TransactionState 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.

 


 

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".

Figure 5: ErrorConnecting

  1. Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
  2. The authorization request is received by CWS, the message is validated, and the TransactionState is set to "InProcess".
  3. 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".
  4. CWS reports an error to the client application containing the transactionId and the TransactionState of "ErrorConnecting".

Resolution

  • Resubmit the transaction request. Performing an Undo on the transaction is not necessary.

 


 

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".

Figure 6: ErrorUnknown

  1. Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
  2. The authorization request is received by CWS, the message is validated, and the TransactionState is set to "InProcess".
  3. CWS routes the transaction to the service provider for processing.
  4. 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.
  5. CWS updates the TransactionState to "ErrorUnknown".
  6. CWS sends a response message to the client application containing the transactionId and the TransactionState 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, the TransactionState is updated to "Undone".
  • Once successful, the client application can send a new request for processing.

Note: The client application is not required to resolve error states on Undo operations. The Undo operation can be called as many times as necessary until a successful transaction response has been received.

 


 

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.

Figure 7: No Response Received from CWS

  1. Client application sends an authorization request message to the Transaction Processing Service (TPS) endpoint.
  2. The authorization request is received by CWS, the message is validated, and the TransactionState is set to "InProcess".
  3. CWS routes the transaction to the service provider for processing.
  4. If processing is successful, the service provider sends a response message to CWS.
  5. The response is received by CWS and the TransactionState is updated from "InProcess" to the appropriate TransactionState (Authorized, ErrorUnknown, etc).
  6. 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

Note: Depending on the TransactionState returned by the RequestTransaction operation, additional troubleshooting may be necessary to resolve the error condition.

Comments