=== JEKO for WooCommerce ===
Contributors: jeko
Tags: woocommerce, payment, mobile money, jeko, wave, orange money, payment link
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 8.0
Requires Plugins: woocommerce
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept JEKO Mobile Money and payment links at WooCommerce checkout.

== Description ==

JEKO for WooCommerce connects your store to the [JEKO Partner API](https://developer.jeko.africa/fr/integration/getting-started/introduction) so customers can pay with Mobile Money (Wave, Orange, MTN, Moov, Djamo) or via a JEKO payment link.

**Features**

* **JEKO Mobile Money** — redirect checkout with provider selection (classic and block checkout)
* **Direct provider flow** — optional advanced mode with payer phone (off by default)
* **JEKO Payment Link** — hosted link checkout for orders from 100 XOF
* **Admin payment links** — create, copy, and refresh link status from the order screen
* **Webhooks** — HMAC-verified, idempotent order completion by order reference or `paymentLinkId`
* **Fallbacks** — return URL and payment-link polling when webhook delivery is delayed
* **HPOS** — compatible with WooCommerce High-Performance Order Storage

**Out of scope:** JEKO transfers (pay-out), soundbox/in-store terminals, and automated refunds via the JEKO API. Use WooCommerce refunds or JEKO Cockpit for pay-out operations.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/jeko-woocommerce/` or install the release ZIP via **Plugins → Add New → Upload**.
2. Activate through the **Plugins** menu (WooCommerce must be active).
3. Go to **WooCommerce → JEKO** and enter your Partner API credentials.
4. Enable **JEKO Mobile Money** and/or **JEKO Payment Link** under **WooCommerce → Settings → Payments**.

Developers: see the plugin repository for Docker-based local setup (`DEV.md`).

== Setup ==

= Prerequisites =

* JEKO business account ([Jeko Cockpit](https://cockpit.jeko.africa/))
* Partner API keys (`X-API-KEY` and `X-API-KEY-ID`)
* Public HTTPS URL for webhook delivery (production)
* Shop currency **XOF**

= Configuration =

1. Enter **API Key** and **API Key ID** from Cockpit → Paramètres → API & Webhooks.
2. Click **Test connection & load stores**, then select your store and save.
3. Copy the **Webhook URL** into Cockpit and paste the **Webhook secret** into plugin settings.
4. For local/staging redirect checkout, set **Public HTTPS URL** (e.g. ngrok) when your WordPress site URL is not public HTTPS.
5. Enable payment gateways under **WooCommerce → Settings → Payments**.

== Frequently Asked Questions ==

= Where are logs stored? =

Enable **Debug logging** on the JEKO settings page, then view **WooCommerce → Status → Logs** (source: `jeko`).

= What is the webhook URL? =

`https://your-site.com/wp-json/jeko/v1/webhook`

= What is the minimum amount for payment links? =

100 XOF (10 000 centimes). The payment link gateway is hidden below this threshold.

= Is this plugin compatible with HPOS? =

Yes. JEKO declares compatibility with WooCommerce custom order tables (HPOS).

= Does this plugin support JEKO transfers or payouts? =

No. This plugin handles **pay-in only** (checkout collection). Transfers and pay-out operations are managed in JEKO Cockpit or via the Partner API outside WooCommerce.

= Does direct mode skip the JEKO payment page? =

Yes, when enabled under **JEKO Mobile Money** settings. It is an advanced option, off by default, and requires a valid payer phone and public HTTPS return URLs.

== Screenshots ==

1. JEKO settings under WooCommerce (API credentials, store, webhook URL)
2. WooCommerce payment gateways — JEKO Mobile Money and JEKO Payment Link
3. Checkout with Mobile Money provider selection
4. Order admin — JEKO Payment Link sidebar with copy and refresh status

== Changelog ==

= 1.1.0 =
* Internal: shared `jeko-partner-core` library for API client and webhooks (monorepo).

= 1.0.0 =
* Production release: pay-in integration complete, HPOS support, CI, distribution packaging.
* Documentation restructured for merchants and WordPress.org.

= 0.3.0 =
* Direct provider flow, payment link gateway, admin link tools, paymentLinkId webhooks.

= 0.2.0 =
* JEKO Mobile Money redirect gateway, webhook completion, return URL fallback.

= 0.1.0 =
* Plugin foundation: API client, settings, webhook endpoint.

== Upgrade Notice ==

= 1.0.0 =
Stable production release. No breaking changes from 0.3.0 for existing configurations.

= 0.3.0 =
Adds payment links, direct provider flow, and paymentLinkId webhook support.
