=== Alvan Labs Pay — UPI Gateway ===
Contributors: alvanlabs
Tags: upi, payment gateway, woocommerce, india, upi qr
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Zero-fee UPI auto-reconciliation payment gateway for WooCommerce by Alvan Labs.

== Description ==

Accept UPI payments directly into your bank account — zero transaction fees, zero MDR.

Alvan Labs Pay uses Gmail-based auto-reconciliation to match incoming UPI payments to orders. No payment gateway account, no KYC beyond a UPI ID.

**How it works:**
1. Customer places order → unique amount assigned (e.g. ₹1,500.07)
2. QR code displayed → customer scans and pays in any UPI app
3. Your bank emails a credit notification → Alvan Labs system detects it within ~60 seconds
4. WooCommerce order automatically marked "Processing" ✓

**Requirements:**
- An active Alvan Labs Pay merchant account (https://payments.alvanlabs.com)
- Your Merchant ID and API Key from the merchant dashboard

== Installation ==

1. Download the plugin zip file from https://payments.alvanlabs.com/merchant/dashboard
2. In WordPress Admin → Plugins → Add New → Upload Plugin
3. Upload the zip and click Install Now → Activate
4. Go to WooCommerce → Settings → Payments → Alvan Labs Pay
5. Enter your Merchant ID and API Key, then Save changes

== Frequently Asked Questions ==

= Do I need a payment gateway account? =
No. You just need a UPI ID linked to your bank and an Alvan Labs Pay merchant account.

= What UPI apps do customers use? =
Any UPI app — PhonePe, Google Pay, Paytm, BHIM, etc.

= How fast is payment confirmation? =
Usually 30–90 seconds after the customer pays.

= Does it work with Cash on Delivery? =
This plugin only handles UPI payments. You can keep CoD enabled alongside it.

= Is the plugin free? =
The plugin itself is free. You need an active Alvan Labs Pay merchant subscription to use it.

== External Services ==

This plugin communicates with the **Alvan Labs Pay API** (https://payments.alvanlabs.com) to:

1. **Initiate a payment session** — when a customer places an order, the plugin calls
   `https://payments.alvanlabs.com/api/v1/initiate-pay` with the order amount and
   your merchant credentials. This returns a unique UPI amount and payment link.

2. **Check payment status** — the customer's browser polls
   `https://payments.alvanlabs.com/api/v1/check-payment/{order_id}` every 5 seconds
   until the payment is confirmed or the session expires.

Data sent to the external service includes: order ID, order amount, merchant ID, and API key.
No personally identifiable customer data (name, address, email) is sent.

**Service terms:** https://payments.alvanlabs.com/terms
**Privacy policy:** https://payments.alvanlabs.com/privacy

This plugin also bundles **QRCode.js** (https://github.com/davidshimjs/qrcodejs, MIT licence),
which is used client-side to render the UPI QR code. No data is sent to any third party
by QRCode.js; it runs entirely in the customer's browser.

== Privacy Policy ==

This plugin does not store any customer personal data in the WordPress database beyond
standard WooCommerce order data. Payment session metadata (unique amount, UPI link,
expiry timestamp, merchant ID) is stored as WooCommerce order meta and is deleted when
the plugin is uninstalled.

Payment processing is handled by the Alvan Labs Pay service. Refer to the Alvan Labs
Privacy Policy at https://payments.alvanlabs.com/privacy for details on how payment
data is handled on their servers.

== Changelog ==

= 1.1.0 =
* Refactored to meet WordPress.org coding standards
* Moved inline CSS/JS to separate enqueued files
* Bundled QRCode.js locally (no CDN dependency)
* Added uninstall.php for proper cleanup
* Added External Services disclosure in readme
* Named functions replace anonymous closures
* Full i18n support via load_plugin_textdomain

= 1.0.0 =
* Initial release

