> ## Documentation Index
> Fetch the complete documentation index at: https://devzone.nayax.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Resilience Mechanism

TweezerComm has a resilience mechanism for handling transaction completion or cancellation in case of errors or failures. Whenever an error occurs, such as a `statusCode != 0`, TweezerComm automatically falls back to this mechanism, using retries and verification steps to complete or cancel the transaction and prevent inconsistencies.

## How it works

The flow chart describes the flow of the mechanism.

![](https://mintcdn.com/nayax-44d6e37b/SZdrogZN6xHGu-sq/images/docs/resilience-mechanism-copy/image1.png?fit=max\&auto=format\&n=SZdrogZN6xHGu-sq\&q=85\&s=a50424fa29d8f2a69f70297a58757b63)

When a transaction requires completion (settlement) or cancellation, the system checks whether it received a response, and the flow varies depending on the outcome.

* If the system receives a response, it checks the `StatusCode`. If the value equals `0`, it finishes the completion process; otherwise, it triggers the retry mechanism.
* If the system doesn't receive a response, it retrieves transaction details using the `getTransactionByVuid()` method.
  * To check whether the transaction is complete, the system evaluates whether `IsFinalAmount=1` and `TransactionDeposited=1/2`.
  * If those values don't match, the system triggers the retry mechanism.

The process loops back to the start of the Completion/Cancel flow until it reaches a definitive success or failure condition.

## See also

> [card] [Payment flows](https://devzone.nayax.com/docs/integrate-pos-device/tweezercomm/global-payment-flows/payment-flows-copy-1)
>
> See the payment flows this resilience mechanism protects.

> [card] [GetTransactionByVuid](https://devzone.nayax.com/docs/integrate-pos-device/tweezercomm/global-payment-methods/gettransactionbyvuid.md)
>
> Retrieve transaction details using the vendor-unique identifier (vuid).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.