=== AniUPI – UPI QR Payment Gateway for WooCommerce ===
Contributors: aniupi
Tags: upi, qr code, woocommerce, payment gateway, india
Requires at least: 5.8
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 2.4.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept UPI payments in WooCommerce with AniUPI. Dynamic payment links and QR codes, transaction verification and automatic order status updates.

== Description ==

AniUPI lets your WooCommerce store accept UPI payments in INR with dynamic payment links and QR codes. Customers are redirected to a secure AniUPI payment page, and the order is marked paid automatically through a webhook, the thank-you page check, and a background re-check.

Features:

* Classic checkout, WooCommerce Checkout Blocks and HPOS compatible
* Automatic order status update (Processing or Completed)
* Webhook URL shown in settings (copy and paste it into your AniUPI developer settings)
* Order notes with Merchant Order ID, Gateway Order ID and UTR / Txn ID
* "AniUPI Payment" box on the order page with a "Check status now" button
* "UPI Txn / UTR" column in the orders list
* Pending orders are re-checked every 5 minutes and auto-failed after the timeout
* Amount mismatch protection (order goes On hold for manual review)

An AniUPI merchant account is required: https://aniupi.in

== Installation ==

1. Upload the plugin ZIP via Plugins > Add New > Upload Plugin and activate it. WooCommerce must be active.
2. Open https://aniupi.in/auth/developers, register or log in, and generate your API Token.
3. Go to WooCommerce > Settings > Payments > AniUPI > Manage.
4. Paste the API Token (use Show to view it), tick Enable and save.
5. Copy the Webhook URL from the settings page into your AniUPI developer settings.
6. Place a small test order.

Store currency must be INR.

== Frequently Asked Questions ==

= Where do I get the API Token? =
Register or log in at https://aniupi.in/auth/developers and generate your API Token there.

= Which currency is supported? =
INR only. The gateway is hidden at checkout for other currencies.

= Payment done but order still pending? =
Open the order and press "Check status now" in the AniUPI Payment box. Enable Debug log in the settings to see the gateway responses (the API Token is never written to logs).

= I used an older version of this plugin. Do I need to reconfigure? =
No. Deactivate the old version first, then activate this one. Your API Token, webhook secret and existing orders are migrated automatically, and the webhook URL you already saved in your AniUPI panel keeps working.

== External services ==

This plugin connects to the AniUPI service (https://aniupi.in) to create and verify UPI payments. Without this connection the plugin cannot work.

1. Create Order: https://aniupi.in/api/create-order is called when the customer clicks Place order. Data sent: your API Token, a unique order ID, the order amount, the return URL, the WooCommerce order number and order key (as reference remarks), and the customer billing mobile number if one was entered.
2. Check Order Status: https://aniupi.in/api/check-order-status is called to confirm payment (webhook, thank-you page, 5-minute background check, and the admin "Check status now" button). Data sent: your API Token and the order ID.

The customer is also redirected to the AniUPI-hosted payment page to complete the payment.

Service provider: AniUPI, https://aniupi.in
Terms of service: https://aniupi.in
Privacy policy: https://aniupi.in

== Privacy ==

The plugin stores the AniUPI order IDs and the UPI transaction reference (UTR) as order meta on your own site. It does not set cookies. The customer's billing mobile number is sent to AniUPI only when entered at checkout (see External services).

== Changelog ==

= 2.4.1 =
* Fixed WordPress.org plugin header validation by setting a plugin-specific Plugin URI (different from the Author URI).
* Updated plugin version metadata to 2.4.1.

= 2.4.0 =
* Plugin directory compliance: unique "aniupi" prefix for all functions, classes, hooks, options and order meta (existing settings and orders are migrated automatically)
* All strings are now English and translatable; admin and checkout scripts and styles are loaded from local files
* Logo and icon are loaded from the plugin folder instead of a remote server
* Fix: checkout icon was output as broken HTML
* Webhook input is sanitized; copy button uses the Clipboard API
* Requires PHP 7.4, tested up to WordPress 7.1

= 2.3.0 =
* AniUPI branding on the settings page
* API Token moved to the top, bigger, with Show/Hide, Copy and a Generate API Token link
* Removed Webhook Secret, API Base URL and Test connection fields (secret is still generated automatically)
* Admin scripts moved to a separate file, uninstall cleanup added

= 2.2.0 =
* Fix: Create and Status APIs now always use the same server (fixes "Order not found").
* New: order box, UTR column, richer order notes.

== Upgrade Notice ==

= 2.4.1 =
Plugin URI metadata fix. Plugin URI now points to the AniUPI WooCommerce plugin information page and differs from the Author URI.

= 2.4.0 =
Deactivate the previous AniUPI plugin before activating this version. Settings and orders are migrated automatically.
