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

# WordPress/WooCommerce Plugin

> Quick setup guide for Navio WordPress/WooCommerce plugin

## Overview

Navio for WooCommerce is a payment gateway plugin that integrates Navio with your WooCommerce store. Accept secure payments in Algerian Dinars (DZD) with minimal setup.

<CardGroup cols={2}>
  <Card title="Easy Installation" icon="download" color="#0D9373">
    Install from plugin ZIP - no coding required
  </Card>

  <Card title="Auto Status Polling" icon="clock-rotate-left" color="#0D9373">
    Automatically checks payment status every 20 minutes
  </Card>

  <Card title="WooCommerce Blocks" icon="cubes" color="#0D9373">
    Works with both classic and block checkout
  </Card>

  <Card title="Sandbox Testing" icon="flask" color="#0D9373">
    Test with sandbox mode before going live
  </Card>
</CardGroup>

## Requirements

<Steps>
  <Step title="WordPress & WooCommerce">
    * WordPress 5.0 or higher
    * WooCommerce 4.0 or higher
    * PHP 7.2 or higher
  </Step>

  <Step title="SSL Certificate">
    SSL/HTTPS enabled on your site (required for payments)
  </Step>

  <Step title="Navio Account">
    Active merchant account at [oneclickdz.com](https://app.oneclickdz.com)

    <Warning>
      Complete merchant validation before creating payment links
    </Warning>
  </Step>
</Steps>

## Quick Setup

### 1. Install the Plugin

<Steps>
  <Step title="Download Plugin">
    Download the plugin from [GitHub](https://github.com/oneclickdz/ocpay_wordpress/releases/download/v2.1.0/ocpay-gateway-2.1.0.zip)
  </Step>

  <Step title="Upload to WordPress">
    * Go to **Plugins → Add New**
    * Click **Upload Plugin**
    * Select the ZIP file
    * Click **Install Now**
  </Step>

  <Step title="Activate">
    Click **Activate Plugin** after installation
  </Step>
</Steps>

### 2. Get Your API Keys

1. Log in to [enterprise.oneclickdz.com](https://enterprise.oneclickdz.com/)
2. Go to API Settings
3. Copy both keys:
   * **Sandbox Key**: For testing
   * **Production Key**: For live payments

<Warning>
  Never expose API keys in public code or share them via email
</Warning>

### 3. Configure Plugin

<Steps>
  <Step title="Open Settings">
    Go to **WooCommerce → Settings → Payments**
  </Step>

  <Step title="Select Navio">
    Click on **Navio** in the payment methods list
  </Step>

  <Step title="Enable & Configure">
    * **Enable/Disable**: Check to enable Navio
    * **Title**: "Navio - OneClick Payment" (shown to customers)
    * **Description**: Payment method description
  </Step>

  <Step title="Add API Keys">
    * **Sandbox API Key**: Your sandbox key
    * **Production API Key**: Your production key
    * **API Mode**: Select "Sandbox" for testing
  </Step>

  <Step title="Configure Options">
    * **Fee Mode**: Choose who pays transaction fees
      * `NO_FEE`: You absorb fees (best customer experience)
      * `SPLIT_FEE`: 50/50 split
      * `CUSTOMER_FEE`: Customer pays all fees
    * **Order Status**: Choose status after successful payment
      * `Completed`: For digital products (auto-delivery)
      * `Processing`: For physical products (requires fulfillment)
  </Step>

  <Step title="Save Settings">
    Click **Save changes**
  </Step>
</Steps>

## Testing in Sandbox

<Note>
  Always test in Sandbox mode before accepting real payments
</Note>

1. **Set to Sandbox Mode**
   * API Mode: `Sandbox (Testing)`
   * Use your Sandbox API Key

2. **Create Test Order**
   * Go to your store
   * Add product to cart
   * Proceed to checkout
   * Select Navio payment method
   * Complete checkout

3. **Test Payment Flow**
   * You'll be redirected to Navio payment page
   * Complete the test payment
   * Return to your store

4. **Verify Order Update**
   * Check order status in WooCommerce
   * Should update to your configured status
   * Check plugin logs: **WooCommerce → Navio → Activity Logs**

## Going Live

When ready to accept real payments:

<Steps>
  <Step title="Switch to Production">
    * Go to **WooCommerce → Settings → Payments → Navio**
    * Change **API Mode** to `Production (Live)`
    * Save changes
  </Step>

  <Step title="Verify SSL">
    Ensure SSL/HTTPS is properly configured on your site
  </Step>

  <Step title="Test Order">
    Create a small test order to verify everything works
  </Step>
</Steps>

## Key Features

### Automatic Status Polling

The plugin automatically checks payment status every 20 minutes using WordPress cron:

* **No manual intervention needed**
* Orders automatically update when payment confirms
* Failed payments marked as "On Hold"

### Manual Status Check

Customers can manually check payment status:

* Available on order page
* Click "Check Payment Status" button
* Real-time AJAX update

### Fee Modes

| Mode              | Description      | Best For                 |
| ----------------- | ---------------- | ------------------------ |
| **NO\_FEE**       | You pay all fees | Best customer experience |
| **SPLIT\_FEE**    | 50/50 split      | Shared cost              |
| **CUSTOMER\_FEE** | Customer pays    | Maximize profit          |

<Info>
  **Fee Structure**: 0% on balance, 1% withdrawal fee only
</Info>

## Troubleshooting

### Payment Gateway Not Configured

**Problem**: Error message when placing order

**Solution**:

* Verify API key is entered
* Check API key matches the mode (Sandbox/Production)
* Test connection in plugin settings

### Orders Not Updating

**Problem**: Orders stay "Pending" after payment

**Solution**:

1. Check WordPress cron is working
2. Verify payment reference is saved in order
3. Enable Debug Mode in plugin settings
4. Check Activity Logs for errors

### SSL/HTTPS Required

**Problem**: "SSL required" error message

**Solution**:

* Contact your hosting provider to enable SSL
* Use free Let's Encrypt certificate
* Verify site URL starts with `https://`

## Debug Mode

Enable for troubleshooting:

1. Go to **WooCommerce → Settings → Payments → Navio**
2. Check **Enable Debug Logging**
3. Save changes
4. View logs at **WooCommerce → Navio → Activity Logs**

<Warning>
  Disable debug mode in production for better performance
</Warning>

## Support & Resources

<CardGroup cols={2}>
  <Card title="GitHub Repository" icon="github" href="https://github.com/oneclickdz/Ocpay_wordpress">
    Plugin source code and issues
  </Card>

  <Card title="API Documentation" icon="book" href="/en/api-reference/ocpay/create-link">
    Detailed API reference
  </Card>

  <Card title="Navio Dashboard" icon="gauge" href="https://app.oneclickdz.com">
    Manage your merchant account
  </Card>

  <Card title="Contact Support" icon="headset" href="/en/contact">
    Get help from our team
  </Card>
</CardGroup>

## Next Steps

<Card title="Navio Best Practices" icon="star" href="/en/ocpay-guides/4-best-practices">
  Learn production-ready tips and security best practices
</Card>
