=== ManiPay Manual Payment Gateway for FluentCart ===
Contributors: pxelcode, esratpopy
Tags: fluentcart, payment gateway, bkash, nagad, bangladesh
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.10
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A manual payment gateway for FluentCart: Mobile Banking (bKash, Nagad, Rocket), Bank Transfer with slip upload, and Crypto (RedotPay).

== Description ==

**ManiPay** integrates with FluentCart's documented custom payment gateway framework (`AbstractPaymentGateway`) to offer a manual, Bangladesh-focused checkout: bKash, Nagad, Rocket, four major banks with slip upload, and RedotPay.

This is a **manual** gateway — there is no live API connection to bKash/Nagad/Rocket/the banks/RedotPay. After checkout, the customer is sent to a dedicated on-site payment page (no theme header/footer) where they pick a method, send the money themselves, and submit their Transaction ID. The order stays in its normal pending state until you verify the transaction and mark it paid from FluentCart's own Order Details screen.

### Features

* Mobile Banking (bKash, Nagad, Rocket), 4 banks with slip upload, Crypto (RedotPay)
* Optional QR code per method (paste an image URL in settings)
* Single global on/off switch for iBanking and for Crypto — individual methods inside each show automatically once you fill in their account details
* Editable instruction text per tab, including Bangla
* Same visual design as the EDD and Tutor LMS versions of ManiPay
* Submitted Transaction ID is written to the transaction's Gateway ID field, so it's visible directly on FluentCart's Order Details screen — no separate admin page to check

### Built from FluentCart's official developer docs

Unlike some of the sibling ManiPay plugins (for Tutor LMS in particular), this one is built directly against FluentCart's public developer documentation (dev.fluentcart.com) and the real open-source PayStack-for-FluentCart reference gateway, not reverse-engineered from a single third-party plugin. Confidence is higher, but as with any integration, **test a full purchase end to end on staging** before relying on it in production — checkout → redirected to the on-site payment page → submit a Transaction ID → confirm it shows correctly on the Order Details screen → mark the order paid manually.

== Installation ==

**Upgrading from "RosidPay for FluentCart"?** Your settings are stored by FluentCart's own Meta table, keyed by the gateway's methodHandler string (unchanged in this rename), so they'll carry over automatically:

1. Deactivate and delete "RosidPay for FluentCart" as normal — no special steps needed, this plugin has no uninstall routine that touches your saved settings.
2. Install and activate this plugin (`manipay-manual-payment-for-fluentcart`).
3. Confirm your settings are still there at FluentCart > Settings > Payment Methods > ManiPay.

**Fresh install:**

1. Upload the `manipay-manual-payment-for-fluentcart` folder to `/wp-content/plugins/`, or install via Plugins > Add New > Upload Plugin.
2. Activate the plugin. FluentCart must already be installed and active.
3. Go to **FluentCart > Settings > Payment Methods** and enable **ManiPay**.
4. Fill in your bKash/Nagad/Rocket numbers, bank details, and crypto IDs.

== Frequently Asked Questions ==

= Does this process payments automatically? =
No. This is a manual payment gateway. You must verify the Transaction ID or slip yourself and mark the order as paid from FluentCart's Order Details screen.

= Where do I see the Transaction ID the customer submitted? =
On the order's Details screen, in the transaction table's "Gateway ID" column.

== Changelog ==

= 1.0.10 =
* Removed the Binance Pay option — Crypto now offers RedotPay only.

= 1.0.9 =
* Fixed WordPress.org review feedback:
  - Fixed nonce verification to sanitize input first: `wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST[...] ) ), ... )` instead of passing `$_POST` directly.
  - Note: the FluentCart gateway slug (`pxelcode_pay`) and `$methodHandler` string are intentionally NOT part of this renaming — those are the keys FluentCart uses to store your settings, and changing them would silently reset your configuration. They aren't global PHP identifiers in the sense the review comment was about.

= 1.0.8 =
* Renamed from "RosidPay for FluentCart" to "ManiPay Manual Payment Gateway for FluentCart" (slug and text domain also updated: manipay-manual-payment-for-fluentcart). The gateway slug and $methodHandler string FluentCart uses to store your settings were deliberately left unchanged, so existing configurations carry over automatically — see Installation for how to switch over.

= 1.0.7 =
* Fixed a critical bug: orders could not be placed when ManiPay was selected (especially noticeable when it was the only enabled payment method). FluentCart's checkout requires every gateway to enqueue a script that listens for its "fluent_cart_load_payments_{slug}" event and explicitly calls paymentLoader.enableCheckoutButton() once ready — this was missing entirely (getEnqueueScriptSrc() returned an empty array on the incorrect assumption that a plain redirect gateway needs no JS). Added assets/js/rosidpay-checkout.js to handle this.

= 1.0.6 =
* Fixed the auto-reload-after-save script added in 1.0.5 — it was matching button text "Save Changes", but FluentCart's actual button says "Save Settings", so it never fired. Corrected.

= 1.0.5 =
* Enabling/disabling bKash, Nagad, Rocket, iBanking, or Crypto no longer needs a manual page refresh to reveal or hide the relevant fields — clicking "Save Changes" in FluentCart's payment settings now automatically reloads the page once the save completes.

= 1.0.4 =
* Fixed: bKash/Nagad/Rocket number+QR fields, and all bank/crypto detail fields, were rendered unconditionally in the settings screen regardless of whether that method was enabled. Each method's detail fields now only appear once it's enabled and saved — e.g. tick "Enable bKash", save, reload, and the bKash Number/QR fields appear. Leave it off and those fields don't exist on the page.
* Changed default: only bKash is enabled out of the box now (previously bKash + Nagad). Nagad, Rocket, iBanking, and Crypto all default to off.

= 1.0.3 =
* Renamed from "PxelCode Pay for FluentCart" to "ManiPay Manual Payment Gateway for FluentCart" (slug and text domain also updated). The gateway slug and $methodHandler string FluentCart uses to store your settings were deliberately left unchanged, so existing configurations carry over automatically — see Installation for how to switch over.

= 1.0.2 =
* Fixed: settings (bKash number, is_active toggle, all other fields) weren't saving/persisting. The 1.0.1 fix stopped the crash but read/wrote settings via a WP option that FluentCart never touches — FluentCart actually stores gateway settings in its own Meta table (keyed by $methodHandler) and auto-loads them into the parent class's public $settings property before your code runs. get()/getMode()/isActive() now correctly read from that property instead of a nonexistent option.

= 1.0.1 =
* Fixed critical error: BaseGatewaySettings on current FluentCart versions has abstract methods get(), getMode(), and isActive() that must be implemented — the official docs' example omits them, but the real installed class requires them. Added self-contained implementations backed by a WP option keyed by $methodHandler.

= 1.0.0 =
* Initial release.
