# abolfazlabdollahii/opencart architecture

> Architecture diagram of the GitHub repository abolfazlabdollahii/opencart, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-29). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/abolfazlabdollahii/opencart
- Repository: https://github.com/abolfazlabdollahii/opencart

## Overview

This is an OpenCart Zibal payment extension. Shoppers see the payment option when its configuration and checkout constraints allow it, initiate a Zibal payment, then return for verification and order-status update. Administrators configure credentials and payment settings. The sampled code shows the admin settings save, storefront eligibility checks, payment request, fallback gateway calls, and callback verification; checkout dispatch and template interactions are inferred only where OpenCart’s extension structure supports them.

Main entry points: [`catalog/controller/payment/zibal.php`](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/controller/payment/zibal.php) (Payment Flow), [`admin/controller/payment/zibal.php`](https://github.com/abolfazlabdollahii/opencart/blob/main/admin/controller/payment/zibal.php) (Payment Settings), [`catalog/model/payment/zibal.php`](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/model/payment/zibal.php) (Method Eligibility), [`admin/view/template/payment/zibal.twig`](https://github.com/abolfazlabdollahii/opencart/blob/main/admin/view/template/payment/zibal.twig) (Settings Form)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_admin["Administration"]
  node_admin_controller["Payment Settings<br/>[zibal.php]"]
  node_admin_view["Settings Form<br/>[zibal.twig]"]
  node_admin_locale["Admin Text"]
end

subgraph group_checkout["Checkout"]
  node_payment_model["Method Eligibility<br/>[zibal.php]"]
  node_payment_view["Payment Button<br/>[zibal.twig]"]
  node_confirmation_view["Payment Confirmation<br/>[zibal_confirm.twig]"]
  node_catalog_locale["Storefront Text"]
end

subgraph group_payment["Payment Processing"]
  node_payment_controller["Payment Flow<br/>[zibal.php]"]
end

subgraph group_platform["OpenCart Services"]
  node_settings_store["Settings Model"]
  node_checkout_order["Order Service"]
  node_order_state[("Order State")]
end

node_admin_user(("Administrator"))
node_shopper(("Shopper"))
node_zibal_gateway["Zibal Gateway"]

node_admin_user -->|"configures"| node_admin_controller
node_admin_controller -->|"saves settings"| node_settings_store
node_admin_controller -->|"renders form"| node_admin_view
node_admin_controller -->|"loads text"| node_admin_locale
node_shopper -->|"requests options"| node_payment_model
node_payment_model -->|"checks geo-zone data"| node_order_state
node_shopper -->|"confirms payment"| node_payment_controller
node_payment_controller -->|"loads order"| node_checkout_order
node_payment_controller -->|"renders option"| node_payment_view
node_payment_controller -->|"loads text"| node_catalog_locale
node_payment_controller -->|"requests payment"| node_zibal_gateway
node_payment_controller -->|"verifies payment"| node_zibal_gateway
node_zibal_gateway -->|"returns callback"| node_payment_controller
node_payment_controller -->|"adds history"| node_checkout_order
node_checkout_order -->|"updates status"| node_order_state

click node_admin_controller "https://github.com/abolfazlabdollahii/opencart/blob/main/admin/controller/payment/zibal.php"
click node_admin_view "https://github.com/abolfazlabdollahii/opencart/blob/main/admin/view/template/payment/zibal.twig"
click node_admin_locale "https://github.com/abolfazlabdollahii/opencart/tree/main/admin/language"
click node_payment_model "https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/model/payment/zibal.php"
click node_payment_controller "https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/controller/payment/zibal.php"
click node_payment_view "https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/view/template/payment/zibal.twig"
click node_confirmation_view "https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/view/template/payment/zibal_confirm.twig"
click node_catalog_locale "https://github.com/abolfazlabdollahii/opencart/tree/main/catalog/language"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_admin_controller,node_admin_view,node_admin_locale toneBlue
class node_payment_model,node_payment_view,node_confirmation_view,node_catalog_locale toneAmber
class node_payment_controller toneMint
class node_settings_store,node_checkout_order,node_order_state toneRose
class node_admin_user,node_shopper,node_zibal_gateway toneIndigo
```

## Components

### Administration

- [Payment Settings](https://github.com/abolfazlabdollahii/opencart/blob/main/admin/controller/payment/zibal.php): `admin/controller/payment/zibal.php`
- [Settings Form](https://github.com/abolfazlabdollahii/opencart/blob/main/admin/view/template/payment/zibal.twig): `admin/view/template/payment/zibal.twig`
- [Admin Text](https://github.com/abolfazlabdollahii/opencart/tree/main/admin/language): `admin/language`

### Checkout

- [Method Eligibility](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/model/payment/zibal.php): `catalog/model/payment/zibal.php`
- [Payment Button](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/view/template/payment/zibal.twig): `catalog/view/template/payment/zibal.twig`
- [Payment Confirmation](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/view/template/payment/zibal_confirm.twig): `catalog/view/template/payment/zibal_confirm.twig`
- [Storefront Text](https://github.com/abolfazlabdollahii/opencart/tree/main/catalog/language): `catalog/language`

### Payment Processing

- [Payment Flow](https://github.com/abolfazlabdollahii/opencart/blob/main/catalog/controller/payment/zibal.php): `catalog/controller/payment/zibal.php`

### OpenCart Services

- **Settings Model**
- **Order Service**
- **Order State**

### Other components

- **Administrator**
- **Shopper**
- **Zibal Gateway**

## Connections

- Administrator → Payment Settings: configures
- Payment Settings → Settings Model: saves settings
- Payment Settings → Settings Form: renders form
- Payment Settings → Admin Text: loads text
- Shopper → Method Eligibility: requests options
- Method Eligibility → Order State: checks geo-zone data
- Shopper → Payment Flow: confirms payment
- Payment Flow → Order Service: loads order
- Payment Flow → Payment Button: renders option
- Payment Flow → Storefront Text: loads text
- Payment Flow → Zibal Gateway: requests payment
- Payment Flow → Zibal Gateway: verifies payment
- Zibal Gateway → Payment Flow: returns callback
- Payment Flow → Order Service: adds history
- Order Service → Order State: updates status
