=== DPay for WooCommerce ===
Contributors: dpay, downlabs
Tags: woocommerce, payment gateway, pakistan, bank transfer, easypaisa, jazzcash
Requires at least: 6.2
Tested up to: 7.1
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 Easypaisa, JazzCash, NayaPay and bank-transfer payments in Pakistan, verified automatically, straight into your own account.

== Description ==

DPay is a bank-transfer payment gateway for Pakistan. Your customer pays from the app they already use — Easypaisa, JazzCash, SadaPay, NayaPay or any bank — into your own NayaPay or Meezan Bank account. DPay reads your bank's own alert, checks it six ways, and marks the WooCommerce order paid. No card, no merchant account, no percentage fee, no screenshots.

**What the plugin does**

* Adds "Bank transfer / Easypaisa / JazzCash" as a payment method, with the DPay logo, in both the classic and the block checkout.
* Sends the customer to DPay's hosted checkout for the order total (paisa rounded up to whole rupees, since no Pakistani transfer carries paisa).
* Marks the order paid the moment DPay verifies the transfer — by webhook, when the customer returns, and by a five-minute sync as a safety net — so it works even where webhooks cannot reach.
* Puts the DPay reference, bank and status on the order, with a "Check with DPay now" button.
* Registers its webhook with DPay automatically when you save your API key.
* Supports High-Performance Order Storage (HPOS).

**What you need**

* A DPay account (free plan available) with a receiving account and a connected inbox: https://dpay.com.pk
* Your shop currency set to PKR.

== External services ==

This plugin connects to the DPay API (https://api.dpay.com.pk) to create the hosted checkout for an order, to read a payment's status, and to register the shop's webhook. It sends the order total, the order number, the customer's name and email, and the shop's URL; DPay sends back the checkout address and, later, whether the transfer was verified. Nothing is sent until you save an API key. Terms: https://dpay.com.pk/terms · Privacy: https://dpay.com.pk/privacy

== Installation ==

1. Upload the `dpay-for-woocommerce` folder to `/wp-content/plugins/`, or upload the zip under Plugins → Add New → Upload Plugin.
2. Activate the plugin.
3. WooCommerce → Settings → Payments → DPay → paste your API key from https://dpay.com.pk/dashboard/developers and save. The plugin connects and registers its webhook by itself.
4. On the DPay Developers page, press "Send test event" next to your site's webhook to prove the connection.
5. Place a test order with a test key; the whole flow runs without moving money.

== Frequently Asked Questions ==

= Does money pass through the plugin or through DPay? =

No. The customer transfers directly into your own bank or wallet account. DPay only verifies that it arrived.

= Can I refund from WooCommerce? =

Refunds are ordinary transfers you make from your own bank, because DPay never holds the money. Record the refund in WooCommerce as usual; DPay's dashboard keeps the verified record.

= What if the customer closes the page before paying? =

The order stays pending with its DPay reference. They can pay it from My account → Orders; a transfer that lands late can still be honoured in the DPay dashboard.

== Changelog ==

= 1.0.1 =
* Settings save can no longer take the page down: connection errors become a message, and the two API calls it makes fit inside a shared host's 30-second limit.

= 1.0.0 =
* First release.
