Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
stylenone

...

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

  2. This should affect delivery orders only.

Identify Payment Methods as Online or Physical Payment

...

  1. .

...

Frontend: Add onlinePayment at Payment Method Interface

  1. Add a new property called onlinePayment at this interface

  2. Update the constants that implement this interface adding the onlinePayment method here, the configuration should be:

...

const

...

onlinePayment value

...

PAYPAL_PAYMENT_METHOD_PLACEHOLDER

...

true

...

...

true

...

SODEXO_VOUCHER_PAYMENT_METHOD_PLACEHOLDER

...

false

...

CHEQUE_GOURMET_VOUCHER_PAYMENT_METHOD_PLACEHOLDER

...

false

...

SODEXO_PAYMENT_METHOD_PLACEHOLDER

...

true

...

CHEQUE_GOURMET_PAYMENT_METHOD_PLACEHOLDER

...

true

...

PAYMENT_ON_DELIVERY_CARD_PAYMENT_METHOD_PLACEHOLDER

...

false

...

BIZUM_PAYMENT_METHOD_PLACEHOLDER

...

true

...

WAYLET_PAYMENT_METHOD_PLACEHOLDER

...

true

  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)

Creating Editable Configurations

Note

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.

...

Code Block
{
  "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

    Status
    colourBlue
    titleReady for dev


Rules Implementation

  1. Rule 1 - First Order Physical Payment Limit

    Status
    colourBlue
    titleReady for dev

  2. Rule 2 - Physical Payment Amount Limit

    Status
    colourBlue
    titleReady for dev

  3. Rule 3 - Repeated Delivery Failure Limitation

    Status
    colourRed
    titleBLOCKED