=== Mojibur Bank Transfer Gateway ===
Contributors: fmojibur
Tags: woocommerce, payments, wise, bank-transfer, checkout
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv3 or later
License URI: https://www.gnu.org/licenses/gpl-3.0.html

Accept Wise bank transfers in WooCommerce with geo-scoped accounts, locale-aware labels, unique references, email instructions, and Blocks support.

== Description ==

**Mojibur Bank Transfer Gateway** lets your customers pay by bank transfer to your Wise account. The plugin adds a "Pay by Bank (Wise)" option at checkout that works in **both** the classic shortcode-based checkout and the modern React-based Cart & Checkout Blocks.

_Not affiliated with or endorsed by Wise. "Wise" is a trademark of Wise Payments Limited._

= Highlights =

* **Geo-scoped multi-currency accounts** — configure separate Wise account details per currency / per country / per continent (e.g., USD for US&CA, EUR for EU, GBP for GB)
* **Locale-aware labels** — the field name adapts to the customer's billing country: "Sort code" for the UK, "BSB" for Australia, "IFSC" for India, "Transit number" for Canada, etc.
* **Currency selector (optional)** — let customers pick which currency they pay in; the matching Wise account is shown after checkout
* **Unique reference numbers** — every order gets a reference like `WISE-1042-A7F3`
* **Automated email instructions** — bank details + reference appended to on-hold/pending order emails (HTML + plain text)
* **Thank-you page** — clear, copy-to-clipboard layout with your account details
* **HPOS compatible** — works with WooCommerce custom order tables
* **Block checkout compatible** — works in the new React-based checkout, not just the legacy shortcode

= Security =

This plugin handles money, so security is non-negotiable:

* All admin actions enforce `manage_woocommerce` capability and use WordPress nonces
* All customer-facing output is escaped with `esc_html` / `esc_attr` / `esc_url` / `wp_kses_post`
* All admin input is sanitised with `wc_clean` / `sanitize_text_field` / `sanitize_textarea_field`
* Singleton class is `final` and blocks cloning/unserialising
* Optional "Wipe configuration" toggle controls whether settings survive an uninstall

= How it works =

1. Customer chooses **Pay by Bank (Wise)** at checkout and places the order.
2. The order is set to **On hold** with a unique reference like `WISE-1042-A7F3`.
3. The customer sees the matching Wise bank details (locale-aware labels) on the order-received page.
4. The same details are emailed to the customer (HTML + plain text).
5. Once funds arrive in your account, you mark the order **Processing** / **Completed**.

== Installation ==

1. Upload the `mojibur-bank-transfer-gateway` folder to `/wp-content/plugins/` **or** install via *Plugins → Add New → Upload Plugin*.
2. Activate the plugin from the *Plugins* menu.
3. Go to *WooCommerce → Settings → Payments → Mojibur Bank Transfer*.
4. Enable the gateway, set Title/Description/Instructions, fill in the Account holder, and add at least one row in the **accounts** table.

== Frequently Asked Questions ==

= Do I need a Wise business account? =
No. This plugin works with any Wise or bank account — you simply enter the bank details your provider gave you.

= How does the geo-scoped account selection work? =
Each row has a **Scope** (comma-separated WC country/continent codes) and a **Currency**. When a customer's order is placed, the plugin shows the row whose Currency matches the order currency, OR whose Scope matches the customer's billing country/continent. If multiple match, all matches are shown. If nothing matches, rows with empty Scope are used as a global fallback.

= Can the plugin confirm payments automatically? =
No. You confirm transfers in your own Wise or bank account and update the order status manually.

= Is the plugin translation-ready? =
Yes. All strings are internationalized. Text domain: `mojibur-bank-transfer-gateway`.

== Screenshots ==

1. Gateway settings — global options (title, description, instructions, account holder, currency selector toggle).
2. Wise accounts table — geo-scoped multi-currency repeater inside the gateway settings.
3. Customer-facing thank-you page with copyable bank details and a bank-transfer icon.
4. On-hold order email with bank-transfer instructions.

== Changelog ==

= 1.0.0 =
* Initial release.
* Geo-scoped multi-currency Wise accounts (Country/Continent/Currency).
* Locale-aware labels (Sort code, BSB, IFSC, Transit number, ...).
* Unique reference generation.
* Customer-facing currency selector (optional).
* HPOS + Cart/Checkout Blocks compatibility.
* Brand SVG logo.
* Optional "Wipe configuration" on uninstall.
* Fully internationalized and translation-ready.

== Upgrade Notice ==

= 1.0.0 =
Initial release of Mojibur Bank Transfer Gateway.
