=== Meskelpay for WooCommerce ===
Contributors: meskelpay
Tags: payments, ethiopia, telebirr, cbe, woocommerce
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Telebirr, CBE, M-Pesa and bank transfers on WooCommerce through the MeskelPay hosted checkout. Send - Pay - Receive.

== Description ==

MeskelPay lets Ethiopian merchants accept Telebirr, CBE, M-Pesa and bank transfers without a bank API. Customers pay the exact, uniquely-matchable amount straight into your own account; you confirm receipt in your MeskelPay dashboard and the WooCommerce order completes automatically.

* Built-in MeskelPay dashboard inside wp-admin — a replica of the meskelpay.vercel.app merchant dashboard: order/streak/revenue stat tiles, a day-by-day activity heatmap, your full transaction list with Confirm / Reject buttons, and your payment QR cards. Light and dark theme included.
* Hosted checkout — no card forms, no PCI scope
* Money goes directly to your own accounts; MeskelPay never holds funds
* Scan-to-pay: upload your Telebirr/bank payment QR in the MeskelPay dashboard and customers scan it on checkout instead of typing the number
* Your business name and logo shown on the checkout page
* Multi-business ready: each API key belongs to one business in your MeskelPay account, so orders land under the right business
* Exact-amount matching plus memo code, so every transfer maps to one order
* Orders flip to "Processing" automatically after you confirm, via webhook + API verification
* Works with both the classic and block-based checkout, HPOS compatible
* Shows your accepted payment channels (Telebirr, CBE, M-Pesa, banks) at checkout
* Product Analyzer screen (WooCommerce → MeskelPay): scans your whole catalog, shows price stats, and manages QR codes in bulk
* "Scan to buy" MeskelPay QR code under each product — customers scan with their phone and land straight in checkout

Full platform documentation: https://meskelpay.vercel.app/docs
Terms: https://meskelpay.vercel.app/terms · Privacy: https://meskelpay.vercel.app/privacy

== Installation ==

1. Upload the plugin ZIP via Plugins → Add New → Upload Plugin, then activate it.
2. Make sure your store currency is ETB (WooCommerce → Settings → General).
3. Create an account at https://meskelpay.vercel.app (email confirmation included), add your payout accounts — attach your payment QR to each — and generate an API key for the business this store belongs to.
4. In WooCommerce → Settings → Payments → Meskelpay, paste your MSKSECK-… secret key and save.

That's it — the plugin passes its webhook URL with every transaction automatically. Optionally, also register `https://your-site.com/?wc-api=meskelpay` as a webhook endpoint in the MeskelPay dashboard (Webhooks are per business).

== Frequently Asked Questions ==

= When does the order get marked paid? =

When you press Confirm in the MeskelPay dashboard. MeskelPay then notifies your store, and the plugin double-checks the payment against the MeskelPay API before completing the order.

= Why is the charged amount slightly different from the order total? =

MeskelPay adds a few santim to each payment so every incoming transfer is uniquely identifiable by amount. The exact received amount is recorded in the order notes.

= How do customers pay by QR? =

Attach the receive-money QR from your Telebirr or banking app to the matching payout account in the MeskelPay dashboard. The hosted checkout then shows a "Scan to pay" panel beside the account number.

= I run several businesses on one MeskelPay account — which one gets the money? =

The business that owns the API key you pasted into the plugin settings. Create one key per store under the right business in the MeskelPay dashboard.

== Changelog ==

= 1.1.1 =
* Removed the USSD dial codes from the checkout and settings — the hosted checkout now leads with scan-to-pay QR and account details.
* Inventory sync now also sends your store's name, description and URL, so your MeskelPay storefront shows an About section and a link back to your store.

= 1.1.0 =
* New: inventory sync — the plugin now pushes your product catalog (name, SKU, price, stock, image) to your MeskelPay business automatically on every product change, twice daily, and via a "Sync inventory to MeskelPay now" button on the Products screen. The MeskelPay dashboard gets an Inventory page with search and sales-over-time per product, plus a Top sellers section.
* Order line items now carry the product id so MeskelPay attributes each sale to the right inventory item even if a product is renamed.

= 1.0.4 =
* Fixed: the dashboard activity heatmap no longer needs a horizontal scrollbar — cells now scale fluidly to the card width on every screen size.

= 1.0.3 =
* New: confirming a payment opens a Confirm-payment dialog where you can record where the money landed and an optional note — saved on the transaction exactly like the site's confirm dialog.
* The dashboard logo is now the MeskelPay mark as an inline SVG, so it renders crisply and picks up the right color in both the light and dark themes (the old PNG showed a white box in dark mode).
* Merchant API: /api/v1/transaction/confirm now accepts paid_place and paid_note.

= 1.0.2 =
* New: MeskelPay dashboard inside wp-admin (top-level MeskelPay menu) — a replica of the site's merchant dashboard fed by your existing secret key. Overview screen with stat tiles (orders, settled, revenue, active days, current/longest settled-payment streak, peak hour, top channel), All/30d/7d ranges, and a contribution-style activity heatmap.
* New: Transactions screen listing your MeskelPay payments with monochrome status badges; Confirm and Reject pending payments without leaving WordPress — confirming fires your webhooks and emails the customer their receipt, exactly like the site.
* New: QR & Accounts screen showing your wallet-style payment QR cards (holder name, masked number, channel) and payout account list with USSD codes.
* New: light & dark theme toggle on the dashboard, remembered per browser — matching the site's new theme system.
* New: itemized email receipts — the plugin now sends order line items (plus shipping) with each payment, and MeskelPay emails the customer a receipt-style breakdown when you confirm.
* The Product Analyzer moved from WooCommerce → MeskelPay to the new top-level MeskelPay menu → Products.
* Uses the new merchant API endpoints (/api/v1/transactions, /api/v1/accounts, /api/v1/transaction/confirm|fail) — your secret key stays server-side; nothing is exposed to the browser.

= 1.0.1 =
* Versioning reset to track the MeskelPay platform release line.
* Hosted checkout now shows the merchant's scan-to-pay payment QR next to the account details (upload yours per payout account in the dashboard).
* Hosted checkout shows your business name and logo (Settings → Businesses).
* Multi-business support: API keys, payout accounts, webhooks and transactions are scoped per business; the plugin's key decides which business receives the order.
* MeskelPay platform: refreshed design, public documentation (meskelpay.vercel.app/docs), Terms of Service and Privacy Policy, signup human check and email confirmation.
* Updated gateway copy to mention QR, USSD and the wider channel list.

= 1.1.0 =
* New: Product Analyzer admin screen (WooCommerce → MeskelPay) — full-catalog price analysis (count, min/max/average price, stock value) with per-product and bulk QR management.
* New: "Scan to buy" QR codes on product pages. Simple products encode a straight-to-checkout link; QR images are generated in the browser, no third-party service.
* New: payment channel options at checkout with USSD dial codes, Chapa-style (Telebirr *127#, CBE *889#, CBE Birr *847#, M-Pesa *733#, BOA *815#, Awash *901#, Amole *996#).
* Both classic and block checkout render the channel list.

= 1.0.0 =
* Initial release: hosted checkout redirect, webhook + API verification, block checkout support.
