=== PayLio for Easy Digital Downloads ===
Contributors: paylio
Tags: easy digital downloads, payment gateway, credit card, apple pay, google pay
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept card, Apple Pay and Google Pay payments in Easy Digital Downloads through the PayLio hosted checkout.

== Description ==

PayLio for Easy Digital Downloads adds a card payment method to your EDD checkout. Customers choose PayLio, are redirected to the secure PayLio hosted checkout and pay by card, Apple Pay or Google Pay. No card data touches your site.

An order is completed only after:

1. PayLio sent a webhook signed with a secret that is unique to that payment, and
2. the plugin asked the PayLio API directly and PayLio confirmed that the payment is paid, with the amount and currency the order was created with.

= Features =

* Hosted checkout on paylio.org, no iframes and no card fields on your site
* Card, Apple Pay and Google Pay (depending on the provider and the customer's device)
* Choose one card provider or let the customer choose
* Processing fee included in your price or added to the customer's total
* Optional payout wallet per shop
* "Test connection" button in the settings
* Automatic status re-checks for about 24 hours in case a webhook is lost
* "Check PayLio payment status" button on the order details screen
* Optional cancellation of unpaid orders, with a final status check first
* Orders are completed exactly once, even if several checks arrive at the same time
* English and German included

= Settings =

Downloads > Settings > Payments > PayLio: Title, Description, API key (with Test connection), Payout wallet (optional), Payment provider, Processing fee, Order status after payment, Cancel unpaid orders after (hours), Show payment icon, Custom icon URL and, under Advanced, API base URL and Debug logging. The gateway itself is switched on under Payments > General > Active Gateways.

Supported store currencies: USD, EUR, CAD, INR. Order totals from 0.01 to 10,000.00. PayLio is hidden at checkout when the currency or amount is not supported, or when the total is below the minimum of the single provider you selected.

== External services ==

This plugin connects to the PayLio API (default `https://paylio.org`, configurable under Advanced) to process payments.

* **When:** when a customer places an order with PayLio, when the plugin checks the status of that payment (after a webhook, on a schedule, at the unpaid timeout or when an administrator clicks "Check PayLio payment status"), when you click "Test connection", and when the settings screen or checkout loads the list of card providers (cached for one hour).
* **Sent when creating a payment:** order total, currency, the customer's e-mail address, the order number, your site's domain, the site's webhook URL, a random per-payment webhook secret, the selected card provider and fee setting and, if set, your payout wallet address. The request is authenticated with your PayLio API key.
* **Sent when checking a payment:** the PayLio payment id and your API key.
* **Sent when loading providers:** nothing except the request itself (no API key).
* **Received:** payment id, checkout URL, status, amount, currency, transaction ids and the provider list.
* Terms of service: [https://paylio.org/terms](https://paylio.org/terms)
* Privacy policy: [https://paylio.org/privacy](https://paylio.org/privacy)

== Installation ==

1. Install and activate Easy Digital Downloads 3.2 or newer.
2. Upload the plugin under **Plugins > Add New > Upload Plugin** (or install it from the plugin directory) and activate it.
3. Go to **Downloads > Settings > Payments > PayLio**, enter your API key from the PayLio dashboard (**Dashboard > API Keys**) and click **Test connection**.
4. Go to **Downloads > Settings > Payments > General** and tick **PayLio** under **Active Gateways**. Save.
5. Optional: choose a card provider, the fee handling, a payout wallet and the unpaid timeout.

Your site must use https. PayLio does not deliver webhooks to http URLs, so the payment method stays hidden on http sites.

== Frequently Asked Questions ==

= Do I need to configure a webhook URL in PayLio? =

No. The plugin sends its webhook URL (`/wp-json/paylio-edd/v1/webhook`) and a fresh secret with every payment. Security plugins must not block this REST route.

= The customer paid but the order is still pending. =

Open the order under **Downloads > Orders** and click **Check PayLio payment status** in the PayLio box. The plugin also re-checks open payments automatically for about 24 hours. On sites with little traffic WP-Cron runs late; a real server cron makes the checks punctual.

= Why was an order put on hold with a "not accepted" note? =

PayLio reported a payment as paid, but its amount or currency did not match, or the order total changed after the payment was created. Nothing was marked paid. Review the order manually.

= Does the customer return to my shop after paying? =

Not automatically. The customer receives your usual Easy Digital Downloads purchase receipt once the payment is confirmed. The files are available as soon as the order is complete.

= Where are errors logged? =

Under **Downloads > Tools > Logs** (payment errors). With **Debug logging** on, more details go to the Easy Digital Downloads debug log. API keys, webhook secrets and customer data are never logged.

= Which order status is used after payment? =

**Completed** by default, which gives the customer access to the files. You can choose **Processing** if you want to complete orders yourself.

== Changelog ==

= 1.0.1 =
* New: after paying, the PayLio checkout sends the customer back to the purchase confirmation page.

= 1.0.0 =
* Initial release.
