Table of Contents | ||
---|---|---|
|
...
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 } } } } |
Rules Implementation
...
...
...
For subsequent orders with a value >= X €, only online payment will be allowed, where X is configurable. The initial intention is to set it to 50 euros.
Solution:
We already have a cash payment limit, but it’s only for cash. We should create a new flag to all Physical Payments and verify before we show the payment methods dropdown to our customer, removing all physical payment.
Create feature flag for this limit
Evaluate when creating PaymetMethods
...
Status colour Blue title Ready for dev Rule 2 - Physical Payment Amount Limit
Status colour
...
If the last order was paid in Physical Payments and there was a delivery failure (e.g. a joke order), the next order will only allow online payment
The tablet expeditor app has some order cancellations actions, these actions are sent through Delivery Events API but they are not stored in any of our databases.
We believe this ticket can potentially unblock us, to get the correct reason a delivery have failed:
, it’s currently at “To Do” statusJira Legacy server System Jira serverId 255417eb-03fa-3e2f-a6ba-05d325fec50d key IREQ-1123
Once we have the correct reason of order or delivery cancelations stored in the backend we’ll be able to identify, in the cash limitations methods, if the last delivery failed for some of the reasons we want and remove Physical Payments.
To dos:
Get together the cancelation reasons we want to consider for this rule
Create the feature flag for this rule
Implement on Cash Limitations check this rule
Blue title
...
Ready for dev Rule 3 - Repeated Delivery Failure Limitation
Status colour Red title BLOCKED