=== Mintage Pay for Easy Digital Downloads ===
Contributors: mintagepay
Tags: payments, stablecoin, usdc, usdt, easy digital downloads
Requires at least: 6.4
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept USDC and USDT in Easy Digital Downloads through the Mintage Pay hosted payment page.

== Description ==

Mintage Pay sends your customer to a secure hosted checkout where they pay in stablecoins from a wallet or an exchange:

* USDC on Base, Polygon or Solana
* USDT on Polygon, Solana or TRON

A network appears at checkout only when you have set a payout address for it in the Mintage Pay dashboard.

When the payment is confirmed on chain, Mintage Pay notifies your store and the order is completed automatically, which sends the purchase receipt and unlocks the downloads.

Features:

* Signed webhooks (HMAC-SHA256 with a 5 minute timestamp window) on a REST route. The plugin never trusts a webhook body on its own: it always re-reads the invoice from the Mintage Pay API before changing an order.
* Partial payments put the order On Hold with a note showing what is still owed. If the payment window closes part paid, the order stays On Hold (never abandoned) so you can refund the customer or collect the rest.
* A full payment that arrives after an order was abandoned or failed is recorded and the order is put On Hold for you to review, never delivered automatically.
* A paid invoice whose amount or currency does not match the order puts the order On Hold instead of completing it.
* Expired invoices mark the unpaid order Abandoned; invoices you cancel mark it Failed.
* Bank transfer (ACH / wire, for approved stores): the order waits On Hold with the reference and due date, and completes when you record the money in Mintage Pay.
* Refunds you record in the Mintage Pay dashboard are noted on the order; a full refund also creates the Easy Digital Downloads refund record.
* Marking an order Failed, Abandoned or Revoked also cancels its open Mintage Pay invoice.
* Order details box with the invoice status and a Refresh link.

Prices can be in your store currency: USD, EUR, GBP, CAD, AUD, CHF, JPY, MXN, BRL, INR, SGD, AED, PLN, SEK, NOK, DKK, NZD, ZAR, TRY, KRW, HKD, NGN, ARS, PHP, IDR, VND, PKR, EGP, BDT, KES, GHS, TZS, COP, CLP, PEN, UYU, PYG, BOB, DOP, GTQ, CRC, THB, MYR, TWD, LKR, NPR, KZT, UAH, ILS, SAR, QAR, CZK, HUF, RON, ISK, XAF or XOF. Customers always pay in USD stablecoins; a price in another currency is converted to USD when they check out. In any other store currency the method stays hidden at checkout and an admin notice explains why.

== Installation ==

1. Upload the plugin and activate it (Easy Digital Downloads 3.0 or later must be active).
2. Go to Downloads > Settings > Payments > Mintage Pay and paste your API key (Mintage Pay dashboard: Developers > API keys). Saving checks the key and connects the webhook.
3. Under Downloads > Settings > Payments > General, tick "Mintage Pay" in Active Gateways.
4. Use a mp_test_ key first: it talks to the Mintage Pay sandbox with test money.

== Frequently Asked Questions ==

= Which currencies? =

USD, EUR, GBP, CAD, AUD, CHF, JPY, MXN, BRL, INR, SGD, AED, PLN, SEK, NOK, DKK, NZD, ZAR, TRY, KRW, HKD, NGN, ARS, PHP, IDR, VND, PKR, EGP, BDT, KES, GHS, TZS, COP, CLP, PEN, UYU, PYG, BOB, DOP, GTQ, CRC, THB, MYR, TWD, LKR, NPR, KZT, UAH, ILS, SAR, QAR, CZK, HUF, RON, ISK, XAF or XOF. The customer pays the converted amount in USDC or USDT, and the order note shows the rate used.

= Where is the webhook? =

`/wp-json/mintagepay-edd/v1/webhook`. It is registered with Mintage Pay automatically when you save a verified key. The settings screen shows its status and a Reconnect button.

= Are keys logged? =

No. The API key and the webhook secret are never written to the log.

== Changelog ==

= 1.3.0 =
* 36 more store currencies: NGN, ARS, PHP, IDR, VND, PKR, EGP, BDT, KES, GHS, TZS, COP, CLP, PEN, UYU, PYG, BOB, DOP, GTQ, CRC, THB, MYR, TWD, LKR, NPR, KZT, UAH, ILS, SAR, QAR, CZK, HUF, RON, ISK, XAF and XOF (57 in all). VND, CLP, PYG, ISK, XAF and XOF have no decimals.

= 1.2.0 =
* Renamed to Mintage Pay. API keys now start with mp_live_ / mp_test_ and webhooks are signed in the MintagePay-Signature header. The plugin's name changed with it, so this is a fresh install: remove the earlier plugin and connect this one with a new API key.

= 1.1.3 =
* Checkout no longer fails with "We could not start your stablecoin payment" when an order number repeats on one Mintage Pay account (a rebuilt store, or two stores on one account). The request key now carries the order's own key.

= 1.1.2 =
* Webhook event types the plugin does not handle (such as webhook.test from "Send test event") are verified, then answered 200 and ignored (was 400).

= 1.1.1 =
* Test keys (mp_test_...) always use the sandbox and live keys the live API, even when a standard API base URL was saved. A clear message explains a test key sent to the live API.

= 1.1.0 =
* Prices in the store currency: EUR, GBP, CAD, AUD, JPY and more are converted to USD at checkout.
* A paid invoice is matched on its price and currency. Refunds on non-USD orders are noted for you to record.

= 1.0.0 =
* First release.
