=== BD SecurePay Gateway for WooCommerce ===
Contributors: hasanmahmud
Donate link: https://bdsecurepay.com
Tags: payment gateway, bkash, nagad, rocket, upay, bangladesh, woocommerce, mfs, mobile banking
Requires at least: 5.8
Tested up to: 6.7
Requires PHP: 7.4
WC requires at least: 6.0
WC tested up to: 9.4
Stable tag: 1.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept automated bKash, Nagad, Rocket, and Upay payments directly in your WooCommerce store using BD SecurePay.

== Description ==

**BD SecurePay Gateway for WooCommerce** connects your online store directly with Bangladesh's most popular Mobile Financial Services (MFS). Enable your customers to pay quickly and securely via bKash, Nagad, Rocket, and Upay with instant transaction verification and automatic invoice settlement.

### Key Features
* **Automated Instant Verification:** Orders automatically move to Processing or Completed once the customer completes payment.
* **Full MFS Support:** Accept payments from bKash, Nagad, Rocket, and Upay.
* **Server-to-Server Webhook:** Ensures offline payments and delayed merchant approvals are confirmed seamlessly even if the customer closes their browser.
* **Dynamic Multi-Currency Conversion:** Seamlessly converts USD and other non-BDT store currencies into BDT with a custom exchange rate multiplier.
* **High-Performance Order Storage (HPOS) Ready:** 100% compatible with WooCommerce Custom Order Tables (HPOS).
* **Duplicate Payment Prevention:** Guards against duplicate order processing and race conditions.
* **Virtual & Digital Product Support:** Instant digital download access upon successful payment confirmation.
* **Detailed Audit Logs:** View complete transaction IDs, payment method, and timestamps directly on the WooCommerce Order Details screen.

== Installation ==

1. Download the `bdsecurepay.zip` plugin archive.
2. Log in to your WordPress Admin dashboard.
3. Navigate to **Plugins > Add New > Upload Plugin**.
4. Choose the `bdsecurepay.zip` file and click **Install Now**.
5. Click **Activate Plugin**.
6. Go to **WooCommerce > Settings > Payments > BD SecurePay**.
7. Enter your **API Key** and **Gateway Domain** (`https://bdsecurepay.com`).
8. Click **Save changes**.

== Frequently Asked Questions ==

= Do I need a BD SecurePay merchant account? =
Yes. You need an active merchant account on [BD SecurePay](https://bdsecurepay.com) to obtain your API credentials.

= Which currencies are supported? =
While BD SecurePay processes payments in Bangladeshi Taka (BDT), the plugin includes a built-in currency converter for stores using USD, EUR, GBP, or other currencies.

= Does this plugin support WooCommerce HPOS? =
Yes, the plugin is fully tested and declares full compatibility with WooCommerce High-Performance Order Storage (HPOS).

== Screenshots ==

1. WooCommerce Checkout page with BD SecurePay payment option.
2. BD SecurePay Admin Settings screen with Webhook URL and configuration options.
3. Order details view displaying Transaction ID and payment metadata.

== Changelog ==

= 1.2.0 =
* Added High-Performance Order Storage (HPOS) compatibility declaration.
* Added dynamic Gateway Domain / API URL input with auto-detection of create and verify endpoints.
* Added multi-currency auto-conversion for all non-BDT currencies with configurable exchange rate.
* Added instant webhook URL display banner inside WooCommerce payment settings.
* Updated default exchange rate multiplier to current market rates.
* Cleaned up sanitization and WordPress.org coding standard compliance.

= 1.1.0 =
* Added server-to-server webhook callback support.
* Added metadata JSON string decoding for reliable order resolution.
* Added Brand Key configuration support.
* Improved pending payment status handling.

== Upgrade Notice ==

= 1.2.0 =
Upgrades payment gateway endpoints to dynamic configuration and enables full WooCommerce HPOS compatibility.
