=== India Payments for WooCommerce ===
Contributors: catcodestudio
Tags: razorpay, phonepe, paytm, upi, india
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Razorpay, PhonePe and Paytm in one plugin: UPI, cards and netbanking, every payment confirmed on the server before the order is marked paid.

== Description ==

One plugin for the three gateways Indian shops use most. Switch on one, two or all three — they live side by side and the buyer picks one at checkout. Works on the classic checkout and on the block checkout, with HPOS.

**Razorpay** — Standard Checkout window: UPI, cards, netbanking, wallets. Test keys (rzp_test_) run in test mode.

**PhonePe** — Payment Gateway, Standard Checkout v2: the buyer pays on the PhonePe page. UAT sandbox and production.

**Paytm** — Payment Gateway: the buyer pays on the Paytm page with UPI, Paytm wallet, cards or netbanking. Staging and production; the host is configurable for older merchant accounts.

= How an order becomes paid =

* The order is marked paid only after the gateway's own status API says the payment is complete — never on the strength of the redirect alone.
* Webhooks are checked: Razorpay by the HMAC signature of the body, PhonePe by the SHA256 of your webhook username and password, Paytm by the CHECKSUMHASH. A call that does not match is refused.
* The amount paid is compared with the order total; a mismatch puts the order on hold with a note instead of shipping it.
* The webhook and the buyer's return often arrive in the same second. A lock makes sure the payment is recorded once: one note, one stock reduction.
* A buyer who comes back while UPI is still settling sees "waiting for confirmation" and the page refreshes by itself, instead of an "order received" page on an unpaid order.
* If WooCommerce is about to cancel an unpaid order (hold-stock time), the gateway is asked first, so a late UPI payment does not end up on a cancelled order.
* Failed payment: the buyer goes back to the pay page with a plain message and can try again or choose another method; the order note keeps the gateway's reason.
* Each payment attempt gets its own reference with a prefix you choose, so two shops on one merchant account never collide.

Keys and secrets are stored encrypted. Errors from the gateways always go to the WooCommerce log (source catcode-india-payments); full request logging is a switch.

// @pro-begin
Buyer-facing messages are translated into Hindi.
// @pro-end

// @pro-begin
= Pro =

* Refunds from the order screen — full or partial — for all three gateways, with the refund status followed up until the gateway reports it done or failed (a failed refund gets a clear note).
* One payment journal for the three gateways: reference, transaction, UPI / card / netbanking, refunds, and a check against the gateway in one click.
* Background check of pending orders every 15 minutes: a payment whose webhook got lost still marks the order paid.
* Order-total limits per gateway — for example large orders only on the gateway with the lower fee.

Try Pro for 7 days from WooCommerce → India Payments: no card, it never starts by itself, and payments keep working after the trial. A licence for 1–5 years covers updates and support for its term; one key works on two sites (the shop and its test copy).
// @pro-end

== Installation ==

1. Install and activate the plugin. WooCommerce must be active, and the shop currency must be Indian rupee (INR).
2. Open WooCommerce → India Payments to see the three gateways, or WooCommerce → Settings → Payments.
3. For each gateway you use: enter the keys, save, press "Check connection".
4. Register the webhook URL shown on the settings screen in the gateway's dashboard (for Razorpay and PhonePe with the secret / username and password you type into the settings).

== Frequently Asked Questions ==

= Can I use Razorpay and PhonePe at the same time? =

Yes. The gateways share nothing at checkout; each has its own settings, references and webhook URL.

= Do I need the webhook? =

Orders are confirmed when the buyer comes back as well. The webhook covers buyers who close the tab after paying, and it is what PhonePe and Razorpay recommend.

= Which currencies? =

INR. The gateways stay hidden at checkout in a shop with another currency.

= Where are the logs? =

WooCommerce → Status → Logs, source catcode-india-payments.

== Changelog ==

= 1.0.0 =
* Razorpay Standard Checkout, PhonePe Standard Checkout v2 and Paytm in one plugin.
* Classic and block checkout, HPOS.
* Server-side confirmation through the status API of each gateway, signed webhooks, amount check, a lock against double recording, waiting screen for pending UPI payments.
// @pro-begin
* Pro: refunds with status follow-up, payment journal, background check of pending orders, order-total limits per gateway.
* Pro: updates from catcode.com.ua in Dashboard → Updates while the licence covers updates.
// @pro-end
