=== SecurePay Payment Gateway ===
Contributors: securepay
Tags: woocommerce, payment, bkash, nagad, rocket, upay, bangladesh, bd payment
Requires at least: 5.6
Tested up to: 6.7
Requires PHP: 7.2
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept all Bangladesh payments (bKash, Nagad, Rocket, Upay, Cellfin, Tap and more) through one premium branded checkout, with automatic verification.

== Description ==

SecurePay is the easiest way to accept Bangladesh mobile-banking payments in your WooCommerce store.

Your customers are redirected to a modern, responsive, fully branded checkout where they can pay with:

* bKash (Personal / Agent)
* Nagad (Personal / Agent)
* Rocket
* Upay
* Cellfin, Tap, Ipay, OK Wallet, mCash and more
* Bank transfer (Manually verified)

= Why merchants love it =

* Verification without your phone – SMS auto-match, no manual checking required.
* Buyers see a secure branded page – builds trust, raises conversion.
* Works with any currency – automatic BDT conversion or send your store currency.
* Webhook + return-callback both supported, so orders update even if the browser is closed.
* HPOS compatible and works with the new checkout blocks and classic checkout.
* One-click "Test connection" from the settings page.

= Features =

* WordPress + WooCommerce standard payment gateway integration
* Premium grouped settings with inline connection tester
* Automatic order verification via the SecurePay API (server to server)
* Legacy `?wc-api=` webhook plus a REST webhook endpoint
* TrxID stored on the order, payment method and amount recorded
* Debug logging (WooCommerce → Status → Logs → securepay)
* Filter `securepay_create_payment_args` for developers
* Fully translation-ready (`.pot` / Loco Translate friendly)

== Installation ==

1. Download the plugin zip from your SecurePay dashboard or this folder.
2. In WordPress go to Plugins → Add New → Upload Plugin, upload `securepay-gateway.zip`.
3. Activate the plugin.
4. Go to WooCommerce → Settings → Payments → SecurePay.
5. Add your **API Key** (from your SecurePay dashboard → My Websites → copy the API key).
6. Keep the default Payment Site URL.
7. Hit **Test connection** — you should see a green confirmation.
8. Enable the gateway and you are live.

== Frequently Asked Questions ==

= How do I get my API key? =

Log in to your SecurePay account → My Websites → copy the API key of the matching website that this WooCommerce store represents.

= My store currency is not BDT =

If you have the Currency Converter addon enabled, the checkout converts for you automatically — just leave "BDT Conversion Rate" at 0.
Otherwise enter the rate in the "BDT Conversion Rate" field so the order total is converted before being sent.

= Why is my order on-hold? =

Until a payment is verified, orders are held. On a successful verified payment the order moves to Processing (or Completed for digital products).

= I received a webhook but the order did not change =

Check WooCommerce → Status → Logs → securepay (enable Debug Log first). Ensure the API key on this store belongs to the same account that owns the website.

== Changelog ==

= 2.0.0 =
* Premium rebuild: grouped settings, connection tester, verify-before-complete, REST + legacy webhooks, return-callback handling, HPOS compatibility, debug logging.

== Upgrade Notice ==

= 2.0.0 =
This is a complete rewrite. Delete the legacy `securepaybd.php` plugin before activating. API key, Payment Site URL and checkout appearance must be re-entered in the new settings page.