=== KUTI Payments for WooCommerce ===
Contributors: kutipe
Tags: woocommerce, payments, peru, yape, plin, qr, kuti
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept payments in Peru with KUTI — interoperable QR (Yape, Plin, wallets) and bank service payments via Checkout.js.

== Description ==

**KUTI Payments for WooCommerce** lets your store accept payments in **Peruvian soles (PEN)** with:

* **Interoperable QR** — Yape, Plin and other wallets
* **Bank service payments** — customer pays from their bank app searching institution **KUTI**

Checkout opens with official **Checkout.js** (`https://js.kuti.pe/v1/kuti.global.js`) as a **modal** or **embedded** iframe. Your secret API key never leaves the server.

You need a KUTI account and API keys: [https://app.kuti.pe](https://app.kuti.pe) · Docs: [https://docs.kuti.pe](https://docs.kuti.pe)

= How it works =

1. Customer chooses KUTI at checkout and places the order.
2. The plugin creates a KUTI checkout session (server-side).
3. On the payment page, Checkout.js opens (modal or embed).
4. After payment, the customer returns to the thank-you page.
5. A signed webhook (`payment.succeeded`) marks the order as paid.

= Requirements =

* WooCommerce store currency **PEN**
* HTTPS (required for webhooks and Checkout.js)
* Secret key (`kuti_test_…` / `kuti_live_…`) and webhook signing secret (`whsec_…`)

== Installation ==

1. Upload the `kuti-payments-for-woocommerce` folder to `/wp-content/plugins/`, or install the ZIP via **Plugins → Add New**.
2. Activate the plugin.
3. Go to **WooCommerce → Settings → Payments → KUTI**.
4. Enable the gateway, paste your test or live secret key and webhook signing secret.
5. Copy the **Webhook URL** shown in the settings into the KUTI dashboard (events: `payment.succeeded`, `payment.failed`, `payment.expired`, `payment.cancelled`).
6. Choose **Modal** or **Embed** for Checkout.js display.
7. Place a test order with a `kuti_test_…` key.

== Frequently Asked Questions ==

= Does it support USD or other currencies? =

No. KUTI currently accepts **PEN only**. The payment method is hidden if the store currency is not PEN.

= Is the secret key used in the browser? =

No. Only the `checkoutUrl` from your server is passed to Checkout.js. Secret keys stay in WordPress.

= What if the customer closes the modal? =

The order stays **Pending** until the session expires or they pay. They can reopen payment from the order-pay link. The webhook is the source of truth for marking the order paid.

= Blocks checkout? =

v1 is built for classic checkout / order-pay receipt flow with Checkout.js. Native WooCommerce Blocks payment method support is planned for a later release.

== Changelog ==

= 1.0.0 =
* Initial release: Checkout.js modal/embed, checkout sessions, signed webhooks, PEN only.

== Upgrade Notice ==

= 1.0.0 =
Initial public release.
