=== mozzeno - installment payment ===
Contributors: laxmidigital, mozzenoplugin
Tags: woocommerce, payment, bnpl, financing, mozzeno
Requires at least: 6.2
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 6.0
WC tested up to: 9.0
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Mozzeno split payment for WooCommerce: redirect checkout, widgets, webhooks, stock hold, custom order statuses.

== Description ==

mozzeno - installment payment connects your store to the mozzeno financing platform. Customers can apply for split payment while you ship according to your usual workflow once financing is confirmed.

= Features =

* mozzeno payment method at checkout with optional on-checkout simulation widget
* Product and cart widgets loading mozzeno's hosted loan widget script
* Inbound webhooks (`/wc-api/mozzeno_webhook`) to move orders through mozzeno-specific statuses
* Outbound webhooks to mozzeno when the merchant updates key order states (for example delivery or cancellation)
* Configurable stock reservation and automatic release tied to loan events and cron
* Custom order statuses for the full loan lifecycle
* Sandbox and live API endpoints
* Logging under mozzeno > Logs
* HPOS (custom order tables) compatibility declared for WooCommerce

= External services =

**mozzeno widget and redirect scripts (`assets.mozzeno.com`)**
This plugin loads JavaScript from `assets.mozzeno.com` to display the financing simulation widget on product, cart, and checkout pages, and to handle the payment redirect flow. The scripts receive the loan amount, branch identifier, language, and customer first name, last name, and email address — but only when the customer initiates the mozzeno checkout flow. No data is sent on page load for widget display alone.
[Terms of service](https://www.mozzeno.com/fr/mentions-legales/) — [Privacy policy](https://www.mozzeno.com/fr/vie-privee/)

**mozzeno API (`api.mozzeno.com` / `api-dev.mozzeno.com`)**
Outbound webhooks are sent to the mozzeno API when the merchant updates key order states (delivery initiated, cancellation). The payload includes the order reference and event type. In sandbox mode, requests go to `api-dev.mozzeno.com`; in live mode, to `api.mozzeno.com`.
[Terms of service](https://www.mozzeno.com/fr/mentions-legales/) — [Privacy policy](https://www.mozzeno.com/fr/vie-privee/)

Select2 for admin multi-select fields is bundled in the plugin and makes no external requests.

== Installation ==

1. Install and activate **WooCommerce**.
2. Upload the plugin ZIP via **Plugins > Add New > Upload Plugin**, or copy the plugin folder into `wp-content/plugins/`.
3. Activate **mozzeno - installment payment**.
4. Open **mozzeno > Settings**, set your Branch ID, environment (sandbox or live), and review widget options.
5. In the mozzeno merchant dashboard, set the webhook URL and shared secret to match the values shown on the settings screen (see FAQ).

== Frequently Asked Questions ==

= How do I set up webhooks? =

1. In WordPress, go to **mozzeno > Settings** and copy the **Webhook URL** (your store’s WooCommerce API URL, ending with `/wc-api/mozzeno_webhook`).
2. Copy the **Webhook secret** generated by the plugin (or regenerate it if you rotate credentials).
3. In the mozzeno dashboard, register the same URL and secret so mozzeno can sign requests with HMAC-SHA256 and your site can verify them.
4. After saving, trigger a test event from mozzeno (if available) or place a sandbox order and confirm that **mozzeno > Logs** shows incoming events without signature errors.

Outbound calls from your site to mozzeno use the same secret to sign JSON payloads sent to the mozzeno webhook endpoint (`api.mozzeno.com` or `api-dev.mozzeno.com`).

= Where do I configure order statuses and shipment notifications? =

mozzeno adds custom order statuses for the loan lifecycle. WooCommerce core statuses (for example **Processing**, **Completed**, **Cancelled**) still behave as usual.

In the gateway and advanced settings you can choose which WooCommerce status should notify mozzeno that delivery has started (`order.delivery_initiated`). Stock release strings for declined or cancelled loans are configurable in advanced options. Always test status changes in sandbox before going live.

= Is the plugin compatible with other plugins that add custom order statuses? =

Yes, as long as those plugins follow WooCommerce APIs. mozzeno registers its own statuses and maps mozzeno webhook events to them; it does not remove third-party statuses. If another plugin also forces status transitions on the same orders, coordinate rules so two automations do not conflict (for example, avoid duplicate stock changes by testing with your full stack).

= Does the plugin work with High-Performance Order Storage (HPOS)? =

Yes. The plugin declares compatibility with custom order tables.

= What are the default financing amount limits? =

Defaults are configurable in settings; the plugin ships with a broad range suitable for typical mozzeno flows. Adjust min and max to match your contract with mozzeno.

= Where are transaction and log records stored? =

Custom database tables are created on activation (`mozzeno_transaction`, `mozzeno_log`, `mozzeno_stock_reservation` with your WordPress table prefix). Logs can be pruned by the plugin’s scheduled tasks according to your configuration.

== Screenshots ==

1. **mozzeno > Settings — General** — Branch ID, sandbox/live toggle, webhook URL and secret, widget toggles.
2. **Advanced / business rules** — Amount limits, excluded categories, allowed countries, stock reservation duration, stock release status list, shipment-notify statuses.
3. **Single product** — Product-page mozzeno widget with eligible price.
4. **Checkout** — mozzeno payment method with simulation / copy explaining redirect to mozzeno.
5. **Simulation widget** — mozzeno financing simulation widget displayed to the customer during the payment flow.

== Changelog ==

= 1.0.0 - 2026-04-22 =
* Initial public release.
* WooCommerce payment gateway with redirect flow and HMAC-SHA256 webhook verification.
* Product, cart, and checkout widgets via hosted mozzeno script.
* 13 custom order statuses covering the full mozzeno loan lifecycle.
* Inbound webhooks for all loan events, outbound webhooks for delivery and cancellation.
* Configurable stock reservation and automatic release via WP-Cron.
* Admin logging interface with search, filtering, and automatic 30-day cleanup.
* HPOS (High-Performance Order Storage) compatibility declared.
* Sandbox and production environment modes.

== Upgrade Notice ==

= 1.0.0 =
First stable release submitted to the plugin directory.
