=== FidePay for WooCommerce ===
Contributors: fidepay
Tags: woocommerce, payment, subscriptions, mobile money, africa, stripe, m-pesa, orange money, mtn momo
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
Stable tag: 1.0.0
WC requires at least: 6.0
WC tested up to: 9.0
License: MIT

Accept payments and recurring subscriptions on your WooCommerce store via FidePay — cards (Visa/Mastercard/Amex), mobile money across 11 African countries, all from one merchant account.

== Description ==

FidePay for WooCommerce adds FidePay as a payment method at your store checkout. It works for:

* **Regular products** — customers are redirected to the FidePay checkout page where they pay by card or mobile money. On success, they come back and the order is marked paid.
* **Subscription products** (requires WooCommerce Subscriptions) — a subscription plan is created on FidePay and the customer is redirected to a hosted subscription page that saves their card. FidePay then debits the card on schedule.

= Why FidePay? =

* 1 merchant account, 4 payment rails (Stripe cards, PawaPay mobile money, Mollie SEPA, PayPal).
* Sandbox transparent — no separate Stripe/PawaPay account needed for testing.
* 1% fee on deposits, 5% on withdrawals. No setup fee.
* Hosted card form (PCI-DSS handled).
* Real African mobile money coverage : M-Pesa (RDC, Kenya), Orange (RDC, Senegal, Cameroon...), MTN, Airtel — 11 countries.

== Installation ==

1. Upload the plugin zip via Plugins → Add New → Upload.
2. Activate "FidePay for WooCommerce".
3. Go to WooCommerce → Settings → Payments → FidePay.
4. Enter your Public Key and Secret Key (find them in [merchant.fide-pay.com → API Access Key](https://merchant.fide-pay.com/dashboard/api-access-key)).
5. Choose "Live" or "Test" mode.
6. Copy the Webhook URL shown in the settings, then paste it into:
   * [merchant.fide-pay.com → Integration](https://merchant.fide-pay.com/dashboard/integration) (for one-shot payments)
   * [merchant.fide-pay.com → Subscriptions](https://merchant.fide-pay.com/dashboard/subscriptions) (for recurring)

That's it. The "FidePay" option will appear at checkout.

== Frequently Asked Questions ==

= Does this work with WooCommerce Subscriptions? =

Yes — when a customer buys a subscription product, the plugin creates a corresponding FidePay subscription plan and redirects to the FidePay hosted subscription page (`/subscribe/{plan_id}`). The card is saved via Stripe SetupIntent and FidePay debits automatically each period.

= What happens on a renewal? =

FidePay debits the saved card off-session, then POSTs `invoice.paid` to your webhook URL. The plugin creates a renewal order in WooCommerce automatically.

= What if a renewal fails? =

FidePay POSTs `invoice.failed` and the WC subscription moves to "On hold". You can manually retry from the WC dashboard, and FidePay will retry on its own schedule.

= Can I test without real money? =

Yes. Set mode to "Test" in the plugin settings. Use Stripe test cards (`4242 4242 4242 4242`) for cards. For mobile money sandbox, see [docs.pawapay.io](https://docs.pawapay.io/v2/docs/test_numbers).

= Where can I see API documentation? =

[fide-pay.com/developpeurs](https://www.fide-pay.com/developpeurs) — full REST docs + integration modes.

== Changelog ==

= 1.0.0 =
* Initial release.
* WooCommerce one-shot payments.
* WooCommerce Subscriptions integration (plan auto-creation + recurring webhook handler).
* Webhook IPN verification (HMAC SHA-256).

== Upgrade Notice ==

= 1.0.0 =
First release.
