> ## 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 will automatically fall back to this mechanism, ensuring that transactions are completed successfully or canceled through retries and verification steps to prevent inconsistencies.

## How it Works

The flow chart describes the flow of the mechanism.

<Frame>
  <img src="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" alt="" width="1497" height="1244" data-path="images/docs/resilience-mechanism-copy/image1.png" />
</Frame>

When a transaction requires completion (settlement) or cancellation, and the system verifies whether a response has been received, the flow can vary depending on the reaction.

* If a response was received, the system proceeds to check the `StatusCode`. If it is equal to `0`, it will finish the completion process, else it will trigger the retry mechanism.
* If no response is received, the system retrieves transaction details using the `getTransactionByVuid()` method.
  * To check if the transaction is finalized, the system evaluates if `IsFinalAmount=1` and `TransactionDeposited=1/2`.
  * If they are not equal to those values, the system triggers the retry mechanism.

The process continuously loops back to the start of the Completion/Cancel flow, ensuring that it continues until a definitive success or failure condition is reached.

## See Also

<Columns cols={2}>
  <Card icon="link" title="Payment Flows" href="/docs/integrate-pos-device/tweezercomm/global-payment-flows/payment-flows-copy-1" arrow />

  <Card icon="link" title="GetTransactionByVuid" href="/docs/integrate-pos-device/tweezercomm/global-payment-methods/gettransactionbyvuid" arrow />
</Columns>
