=== WunaPay for WooCommerce ===
Contributors: wunapay
Tags: mobile money, mtn momo, orange money, cameroon, payments
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later

Accept MTN Mobile Money and Orange Money in Cameroon (XAF) with WunaPay.

== Description ==
Your customer chooses "MTN MoMo / Orange Money" at checkout, pays on a secure WunaPay page
by confirming on their phone, and comes back to your shop. The order is marked as paid automatically.

WunaPay is in test mode while operator approvals are completed: use your sk_test_ key and the
test numbers from https://wunapay.com/docs.html#testing.

IMPORTANT – test mode: with an sk_test_ key, payments are SIMULATED and no real money moves.
Any customer can "pay" with any number. So that you never ship goods for money that does not exist,
orders paid with a test payment are put "On hold" with the note "TEST payment – no money received".
A red "TEST MODE" notice is shown at checkout and on the plugin settings page while the key is a test key.
Only tick "Test mode (orders from test payments are marked paid)" on a private test shop.

== Installation ==
1. WordPress → Plugins → Add New → Upload Plugin → choose wunapay-woocommerce.zip → Install → Activate.
2. WooCommerce → Settings → General: currency must be "Central African CFA franc (FCFA)".
3. WooCommerce → Settings → Payments → WunaPay → Manage.
4. Paste your secret key (WunaPay dashboard → Developers).
5. Copy the webhook URL shown under "Webhook signing secret", paste it in the WunaPay dashboard →
   Developers → Webhooks → Save, then copy the signing secret (whsec_...) back into the plugin.
   With an sk_test_ key use "Test webhook"; with an sk_live_ key use "Live webhook" (each has its own secret).
6. Tick "Enable" and save. Place a test order.

== Changelog ==
= 1.3.0 =
* Refunds from wp-admin: Orders › Refund › "Refund via WunaPay" sends the money back to the number that paid
  (POST /v1/refunds, safe to retry). A refund that fails later is added as an order note.

= 1.2.0 =
* Safety: checkout sessions are created with an Idempotency-Key (order + amount), so a network retry can never
  create a second session. One automatic retry on a network error.
* Safety: webhook events must be in the same mode as the secret key (a live shop ignores test events),
  and a live key never accepts a test payment for an order.
* WunaPay now has separate test and live webhook addresses: with an sk_live_ key, paste the webhook URL under
  "Live webhook" in the dashboard and use the live signing secret.

= 1.1.0 =
* Safety: orders paid with a test (simulated) payment are put "On hold" ("TEST payment – no money received"),
  unless the new setting "Test mode (orders from test payments are marked paid)" is ticked.
* Red "TEST MODE" notice at checkout and in the settings while the secret key is an sk_test_ key.
* "Place order" again (back button, second tab) reuses the open WunaPay session when the amount is unchanged,
  so the same order can't be paid twice. Every session made for an order is remembered.
* Webhooks find the order by any of its sessions, or by the reference "WC-<order id>".
* A failed payment attempt (payment.failed) is added as an order note.

= 1.0.0 =
* First version: hosted checkout, automatic order confirmation, signed webhooks.
