Versions Compared

Key

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

...

  1. Create a new method to verify if a payment type is online or not. This method should grant that cash will always be considered false regardless the configuration. (as you can see, there’s no configuration for cash in the table above, that represents the state/payment/constats.ts file)

Feature Flag

We should create a new Feature Flag on Launch Darkly with the following definitions:

Name: physical-payments-limitation

Description:
This flag enable the Physical Payment Limitation, to avoid joke/fake orders on delivery. It intends to allow online-only payments on certain conditions, the implemented rules are below (please update this description when creating new rules):

  • First Order Limit (limit_first_order) → Limit every first order of our guests in our platform, equal or greater then a given amount, to be online paid only.

  • Total Amount Limit (limit_total_amount) → Limit every order greater or equal then a given {amount} to be online paid only.

  • Last Delivery Failed (limit_last_delivery_failed) → When the previous delivery order failed, the subsequent one should be paid online only

Variation Value:

Code Block
{
  "limit_first_order": {
    "active": true,
    "amount": 20,
    "amount_in_cents": 2000
  },
  "limit_total_amount": {
    "active": true,
    "amount": 50,
    "amount_in_cents": 5000
  },
  "limit_last_delivery_failed": {
    "active": false,
    "reasons_to_limit": {
      "customer_absence": true,
      "reason2": false,
      "reason3": true
    }
  }
}

Rule 1 - First Order Physical Payment Limit

...