=== Habibur Multi-Gateway Manager for WooCommerce ===
Contributors:      coderhabibur
Tags:              woocommerce, payment gateway, checkout, payment methods, conditional payment
Requires at least: 6.0
Tested up to:      7.0
Requires PHP:      7.4
Stable tag:        1.0.0
WC requires at least: 7.0
WC tested up to:      9.0
License:           GPLv2 or later
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Dynamically manage, sort, and apply conditional logic to WooCommerce payment gateways — no code needed.

== Description ==

**Habibur Multi-Gateway Manager** gives WooCommerce store owners full control over how payment gateways behave at checkout — without writing a single line of code.

Whether you want to reorder gateways, rename them for your audience, or hide specific methods based on cart value or customer type, this plugin handles it all from a clean, intuitive dashboard.

= Free Features =

**🔀 Drag-and-Drop Gateway Reorder**
Change the order payment methods appear on the checkout page. Simply drag and drop — no editing theme files required.

**✏️ Custom Gateway Labels**
Override the checkout title of any payment gateway. Rename "Stripe" to "Pay by Card", or "SSLCOMMERZ" to "Online Payment" — whatever fits your brand.

**⚙️ Conditional Rules (3 free condition types)**
Automatically hide a gateway when a condition is met:

* **Cart Total** — Hide COD when cart exceeds ৳5,000
* **User Role** — Hide a gateway for wholesale or guest users
* **Product in Cart** — Hide a gateway when a specific product is in the cart
* **User Logged-In State** — Hide a method for guests or logged-in customers

**💳 SSLCOMMERZ Hosted Checkout (Built-in)**
Full, production-ready integration with SSLCOMMERZ:

* Hosted checkout redirect — no PCI-DSS scope on your server
* Sandbox (test) / Live mode switch from WooCommerce → Settings → Payments
* Server-to-server IPN validation — prevents spoofed callbacks
* Debug logging via WooCommerce → Status → Logs

= Pro Features (Coming Soon) =

Upgrade to Habibur Multi-Gateway Manager Pro for advanced control:

* Shipping method conditions
* Customer country / billing country rules
* Product category conditions
* Coupon code applied rules
* Day of week / time-based rules
* "Show only" action (hide all others, show one)
* Unlimited rules
* Priority ordering for rules
* Email / webhook notifications on rule trigger

[Get Pro →](https://habibur.net/habibur-multi-gateway-manager)

= Why Use This Plugin? =

Most stores have multiple payment gateways installed (card, COD, mobile banking). But WooCommerce doesn't let you:

* Control which gateway shows based on cart value
* Reorder gateways without code
* Rename gateway titles without editing plugin files

This plugin solves all three — cleanly and efficiently.

= Compatibility =

* WooCommerce HPOS (High-Performance Order Storage) compatible ✅
* Works with all standard WooCommerce payment gateways ✅
* Works with SSLCOMMERZ, aamarPay, SurjoPay, Stripe, PayPal, and more ✅
* No conflicts with page builders or other plugins ✅

== Installation ==

1. Upload the `habibur-multi-gateway-manager-for-woocommerce` folder to `/wp-content/plugins/`
2. Activate the plugin through the **Plugins** menu in WordPress
3. Go to **Gateway Manager** in the WordPress admin sidebar
4. Configure your gateway order, labels, and conditional rules

== Frequently Asked Questions ==

= Does this plugin work with any payment gateway? =

Yes. It works with any gateway registered through WooCommerce's standard `WC_Payment_Gateway` system, including third-party gateways like SSLCOMMERZ, aamarPay, SurjoPay, Stripe, PayPal, and more.

= Will my gateway order be overridden on updates? =

No. The order is saved in the WordPress database and is independent of plugin or theme updates.

= What happens if I delete a rule? =

The rule is permanently removed. The gateway will appear again on checkout as normal.

= Can I disable a rule without deleting it? =

Yes. Every rule has a toggle switch — you can enable or disable rules without deleting them.

= Does this slow down my checkout page? =

No. The plugin runs a lightweight filter on WooCommerce's available gateways list. There are no extra database queries beyond loading your saved settings.

= Is this compatible with WooCommerce HPOS? =

Yes, full compatibility is declared.

== External services ==

This plugin includes an optional, built-in payment gateway integration with SSLCOMMERZ, a third-party payment gateway aggregator based in Bangladesh. It is only active if you install this plugin and choose to enable and configure the SSLCOMMERZ gateway under WooCommerce → Settings → Payments.

When a customer chooses SSLCOMMERZ at checkout, the plugin sends order data (such as the order total, currency, transaction ID, and billing/shipping details required to process the payment) to SSLCOMMERZ's servers to create a hosted checkout session. The customer is then redirected to SSLCOMMERZ's hosted payment page to complete payment. After payment, SSLCOMMERZ sends a server-to-server callback (IPN) back to the store with the transaction status, which the plugin validates directly against the SSLCOMMERZ API before marking the order as paid.

Both a Sandbox (test) and Live mode are available and can be switched from the gateway's settings.

This service is provided by SSLCOMMERZ (Software Shop Limited): [Terms and Conditions](https://sslcommerz.com/terms-and-conditions/), [Privacy Policy](https://sslcommerz.com/privacy-policy/).

== Screenshots ==

1. Gateway reorder with drag-and-drop — change checkout order without code
2. Custom label editor — rename any gateway for your customers
3. Conditional rules builder — hide gateways based on cart total, user role, or product
4. Pro upgrade teaser — see what advanced conditions are available in Pro

== Changelog ==

= 1.0.0 =
* Initial release
* Added: SSLCOMMERZ Hosted Checkout payment gateway (free, built-in)
* Full IPN listener with server-to-server transaction validation
* Sandbox / Live mode toggle in WooCommerce payment settings
* Debug logging via WooCommerce Status → Logs (source: smgm-sslcommerz)
* Drag-and-drop gateway reorder
* Custom gateway labels
* Conditional hide rules: cart total, user role, product in cart, user logged-in state
* AJAX-powered admin interface
* WooCommerce HPOS compatibility declared

== Upgrade Notice ==

= 1.0.0 =
Initial release. No upgrade steps needed.
