# Cash / الدفع النقدي

Method ID: `1`. Payment type: `1`. Reviewed from archived source on 2026-10-24.

## URLs

The archived Flutter default for `APP_API_BASE` is **`https://platformdgtl.com/yemensnackfood/connect/v1/`**, set in Remote Config defaults. Fetched Remote Config can override it; this is a source default, not a verified live deployment. Trim the trailing slash when combining it with the paths below. Source: [lib/src/controllers/splash_controller.dart:234](</Users/ayman/Documents/Old Mac Data/flutter_projects/platform/yemen_snack_food/lib/src/controllers/splash_controller.dart:234>).

Provider URL: **none**. This method uses only the application API. `APP_API_BASE` comes from Firebase Remote Config key `api_url`; its resolved runtime value was not verified.

| Operation | HTTP | URL |
| --- | --- | --- |
| List | POST | `{APP_API_BASE}/payment.php?action=get_all` |
| Create | POST | `{APP_API_BASE}/orders.php?action=add_order` |
| Submit/change details | POST | `{APP_API_BASE}/orders.php?action=add_payment_info` |
| Cancel eligible order | POST | `{APP_API_BASE}/orders.php?action=cancel_order` |


## Configuration fields

Configuration is in `platform_payment_ways`; localized titles, icon and sorting follow the [common contract](00-common-contract.md).

| Field | Meaning |
| --- | --- |
| type | 1: no extra payment details. |
| status / active | Enabled row convention: status=1 and active=0. |
| title_arabic / title_english / description_* | Customer label/instructions; no merchant API credentials. |


## Required customer fields

| Field | Requirement | Meaning |
| --- | --- | --- |
| payment_id | Required | Select cash, normally ID 1. |


## Payment flow

1. Load the enabled cash row and create the order using payment_id=1.
2. Backend calculates the invoice and stores the order as unpaid (payment_status=1). No electronic adapter is called.
3. Cash collection and subsequent manual payment confirmation belong to the operational/admin flow. A successful create response does not prove cash was received.

## Request examples

These are readable representations of multipart form fields, not JSON request bodies. `items` is JSON-encoded text. IDs and references are illustrative.

### Create

```json
{
  "address_id": "<OWNED_ADDRESS_ID>",
  "delivery_time": "<DELIVERY_OPTION>",
  "items": "[{\"id\":1,\"quantity\":1}]",
  "payment_id": 1
}
```

### Submit/change details

```json
{
  "order_id": "<ORDER_ID>",
  "payment_id": 1
}
```

## Responses

There is no provider response or electronic adapter result. The application responds with the existing `status`, `message`, optional `result` envelope. Examples are partial, illustrative, and do not guarantee a result object on every successful update.

### Created unpaid order

```json
{
  "status": 0,
  "message": "<APPLICATION_MESSAGE>",
  "result": {
    "order_id": 123,
    "order_payment_id": 1,
    "order_payment_type": 1,
    "order_payment_status": 1
  }
}
```

### Failure

```json
{
  "status": 1,
  "message": "<VALIDATION_OR_ORDER_STATE_ERROR>"
}
```

## Confirmation and cancellation limits

No provider login, OTP, transaction reference or provider response exists for this path. Additional configured rows with type=1 can use the same no-detail behavior. The inspected Flutter constants identify cash as ID 1.

`SendConfirmPayment` is the electronic code-confirmation flow; do not use it to authenticate a manually submitted bank/remittance reference. Cancellation follows order eligibility rules and cannot itself reverse an external bank deposit or cash remittance.

## Source evidence

- [connect/v1/contains-orders/add_order.php:803](</Users/ayman/Documents/Old Mac Data/Downloads/yemensnackfood/connect/v1/contains-orders/add_order.php:803>)

- [connect/v1/contains-orders/add_payment_info.php:1377](</Users/ayman/Documents/Old Mac Data/Downloads/yemensnackfood/connect/v1/contains-orders/add_payment_info.php:1377>)

- Shared listing/configuration: [connect/v1/payment.php:465](</Users/ayman/Documents/Old Mac Data/Downloads/yemensnackfood/connect/v1/payment.php:465>)

- Flutter inputs: [lib/src/view/components/form_fields/payment_form_fields.dart:65](</Users/ayman/Documents/Old Mac Data/flutter_projects/platform/yemen_snack_food/lib/src/view/components/form_fields/payment_form_fields.dart:65>)
