=== iPay.ua for WooCommerce ===
Contributors: catcode
Tags: woocommerce, payment gateway, ipay, acquiring, ukraine
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept card payments through iPay.ua internet acquiring: payment link, redirect to the secure iPay.ua page, order confirmed by status check.

== Description ==

A WooCommerce payment gateway for **iPay.ua** internet acquiring (Checkout API, Ukraine).

Features:

* Creates an iPay.ua payment (PaymentCreate) and redirects the buyer to the secure iPay.ua page.
* Every request is signed with HMAC-SHA512 as the Checkout API requires; answers are signature-checked too.
* Notifications are accepted, but the order is always confirmed from a fresh **Status** request — a forged or replayed notification cannot mark an order paid.
* Confirms the order when the buyer returns, and re-checks unpaid orders in the background every 10 minutes — payments settle even before iPay.ua connects your notification URL.
* Guards against underpayment and double payment (the "Back" button after paying never creates a second payment).
* Sandbox mode against `sandbox-checkout.ipay.ua`.
* Payment page language follows the store (uk / ru / en), shop name shown on the payment page, configurable link lifetime.
* Works with both the classic and the block-based checkout, HPOS-compatible.
* Refunds from the order screen: Reversal on the day of payment, Refund (full or partial) afterwards — Pro.
* Pre-authorisation: held funds captured when the order is Completed and released when it is Cancelled — Pro.
* Fiscal receipts (PRRO) issued by iPay.ua from the order basket, with the receipt link saved to the order — Pro.
* Payment journal with one-click status check — Pro.

= Notification URL =

iPay.ua sets the notification address on its side. The plugin shows the URL at the bottom of its settings screen — send it to your iPay.ua manager.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it.
2. Go to WooCommerce → Settings → Payments → **iPay.ua**.
3. Enter the Merchant ID (mch_id) and the sign key (sign_key) for the sandbox or live mode and save.
4. Press "Check credentials" — a signed status request for a non-existent payment proves the credentials work without creating anything.
5. Send the notification URL from the settings screen to iPay.ua.

== Frequently Asked Questions ==

= Do I need a contract with iPay.ua? =
Yes. iPay.ua issues both the live and the sandbox credentials.

= Which currencies are supported? =
Hryvnia (UAH). The method hides itself when the store currency is different.

= The buyer paid but the order is still pending. =
The background check settles it within 10 minutes. You can also press "Check" in the payment journal (Pro). Make sure the credentials match the mode (sandbox or live) the order was created in.

= Free and Pro =

Accepting payments works for free, with no time limit. Pro features (refunds, pre-authorisation capture, fiscal receipts, payment journal) are unlocked with a licence key from catcode.com.ua. The 7-day trial starts **only when you click it**.

== Changelog ==

= 1.0.0 =
* First release: PaymentCreate with redirect, signed requests, notification + Status reconciliation, background check, sandbox mode, block checkout support, uk translation.
* Pro: refunds (Reversal / Refund, partial), pre-authorisation capture and release, fiscal receipts, payment journal.
