Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • With cash limitation data, the WL-App can validate if some rule is active and if it needs to hide physical payments;, following the order:

    • Verify if it is the user's first purchase in “home delivery” mode. To do this, perform a query using useGetUserOrdersQuery, which will return a counter indicating the number of orders in this service mode. If the counter is zero, validate if the purchase amount exceeds the maximum allowed value.

    • In the next rule, you should check if the user's last “home delivery” order was canceled. If it was canceled for any of the reasons mentioned above and the payment was made physically, this will constitute a violation of this rule, resulting in a change to the available payment methods.

  • This control is by each user;

    • At the moment of payment, the WL-app retrieves information about the user's most recent delivery order using the getUserOrders function. This includes restaurant details and any applicable limitation rules. Based on this information, we need to implement logic that hides the physical payment option if any limitation is met.

      For example, if it is the user's first home delivery purchase, which we can determine if the getUserOrders query returns zero orders of this type, and the selected restaurant has a rule that the first purchase must not exceed $30.00 (as specified by the restaurant's information from Sanity), then the WL-app can check the current order value on this screen. If the order total cents exceeds the limit, the WL-app will hide the physical payment options.

      With all these details, the WL-app can effectively decide whether to display or hide the physical payment option.

...