=== Moflare for WooCommerce ===
Contributors: moflare
Tags: usdt, usdc, stablecoin, crypto payments, payment gateway
Requires at least: 6.3
Tested up to: 7.1
Requires PHP: 7.4
WC requires at least: 8.0
WC tested up to: 11.3
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take payment in USDT and USDC straight into your own wallet. Customers pay from any wallet and network; Moflare never holds the money.

== Description ==

Add "Pay with USDT or USDC" to your WooCommerce checkout.

* **Paid straight to your wallet.** Moflare is non-custodial: it never holds, receives or controls your money. Payments go from the customer's wallet to yours.
* **Customers pay the way they already can.** Tron, BNB Chain, Solana, Base, Arbitrum and Ethereum, in USDT or USDC. A customer with a different coin or network is converted on the way, inside the same checkout. A customer with no gas can pay the network fee from their USDT or USDC.
* **Your currency, your rate.** Prices in shillings, euros or any of about 160 currencies are turned into a USDT/USDC amount at the rate you choose: today's market rate, the market rate plus or minus a percentage, or your own rate (for example 1 USD = ₦1,600). Stores priced in dollars need no rate: $20 is 20 USDT.
* **Orders update themselves.** Moflare confirms each payment from the blockchain; the order moves to Processing and the usual WooCommerce emails go out. Underpaid orders go On hold with a note.
* **Safe settings.** Where you get paid is set in your Moflare business dashboard and signed with your wallet. Someone who gets into your WordPress admin can't redirect your payments.
* **Private.** The plugin sends Moflare only the order total, currency and a reference. No names, emails, phone numbers or addresses.
* Works with the block-based checkout and the classic checkout, and with WooCommerce's order tables (HPOS).

= Fees =

Moflare charges the seller 1.5% of each sale, shown and settled in the business dashboard. Customers pay no extra fee to you: only their own network fee, shown before they approve.

= What it can't do =

* **Refunds** are sent from your own wallet (Moflare never holds your money, so it can't send it back for you). Mark the order refunded in WooCommerce afterwards.
* **Subscriptions** (WooCommerce Subscriptions) aren't supported: every payment is approved by the customer.

= Works alongside your other payment methods =

* Adds itself to the list of payment methods; never removes, hides or reorders the others.
* Only ever reads or changes orders paid with Moflare. Card, PayPal, bank transfer and cash on
  delivery orders, their statuses, emails and refunds are left entirely to their own plugins.
* Never slows down checkout: no request to Moflare is made while a customer is on the checkout
  page (exchange rates are refreshed in the background).
* If a customer starts paying with Moflare, switches to a card, and later also pays the Moflare
  link, the plugin leaves a note on the order so you can refund one payment. It changes nothing
  else.

== External services ==

This plugin connects to Moflare (https://www.moflare.com), the service that runs the checkout and confirms payments on the blockchain. Without it the plugin can't take payments.

* **Connecting your shop** (when you click Connect with Moflare): your site's address, its name and its return address are sent to Moflare, and Moflare sends back the shop's own API key.
* **Each Moflare payment** (when a customer chooses Moflare at checkout): the order total in US dollars, the shop currency and an order reference (the order number plus a short code) are sent to Moflare, which returns a payment link. No names, emails, phone numbers or addresses are sent.
* **Checking payments** (when a customer returns, and every 5 minutes for unpaid Moflare orders, for up to 3 days): the order reference is sent to Moflare, which returns the payment status, amount and transaction id.
* **Exchange rates** (in the background, a few times a day, only for stores not priced in US dollars): a request with no shop data is sent to Moflare, which returns today's market rates.
* **Disconnecting**: the shop's key is switched off at Moflare.

The customer pays on Moflare's checkout page (www.moflare.com), from their own wallet.

Moflare's terms: https://www.moflare.com/terms/ — privacy policy: https://www.moflare.com/privacy/

== Installation ==

1. In WordPress: Plugins → Add New, search for "Moflare", then Install and Activate. (Or Upload Plugin with `moflare-for-woocommerce.zip`.)
2. Open WooCommerce → Settings → Payments → Moflare and click **Connect with Moflare**.
3. Moflare opens with your shop filled in. Sign in with your wallet and tap **Connect**. Your payment page is made for you and you come straight back, connected.

That's all: nothing to copy or type. Optional settings (exchange rate, minimum order, wording) already have sensible defaults. You can disconnect at any time, from the plugin or from your Moflare dashboard (Website & shop).

Place a small test order (about $1–2) to see it work. To try everything without your live account first, use "try it first on Moflare's test site" under the button.

== Frequently Asked Questions ==

= Does Moflare hold my money? =

No. Customers pay your wallet directly. Moflare only shows the checkout and checks the blockchain.

= What if a customer closes the tab after paying? =

The plugin checks waiting orders with Moflare every 5 minutes, so the order still updates. You can also use "Check Moflare payment now" in the order's actions.

= What if a payment arrives after WooCommerce cancelled the order? =

The order is marked paid anyway (the money is yours), with a note asking you to check stock.

= Which exchange rate is used? =

Only stores priced in a currency other than US dollars need one (1 USDT = 1 US dollar, so a dollar store's $20 is always 20 USDT). You choose in the settings:

* **Today's market rate** — Moflare's daily rate for about 160 currencies, refreshed every few hours.
* **Market rate, plus or minus a percentage** — +5 means customers pay 5% MORE USDT than at the market rate (you receive 5% more); −5 means 5% less. Allowed: −20 to +50.
* **My own rate** — how many of your currency make ONE US dollar (for example 1600 if $1 = ₦1,600).

So you're never short-changed by confusion:

* The settings show the rate in use and a worked example in your currency: what the customer pays, what arrives in your wallet, and Moflare's fee.
* The checkout shows the customer the exact USDT amount and rate, and Moflare is asked for exactly that amount. The order notes record the amount, the rate and which kind of rate.
* Amounts are rounded up to the cent, never down.
* An own rate under half or over double the market rate (a typo, or typed the wrong way round) can't be saved. If the market later moves that far, Moflare is hidden at checkout until you update it.
* If the market moves so that your own rate makes customers pay more than 10% fewer USDT than at the market rate, every WordPress admin page warns you.
* Your own rate only ever applies to the currency you set it for. A currency-switcher plugin showing euros uses the euro market rate.
* Market rates more than 2 days old are never used: Moflare is hidden at checkout until fresh rates arrive.
* A payment that is less than the order needs, including one made through an older payment link after the order total went up, puts the order On hold with a note of what's missing. It is never marked paid.

== Screenshots ==

1. The settings screen: connect your store to Moflare in one click, then choose the name at checkout, a minimum order and the exchange rate.

== Changelog ==

= 1.0.2 =
* Admin notices are limited to where they matter: the exchange-rate warning shows only on WooCommerce's payment settings and order screens, and can be dismissed; the "WooCommerce needed" notice shows only on the Plugins screen.
* Translations load automatically from WordPress.org.

= 1.0.1 =
* Safer order checks: one check at a time per order, the return page can't be reloaded to use up the shop's checks, and an order whose total was raised after the payment link is held as short, never marked paid.

= 1.0.0 =
* First release.
