=== MerchantPaisa Payments for WooCommerce ===
Contributors: merchantpaisa
Tags: woocommerce, payments, merchantpaisa, hosted checkout
Requires at least: 6.6
Requires PHP: 8.1
Stable tag: 1.0.3
License: GPL-3.0-or-later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

MerchantPaisa hosted payments, channel controls, verified order updates and refunds.

== Description ==

Connect your MerchantPaisa account using its Authorization Key and Transaction Key.
Choose card, Google Pay, JazzCash, Easypaisa and Pakistan QR channels. Availability
depends on merchant approval, assigned processors, currency and transaction amount.

Supports classic checkout, Checkout Blocks, HPOS and legacy order storage. Payment
data is entered on MerchantPaisa hosted checkout. This plugin does not collect card
numbers or security codes. Signed webhooks trigger authenticated status checks.

IMPORTANT: Your MerchantPaisa API deployment must include the version 1 WooCommerce
integration endpoints. The plugin ZIP alone does not install the API bridge.

This is a MerchantPaisa integration. It is not a Stripe product or certification.

== Installation ==

1. Install and activate WooCommerce and ensure PHP OpenSSL is enabled.
2. Upload this ZIP through WordPress > Plugins > Add New > Upload Plugin.
3. Open WooCommerce > Settings > Payments > MerchantPaisa.
4. Select Test and enter the supplied API URL, Authorization Key and Transaction Key.
5. Choose Save & connect. Your public HTTPS store webhook is registered automatically.
6. Select payment channels and enable MerchantPaisa in Checkout experience. Save.
7. Verify a sandbox payment and refund. Connect separate live credentials when ready.

WordPress must have a working scheduled-action runner and a publicly reachable HTTPS
REST endpoint. Keep the store currency consistent with the verified connection.
Billing phone is required while the connected gateway is enabled.

== External service and privacy ==

The plugin sends the merchant keys to the API URL configured by the administrator
to obtain a server-side session. Checkout sends order reference, total, currency,
customer name, email, phone, selected methods and a return URL to MerchantPaisa.
The API also receives the store webhook URL and refund requests when initiated.
Merchant keys and webhook secrets are encrypted in WordPress options. Order metadata
retains payment references and reconciliation information for accounting purposes.
Deactivation or deletion does not erase financial records or saved settings.
Include MerchantPaisa and its payment processors in your store privacy disclosures
under the merchant agreement supplied during onboarding.

== Frequently Asked Questions ==

= Does enabling a channel activate it on my merchant account? =
No. The backend verifies merchant and processor eligibility for every checkout.

= Are payment channels shown directly on the WooCommerce page? =
WooCommerce shows MerchantPaisa as one payment option. Eligible selected channels
appear on the next, hosted checkout page.

= Are subscriptions and saved cards supported? =
Version 1 supports one-time payments. Subscriptions, saved cards, BNPL, Apple Pay,
express wallet buttons and capture/void controls are not included.

= Can I refund every channel? =
Full and partial API refunds are available for supported, fully captured card
payments. PakWallet and converted payments require provider-side refund handling.
An uncertain refund remains pending until its original request is reconciled.
Review restocking after an interrupted synchronous refund; it is not repeated blindly.

= What if a payment arrives after an order was closed? =
The order moves to On hold for merchant review. It is not automatically fulfilled.

== Changelog ==

= 1.0.3 =
* Show the pending refund amount and existing request identity on the order.
* Add refresh guidance without suggesting a replacement refund.
* Deploy the companion API fix for identity-checked Visa refund inquiries.

= 1.0.2 =
* Update the companion API for native ecommerce 3DS and return-to-store checkout.
* Fix the 12 API contract failures and preserve authorization behind repository boundaries.
* Document the required PostgreSQL migration and current sandbox/refund evidence.

= 1.0.1 =
* Bring forward delayed order checks when a signed payment notification arrives.
* Preserve the earliest wakeup with Action Scheduler and WP-Cron, including retries.
* Reset checkout retry state and polling backoff; deploy the updated API bridge to
  distinguish reopened checkouts from their previous declined payment attempt.
* Make stock review explicit when recovering an interrupted existing refund.
* Accept PascalCase and camelCase webhook registration and endpoint responses.
* Distinguish confirmed refund rejection from outcomes awaiting reconciliation.
* Deploy the companion API fixes for refund validation and settlement processor lookup.

= 1.0.0 =
* Initial release with encrypted connections, channel switches, hosted checkout,
  signed notifications, background reconciliation and supported payment refunds.
