> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fyatu.com/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCart

> Fyatu payment extension for OpenCart — integrate African payment methods into your OpenCart store.

<Warning>
  This extension is coming soon. Join our [waitlist](mailto:developers@fyatu.com?subject=OpenCart%20Extension%20Waitlist) to be notified when it's released.
</Warning>

Accept payments from customers across Africa on your OpenCart store with the official Fyatu payment extension.

## Requirements

* OpenCart 3.x or 4.x
* PHP 7.4 or higher
* SSL certificate (HTTPS)

## Installation

### Via OpenCart Extension Installer

1. Download the `.ocmod.zip` file from [GitHub](https://github.com/fyatu/opencart-payment)
2. Go to **Extensions > Installer** in your OpenCart admin
3. Click **Upload** and select the extension file
4. Go to **Extensions > Modifications** and click **Refresh**
5. Go to **Extensions > Payments** and install "Fyatu"

### Manual Installation

1. Download and extract the extension
2. Upload the contents to your OpenCart root directory:
   * `admin/` → `/admin/`
   * `catalog/` → `/catalog/`
3. Go to **Extensions > Payments**
4. Find "Fyatu" and click **Install**

## Configuration

### Step 1: Get API Credentials

1. Login to [FYATU Dashboard](https://web.fyatu.com)
2. Go to **Business Console > Select Your App > Settings**
3. Copy your **App ID** and **Secret Key**

### Step 2: Configure the Extension

1. Go to **Extensions > Payments**
2. Find "Fyatu" and click **Edit**
3. Configure the settings:

| Field                  | Description                       |
| ---------------------- | --------------------------------- |
| Status                 | Enable/disable the payment method |
| Title                  | Name displayed at checkout        |
| App ID                 | Your Fyatu App ID                 |
| Secret Key             | Your Fyatu Secret Key             |
| Webhook Secret         | Secret for webhook verification   |
| Test Mode              | Enable sandbox environment        |
| Order Status (Pending) | Status for pending orders         |
| Order Status (Success) | Status for successful payments    |
| Order Status (Failed)  | Status for failed payments        |
| Geo Zone               | Restrict to specific regions      |
| Sort Order             | Display order at checkout         |

### Step 3: Configure Webhooks

1. In your FYATU Dashboard, go to **App Settings > Webhooks**
2. Add webhook URL: `https://yourstore.com/index.php?route=extension/payment/fyatu/webhook`
3. Copy the webhook secret to your extension configuration

## Features

* **OpenCart 4.x Support** - Compatible with latest OpenCart
* **Multi-Store** - Different settings per store
* **Order Tracking** - Automatic order status updates
* **Refund Support** - Process refunds from admin
* **Multi-Language** - English and French translations included
* **Journal Theme** - Compatible with Journal 3 theme

## Checkout Flow

```
Customer adds items to cart
           ↓
Customer proceeds to checkout
           ↓
Customer selects "Fyatu" payment
           ↓
Customer confirms order
           ↓
Customer redirected to Fyatu checkout
           ↓
Customer completes payment
           ↓
Customer redirected to success page
           ↓
Order status updated automatically
```

## Order Statuses

Configure order statuses in the extension settings:

| Event           | Recommended Status |
| --------------- | ------------------ |
| Payment Pending | Pending            |
| Payment Success | Processing         |
| Payment Failed  | Failed             |
| Refund Complete | Refunded           |

## Multi-Store Setup

For OpenCart multi-store:

1. Go to **System > Settings**
2. Edit each store
3. Configure Fyatu credentials per store
4. Save changes

## Refunds

To process a refund:

1. Go to **Sales > Orders**
2. Open the order to refund
3. Click **Fyatu Refund** button
4. Enter refund amount and reason
5. Click **Process Refund**

## Template Customization

Override templates in your theme:

**OpenCart 3.x:**

```
/catalog/view/theme/YOUR_THEME/template/extension/payment/fyatu.twig
```

**OpenCart 4.x:**

```
/catalog/view/theme/YOUR_THEME/template/extension/fyatu/payment/fyatu.twig
```

## Events

The extension triggers OpenCart events:

| Event                   | Description                 |
| ----------------------- | --------------------------- |
| `fyatu/payment/before`  | Before redirect to checkout |
| `fyatu/payment/success` | After successful payment    |
| `fyatu/payment/failed`  | After failed payment        |
| `fyatu/refund/success`  | After successful refund     |

### Listen to Events

```php theme={null}
// In your extension's admin/controller
$this->load->model('setting/event');

$this->model_setting_event->addEvent(
    'my_module',
    'catalog/model/extension/payment/fyatu/success/after',
    'extension/module/my_module/onFyatuSuccess'
);
```

## OCMOD Modifications

The extension uses OCMOD for non-destructive modifications. View applied modifications:

1. Go to **Extensions > Modifications**
2. Find "Fyatu Payment" entries
3. Click **Refresh** after any changes

## Troubleshooting

### Extension not appearing at checkout

1. Verify extension status is "Enabled"
2. Check Geo Zone restrictions
3. Clear OpenCart cache: **Dashboard > Blue gear icon**

### Webhook not working

1. Verify webhook URL is correct
2. Check that `.htaccess` allows the webhook route
3. Test webhook URL directly in browser (should show error for GET)

### Payment stuck on pending

1. Check webhook delivery in Fyatu Dashboard
2. Verify order status mappings are correct
3. Check extension logs if debug enabled

## Debug Mode

Enable logging for troubleshooting:

1. Edit extension settings
2. Enable **Debug Mode**
3. Logs written to `/system/storage/logs/fyatu.log`

```bash theme={null}
# View logs
tail -f /system/storage/logs/fyatu.log
```

## vQmod Support

For vQmod users (OpenCart 2.x compatibility):

1. Download the vQmod version from GitHub
2. Upload `fyatu.xml` to `/vqmod/xml/`
3. Clear vQmod cache

## Resources

* [OpenCart Documentation](https://docs.opencart.com/)
* [Fyatu API Reference](/v3/api-reference/introduction)
* [GitHub Repository](https://github.com/fyatu/opencart-payment) *(Coming soon)*
