=== NakoPay Crypto Payment Buttons ===
Contributors: nakopay
Tags: bitcoin, crypto payments, donations, lightning, payment button
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.2.0
License: MIT
License URI: https://opensource.org/licenses/MIT

Crypto pay buttons and donation buttons for any WordPress site. Paid in Bitcoin, Lightning, USDT and more, straight to your own wallet.

== Description ==

Add a "Pay with crypto" or "Donate" button to any post or page, with a shortcode or the NakoPay Pay Button block. The checkout opens in a popup on your page: the customer picks the coin and network, scans the QR code, and sees the payment confirmed live. The money goes to the wallet you connected in your NakoPay account. NakoPay never holds your funds.

* `[nakopay_button amount="25" currency="USD" description="T-shirt"]` for a fixed price.
* `[nakopay_donate currency="USD" suggested="5,25,100"]` for donations: the donor taps a suggested amount or types their own.
* The "NakoPay Pay Button" block with amount, currency, label, style and popup settings.
* `popup="no"` opens the checkout in a new tab instead of a popup. Without JavaScript the button is a normal link.
* Each button reuses one payment link (cached for 12 hours), so page views never create new links.
* Setup problems (missing API key, wrong amount) are shown to admins only, never to visitors.
* Optional webhook receiver: verified NakoPay events are stored and passed to the `nakopay_event` action for your own code.

Pricing: 1% + $0.05 per payment, and your first payments are free. There is no monthly fee. See [nakopay.com/pricing](https://nakopay.com/pricing).

Running a WooCommerce store? Install "NakoPay for WooCommerce" for the checkout. Both plugins can be active together.

== External services ==

This plugin uses the NakoPay service to create payment links and take payments. A NakoPay account is required.

* **NakoPay API** (`https://api.nakopay.com/v1/`): when a page with a button or donation shortcode is shown and no cached link exists, the plugin creates a payment link by sending the amount (empty for donations), currency, description, the post ID and your API key. "Test connection" on the settings page calls `keys-list` with your API key. Nothing about your visitors is sent by the plugin.
* **NakoPay popup script** (`https://nakopay.com/button.js`): loaded on pages that show a popup button. It opens the NakoPay checkout (`https://nakopay.com/l/...`) in a popup when the visitor clicks. The visitor's payment details are entered on NakoPay, not on your site.
* **Webhooks**: if you add the webhook URL from the settings page in your NakoPay dashboard, NakoPay sends signed payment events to your site.

NakoPay [Terms of Service](https://nakopay.com/terms) and [Privacy Policy](https://nakopay.com/privacy).

== Installation ==

1. Install from Plugins, Add New (search "NakoPay"), or upload the zip in Plugins, Add New, Upload Plugin. Activate it.
2. Sign up at [nakopay.com](https://nakopay.com/signup), connect your wallet, and create an API key in Dashboard, API keys.
3. In Settings, NakoPay, paste the secret API key (sk_test_ for testing, sk_live_ when you are ready) and click "Test connection".
4. Add `[nakopay_button amount="10"]` to a page, or insert the NakoPay Pay Button block.

== Frequently Asked Questions ==

= Does NakoPay hold my money? =

No. Payments go straight to the wallet you connected in NakoPay. NakoPay's fee is charged to a prepaid credit balance in your NakoPay account, never taken from the payment.

= Which coins can customers use? =

The coins you switch on in your NakoPay dashboard. Bitcoin (on-chain and Lightning), Litecoin, Dogecoin and USDT are typical. The current list is at [nakopay.com](https://nakopay.com).

= Can I open the checkout in a new tab instead of a popup? =

Yes. Add `popup="no"` to the shortcode, or switch off "Open the checkout in a popup" in the block settings.

= How do I test without real money? =

Use a `sk_test_` API key. Click your button, then press "Simulate payment" in the checkout.

= Does it work with page caching? =

Yes. The button is a plain link to a reusable payment link, so cached pages keep working.

== Screenshots ==

1. A pay button and a donate button on a page.
2. The checkout popup: amount, coin and network choice, QR code.
3. The settings page with Test connection.

== Changelog ==

= 1.2.0 =
* New name on WordPress.org: NakoPay Crypto Payment Buttons (text domain nakopay-crypto-payment-buttons).
* Buttons open the NakoPay checkout in a popup (popup="no" for a new tab).
* Donations: one button, the donor taps a suggested amount or types their own in the checkout.
* Fix: a fatal error when NakoPay for WooCommerce was active at the same time (shared class name). All classes are now prefixed NakoPay_WP_.
* Fix: the block's editor script loads on every WordPress version from 6.0.
* "Test connection" button, Settings link on the Plugins screen, uninstall cleanup.
* Setup messages are shown to admins only. All text is translatable.
* Compatibility: WordPress 6.0 to 7.1, PHP 7.4 to 8.4.

= 1.1.2 =
* Release packaging.

= 1.1.1 =
* Donation form fix; payment links are cached instead of created on every page view.

== Upgrade Notice ==

= 1.2.0 =
Buttons now open the checkout in a popup, and the plugin can run beside NakoPay for WooCommerce.
