Offline operations
This section describes how to handle the temporary loss of conectivity of a POS, and consequently, the issue that arises when a customer can't apply the benefits.
Wapping handles this allowing a totalization in which the discounts or money cards are not applied, providing the means to syncronize the operation when the connection restores, and allowing the customer to add the benefits earned with the operation.
All the services that modify the amount of the operation (discounts, gift cards, etc) won't be applied, as this operation has already been closed, and it cannot be altered.
What this will allow is for the customer to add points, cashback, earn promotions, etc, all that is configured to be earned by completing the operation.
While the customer won't be able to apply the benefits to get discounts, they will use the operation to earn more, and will be able to use it in a future operation.
This behaviour has to be known by the store cashiers, to reassure the customer in case it happens.
This is done by setting two flags in the total request to true:
"notApplyDiscounts": true,
"notApplyMoneyCardPayments": true,
When theese flags are set, the checkout will respond without any service that modifies the operation, and instead will inform and process all the benefits that the customer has to receive.
The rest of the checkout behaves as normal, both the create, total and commit.
Bear in mind that there can be two scenarios, one where the operation is already created (a wapping session id already exists) and other where the create couldn't be called.
In the first scenario the same session has to be used, calling a total with the flags set to true and then a commit will complete the order correctly.
If the create already failed for connectivity issues, the QR has to be saved temporary, so when the connection is restored the create can be called again.
The rest of the process is the same as before.
