=== MegaEsim for WooCommerce ===
Contributors: megaesim
Tags: esim, woocommerce, travel, wholesale, api
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later

Sell travel eSIMs on your WordPress / WooCommerce site using the MegaEsim Partner API.

== Description ==

Official partner plugin for [MegaEsim](https://megaesim.us/en/esim-api).

= What it does =

* Connects with your Partner API key (`mega_live_…` or sandbox `mega_test_…`)
* Syncs the MegaEsim catalog as virtual WooCommerce products
* Applies your retail markup on top of B2B (wholesale) prices
* When a customer pays you, the plugin orders the eSIM from MegaEsim (wallet debit) and emails the QR / LPA / ICCID
* Order screen shows ICCID, LPA and MegaEsim order id, with a Retry button
* Compatible with WooCommerce High-Performance Order Storage (HPOS)

= Billing model =

Your WooCommerce customers pay **you**. MegaEsim charges **your prepaid wallet** at B2B price. Keep the wallet funded — if the balance is too low, the WooCommerce order is put on hold.

= Requirements =

* WordPress 6.0+
* WooCommerce 7.0+
* A MegaEsim partner account and API key: https://megaesim.us/register

== Installation ==

1. Download `megaesim-woocommerce.zip` from https://megaesim.us/en/esim-api
2. In WordPress: Plugins → Add New → Upload Plugin → choose the zip → Install → Activate
3. WooCommerce → MegaEsim eSIM → paste your API key → Save
4. Click **Test connection**, then **Sync catalog now**
5. Set a retail markup (or edit product prices) and make sure your MegaEsim wallet has balance

== Frequently Asked Questions ==

= Does the API key appear on my public site? =

No. It is stored in WordPress options and used only in server-side HTTP calls.

= Can I use sandbox first? =

Yes. Use a `mega_test_…` key. Sandbox orders do not debit the wallet and return a non-installable test eSIM.

= What if MegaEsim delivery is delayed? =

The plugin polls pending deliveries every 5 minutes for 24 hours. You can also open the order and click **Retry fulfillment**.

= How do refunds work? =

Refund the WooCommerce order as usual. Wallet refunds on the MegaEsim side are requested from the partner portal (not automatic in v1.0).

== Changelog ==

= 1.0.0 =
* Initial release: catalog sync, auto-fulfillment, QR email, usage-ready ICCID storage.
