> For the complete documentation index, see [llms.txt](https://docs.morpara.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.morpara.com/tr/en/api-documentation/gelistiriciaraclari/open-source-plugins/opencart.md).

# OpenCart

[![OpenCart Sürümü](https://img.shields.io/badge/OpenCart-4.0%2B-blue.svg)](https://www.opencart.com/) [![PHP Sürümü](https://img.shields.io/badge/PHP-8.0%2B-777bb4.svg)](https://php.net/) ![Lisans](https://img.shields.io/badge/license-MIT-blue.svg)

**MorPOS for OpenCart**, for OpenCart 4.x stores **Morpara MorPOS** is a secure and easy-to-use payment gateway plugin that integrates the payment system.\
Customers are redirected through a secure **Hosted Payment Page (HPP)** flow or **Embedded Payment Form** can use.

***

### 📦 Versions

* **OpenCart 4.x**: [4.x branch](https://github.com/morpara/morpos-opencart/tree/4.x)
* **OpenCart 3.x**: [3.x branch](https://github.com/morpara/morpos-opencart/tree/3.x)
* **OpenCart 2.3.x**: [2.3.x branch](https://github.com/morpara/morpos-opencart/tree/2.3.x)
* **OpenCart 2.x**: [2.x branch](https://github.com/morpara/morpos-opencart/tree/2.x)

***

> ZIP files are suitable for OpenCart admin panel or manual installation.

***

### ✨ Features

* 🛒 **OpenCart Integration**: Seamlessly adds MorPOS as a payment method for OpenCart 4.x
* 🔒 **Secure Payments**: Hosted Payment Page (HPP) and Embedded Payment Form
* 🌍 **Multi-Currency**: TRY, USD, EUR
* 💳 **Multiple Payment Options**: Credit cards, debit cards and installment payments
* 🧪 **Test Mode**: Sandbox for development/testing
* 🔧 **Easy Configuration**: Connection test and admin panel
* 🛡️ **Security Features**: TLS 1.2+, signed API communication, cart/order verification
* 🌐 **Multi-Language**: Turkish and English support

***

### 📋 Requirements

#### Server Requirements

| Component | Minimum | Recommended |
| --------- | ------- | ----------- |
| OpenCart  | 4.0     | 4.1.0.3     |
| PHP       | 8.0     | 8.2+        |
| TLS       | 1.2     | 1.3         |

#### PHP Extensions

* `cURL`
* `json`
* `hash`
* `openssl`

#### OpenCart Features

* Admin Panel Access
* Database Access
* HTTPS recommended
* Session SameSite Policy: 'Lax'

***

### 🚀 Installation

#### Method 1: Extension Installer (Recommended)

1. Download the ZIP file [via GitHub Releases](https://github.com/morpara/morpos-opencart/releases) download
2. OpenCart → **Extensions → Installer** → Upload ZIP
3. **Extensions → Payments** → MorPOS Payment Gateway → **Install**
4. **Edit** → Enter credentials → **Test Connection** → **Save**

#### Method 2: Manual Installation (Developers)

```bash
git clone https://github.com/morpara/morpos-opencart.git
cd morpos-opencart
cp -r upload/extension/morpos_gateway/* /path/to/opencart/extension/morpos_gateway/
cp -r upload/system/library/morpos/* /path/to/opencart/system/library/morpos/
chmod 644 /path/to/opencart/extension/morpos_gateway/**/*.php
chmod 755 /path/to/opencart/extension/morpos_gateway/
```

#### Method 3: FTP Upload

1. Download and extract the ZIP file
2. `upload/` upload the contents to the OpenCart root directory
3. Follow the steps in Method 2

***

### ⚙️ Configuration

1. **Extensions → Payments → MorPOS Payment Gateway → Edit**
2. Fill in the required fields:

| Field         | Description                              | Example              |
| ------------- | ---------------------------------------- | -------------------- |
| Merchant ID   | The merchant ID you received from MorPOS | 12345                |
| Client ID     | OAuth client identifier                  | your\_client\_id     |
| Client Secret | OAuth client secret key                  | your\_client\_secret |
| API Key       | API authentication key                   | your\_api\_key       |

3. **Test Mode (Sandbox)**: Enable for development/testing
4. **Form Type**: Hosted (recommended) or Embedded
5. **Order Status**: Set successful/failed order statuses
6. **Test Connection** → A green confirmation should appear → **Save**

***

### 🔧 Payment Flow

1. Customer reviews products in the cart
2. Proceeds to checkout and selects MorPOS
3. System verifies the cart and creates the order
4. Hosted: Redirected to the MorPOS page
5. Embedded: Form is loaded within the page
6. Callback is received from MorPOS → Order status is updated
7. Customer sees the success/failure page

***

### 🛠️ Debugging

```php
// OpenCart 4.x
define('ERROR_LOG', '/path/to/your/error.log');
tail -f /path/to/your/error.log
```

* Use test cards and sandbox mode
* Check payment flows step by step
* Troubleshooting tables: TLS, PHP, OpenCart version

***

### 🌐 Internationalization

* Turkish (tr-tr) and English (en-gb)
* To add a new language, copy and translate the language files

***

### 🤝 Contributing

1. Fork the repo → Make changes → Pull Request
2. Follow coding standards: PSR-4, PHPDoc
3. Test: Installation, payment flows, multi-currency, security, compatibility

***

### 📄 License

MIT License - details in LICENSE

***

### 🆘 Support

* [Documentation](https://docs.opencart.com/)
* [GitHub Issues](https://github.com/morpara/morpos-opencart/issues)
* [Morpara Support](https://morpara.com/support)
