=== Cryptoinfra for Easy Digital Downloads ===
Contributors: cryptoinfra
Tags: crypto, usdt, payment gateway, easy digital downloads, edd
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Take crypto for Easy Digital Downloads orders through the Cryptoinfra hosted checkout.

== Description ==

Your customer picks "Pay with crypto", is sent to the Cryptoinfra hosted checkout, pays,
and the order completes on its own. The price is in US dollars; the customer pays the
equivalent in the coin they choose. The money lands in your Cryptoinfra balance.

* One payment per order. Paying twice, or a webhook delivered twice, never completes an order twice.
* Every webhook is verified (HMAC-SHA256) and the payment is then re-read from the API —
  the order moves on what the API says, never on the webhook body alone.
* The return page re-reads the payment too, so a blocked webhook still completes the order.
* Underpaid or late payments put the order On Hold with a note for you to decide.
* Expired payments mark the order Failed — never one that is already complete.

= Embedded payment page =

Downloads → Settings → Payments → Cryptoinfra → "Payment page": "Redirect to the payment page"
(the default) sends the customer to the Cryptoinfra payment page. "Embedded on your site" keeps them on your store: they pay on your
purchase confirmation page, inside your theme, in a frame that fits the page, and once paid they
land on the confirmation itself. The link to that page carries the order's purchase key, so nobody
else can open it. "Embedded theme" picks Light, Dark or Automatic (follows the customer's device).

Requirements: Easy Digital Downloads 3.0 or later, store currency USD, a Cryptoinfra account.
One-time purchases only: crypto has no pull payments, so EDD Recurring subscriptions are not supported.

== Installation ==

1. Upload the plugin and activate it.
2. Downloads → Settings → Payments → Cryptoinfra: paste your API key and callback secret
   (Cryptoinfra dashboard → Payments → Gateway settings). Tick Sandbox to test with fake money
   and a sandbox key.
3. Downloads → Settings → Payments → General: enable "Cryptoinfra (crypto)".
4. The store currency must be USD (Downloads → Settings → General → Currency).

The webhook URL (shown on the settings page) is sent with every payment automatically when your
site runs on https. On http the return page still completes the order when the customer comes back.

== Frequently Asked Questions ==

= My store is not in USD =
The method is hidden at checkout and the admin sees a notice. Cryptoinfra prices in US dollars only.

= Several stores, one Cryptoinfra project? =
Give each store its own order id prefix.

== Changelog ==

= 1.1.0 =
* Embedded payment page: a "Payment page" setting to show the Cryptoinfra payment page inside your own site (it fits any width and is as tall as the page), or redirect as before. "Embedded theme": light, dark or automatic.
* Payment pages open on pay.cryptoinfra.net.

= 1.0.0 =
* First release.
