# Bank transfer / الإيداع البنكي

Method ID: `2`. Payment type: `2`. 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 | 2: manual bank/reference flow. |
| account_number | Merchant bank account shown to the customer. |
| company_name_arabic / company_name_english | Bank/company labels where configured. |
| description_arabic / description_english | Deposit instructions. |
| status / active | Enabled row convention: status=1 and active=0. |


## Required customer fields

| Field | Requirement | Meaning |
| --- | --- | --- |
| payment_id | Required | Select the configured bank row; the archived default is ID 2. |
| transfer_number | Optional at initial creation; required when submitting/changing payment details | Deposit reference/depositor text. The UI label is not a separate field. |
| transaction_image / transfare_attach_file | Optional backend multipart upload | Receipt image aliases. The inspected Flutter OrderVM does not expose this upload. |


## Payment flow

1. Display the configured bank/account/instructions; the actual deposit is performed outside this application.
2. Create the order with payment_id=2 and any available transfer_number; creation initializes payment_status=1.
3. Submit the reference to add_payment_info for the existing eligible order. The backend requires nonempty transfer_number and changes the payment state to 2 (awaiting confirmation).
4. Operations must verify the deposit before treating it as confirmed (status 3). This is a manual confirmation boundary; no bank API verifies the submitted reference.

## 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": 2,
  "transfer_number": "<DEPOSIT_OR_REMITTANCE_REFERENCE>"
}
```

### Submit/change details

```json
{
  "order_id": "<ORDER_ID>",
  "payment_id": 2,
  "transfer_number": "<DEPOSIT_OR_REMITTANCE_REFERENCE>"
}
```

## 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": 2,
    "order_payment_type": 2,
    "order_payment_status": 1
  }
}
```

After accepted reference submission, reloading the order should show `order_payment_status=2`. A manual verifier must establish actual receipt before status 3. Missing reference/company on the update path yields a business error.

### Failure

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

## Confirmation and cancellation limits

There is no bank-gateway base URL, OAuth configuration or raw provider response in this flow. An account_number is a displayed destination, not an API URL. Database rows can configure additional banks using type=2; do not hard-code every bank to ID 2.

`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:806](</Users/ayman/Documents/Old Mac Data/Downloads/yemensnackfood/connect/v1/contains-orders/add_order.php:806>)

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

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

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

- 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>)
