Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 14 Next »

Considerations

  1. Platform wide change, this should work on every market;

  2. This should affect delivery orders only.

Creating Editable Configurations

Alternative check sanity payment method sort feature, having this map in LD or Sanity we can retrieve in the backend to add extra layer

Sanity Option

We can create a new field on Sanity that will map the available payment methods with the flag TRUE or FALSE for isOnlinePayment question.

Prós: Sanity fits better to hold a remote configuration, possible to retrieve this config in the backend

Cons: Strange memory cache and/or CDN cache, not reliable to replicate configs in real time

Feature Flag Option

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

Pros: Good place to serve realtime configuration/variations

Cons: Not the correct place to hold configurations, this is more like a remote config then a Feature Flag.

Feature Flag creation (suggestion):

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:

{
  "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
    }
  }
}

Variation option to consider payment methods

In case we need to map the physical payment methods in a configurable way

{
  "payment_methods": {
    "cash": false,
    "cc": true,
    "debit_online": true
  },
  "rules": {
    "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
      }
    }
  }
}

Frontend Preparation

  1. Frontend Preparation Changes READY FOR DEV


Rules Implementation

  1. Rule 1 - First Order Physical Payment Limit READY FOR DEV

  2. Rule 2 - Physical Payment Amount Limit READY FOR DEV

  3. Rule 3 - Repeated Delivery Failure Limitation BLOCKED

Backend Restrictions

  1. Possible Future Improvements

  • No labels