...
We should identify on both Frontend (WhitelabelApp) and in the backend (Payment Service). The main implementation and first barrier should be the frontend (hidding the Physical Payments from the payment methods dropdown). In other hand, the backend should grant that, even somehow the Frontend allow the Physical Payment, it will be blocked.
Frontend: Add onlinePayment at Payment Method Interface
Add a new property called onlinePayment at this interface
Update the constants that implement this interface adding the onlinePayment method here, the configuration should be:
const | onlinePayment value |
---|---|
PAYPAL_PAYMENT_METHOD_PLACEHOLDER | true |
BLIK_PAYMENT_METHOD_PLACEHOLDER | 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 |
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)
Rule 1 - First Order Physical Payment Limit
...
We already have a cash payment limit, but it’s only for cash. We should extend this create a new flag to all Physical Payments and verify before we show the payment methods dropdown to our customer, removing all physical payment. To achieve that we should not change the current implementation but implement our own.
Create feature flag for this limit
Evaluate when creating iPaymetMethodsPaymetMethods
Rule 3 - Repeated Delivery Failure
...