=== NoCustPay for Paid Memberships Pro ===
Contributors: nocustpay
Tags: crypto, payments, memberships, bitcoin, usdt
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: paid-memberships-pro
Stable tag: 2.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept crypto payments (USDT, USDC, ETH, BTC) for Paid Memberships Pro membership levels through NoCustPay.

== Description ==

NoCustPay for Paid Memberships Pro adds a crypto payment gateway. At checkout the member is sent to a NoCustPay payment page, pays in the coin of their choice, and the membership is activated when NoCustPay confirms the payment.

* Works with one-time membership levels. Recurring levels are not supported by this gateway.
* Overpaid payments are accepted with an order note; underpaid payments put the order in review; expired or cancelled payments fail a waiting order.
* A payment is recorded once, as the order's payment transaction id, however many times it is reported.
* Payments that arrive after an order was cancelled reopen it and complete the checkout.

= External service =

This plugin connects to the NoCustPay API (https://api.nocustpay.com) to create and verify crypto payments. It is required for the plugin to work.

Data sent when a member chooses to pay: the member's name and email address, the order total and currency, an order description ("Order #code - site name"), the order code, the plugin version, a site fingerprint (a short hash of your site address, so a payment made on another site that shares your NoCustPay account is ignored), and three URLs on your site (success, cancel, webhook). The plugin also sends your API key with every request, and asks NoCustPay for the checkout session's status when the member returns to your site.

NoCustPay sends signed webhooks to your site when a payment changes status.

* Terms of service: https://nocustpay.com/terms
* Privacy policy: https://nocustpay.com/privacy

== Installation ==

1. Upload the plugin zip in Plugins > Add New > Upload, and activate it. Paid Memberships Pro must be active.
2. Go to Memberships > Settings > Payment Gateway & SSL, choose the NoCustPay gateway and save.
3. Open the gateway's settings, enter the API key (needs the payments:write and payments:read permissions) and the webhook signing secret from the Webhooks page of your NoCustPay dashboard, and save.

== Frequently Asked Questions ==

= Which currencies are supported? =

USD EUR GBP CAD AUD JPY CNY KRW INR BDT PKR LKR NPR IDR MYR SGD THB PHP VND AED SAR TRY EGP NGN KES GHS ZAR BRL MXN ARS COP. Checkout reports the method as unavailable for other currencies.

= Can I sell recurring memberships? =

No. Crypto payments are one-off, so checkout with this gateway is refused for levels with a recurring billing amount.

= Where are errors logged? =

In the PHP error log, with entries starting with [nocustpay]. API failures are always logged; request and payment statuses are logged only when the debug log is on.

== Changelog ==

= 2.0.0 =
* Uses NoCustPay checkout sessions; the customer returns with session_id.
* Webhooks answer 401, 200 or 500 so failed deliveries are retried.
* Orders are updated inside a per-order lock.
* The API base URL setting is removed.

= 1.0.0 =
* First release.
