Sobes.tech
Middle

Case: How to ensure the possibility of receiving an order at a pickup point via QR code when there is no internet, and the QR code is valid for 3 hours?

sobes.tech AI

Answer from AI

To enable the possibility of receiving an order at the pickup point (PВЗ) via QR code without internet access, considering that the QR code is valid for 3 hours, the following approach can be implemented:

  1. When creating an order on the server, a unique QR code is generated with information about the order and its validity period (3 hours).
  2. The QR code and related data are cached locally on the PВЗ device or on the dispensing terminal.
  3. When scanning the QR code offline, the device compares the code with the local cache and checks the expiration time.
  4. If the code is valid and not expired, the order is issued without contacting the server.
  5. When internet access is restored, the device synchronizes data with the server, updating the cache and order statuses.

Thus, autonomous operation of the PВЗ is ensured for 3 hours, which corresponds to the QR code's lifespan, and dependence on a constant internet connection is minimized.