How to build: cart and checkout โ
implemented Front-facing /:base/cart/:slug. No login.
Default payment_processor on faruq is cash (plus providers from menu extra_data.menu_checkout_payments_providers). Guest email/phone stay in session/local storage.
Logic: Submit order.
Middleware Backend ยท winnerimplemented
Call this API
POST https://middleware-dev.nellalink.com/plugins/nellalink/nellalink-init/order
Request (faruq InformationModal)
{
"menu_uuid": "{menuUuid}",
"amount": 5000,
"payment_processor": "cash",
"customer_email_address": "guest@example.com",
"customer_phone_number": "07031234567",
"customer_requested_order_email_copy": false,
"general_note": "",
"delivery_data": {
"delivery_identifier": "No Title",
"delivery_address": ""
},
"onpremise_data": {
"customer_onpremise_location_type": "",
"customer_onpremise_location_number": "",
"customer_onpremise_location": "_"
},
"cart_items": [
{ "uuid": "{itemUuid}", "quantity": 1, "item_note": "" }
]
}customer_onpremise_location on faruq is `${location}_${location_number}` (empty fields become "_"). Contact lives in sessionStorage (order-payload); confirmed orders in localStorage.
Respect item minimum_quantity_per_order / maximum_quantity_per_order before POST.
Middleware Joi accepts paystack | bank_transfer | cash (default cash). Explorer swagger comments still omit cash. faruq default is cash. Limitations.
Then navigate to order confirmation. Processor: Place order.