=== NovaPay for WooCommerce ===
Contributors: catcode
Tags: woocommerce, payment gateway, novapay, 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 NovaPay internet acquiring: payment session, redirect to the NovaPay page, order confirmed by a signed postback.

== Description ==

A WooCommerce payment gateway for **NovaPay** internet acquiring (Nova Poshta's payment service, Ukraine).

Features:

* Creates a NovaPay payment session and redirects the buyer to the secure NovaPay payment page.
* Confirms the order automatically from the NovaPay postback, verifying its **RSA-SHA256 signature** (`x-sign`).
* Falls back to a status request when the buyer returns, in case the postback is delayed.
* Sends the basket (line items plus shipping and fees) so the payment page shows what is being paid for.
* Sandbox mode against `api-qecom.novapay.ua` — check the integration before going live.
* Works with both the classic and the block-based checkout, and is HPOS-compatible.
* Refunds, full and partial, straight from the WooCommerce order screen — Pro.
* Two-stage payments (hold): the money is blocked on the card and captured when you mark the order Completed — Pro.
* Payment journal with one-click status reconciliation — Pro.

= Keys =

NovaPay integration uses a key pair: you generate a private key, hand the public
half to NovaPay, and the plugin signs every request with the private one. NovaPay
signs its postbacks with its own key — paste that public key into the settings,
otherwise incoming notifications cannot be trusted and are rejected.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it.
2. Go to WooCommerce → Settings → Payments → **NovaPay**.
3. Enter the merchant id and the private key (sandbox or live), paste NovaPay's public key, save.
4. Press "Check keys" — the plugin opens a payment session and closes it right away, proving the credentials work.
5. The postback URL is passed to NovaPay with every session; it is shown at the bottom of the settings screen.

== Frequently Asked Questions ==

= Do I need a contract with NovaPay? =
For real payments, yes. The sandbox needs test credentials, which NovaPay issues on request.

= Which currencies are supported? =
Hryvnia (UAH) only. The gateway hides itself when the store currency is anything else, so an order is never charged the wrong amount.

= The buyer paid but the order is still pending. =
Check that NovaPay's public key is saved: without it every postback is rejected as unsigned. The order still reconciles when the buyer returns to the shop, or from the payment journal.

= Free and Pro =

Accepting payments works for free, with no time limit. Pro features (payment
journal, refunds from the admin, two-stage hold payments) are unlocked with a
licence key from catcode.com.ua. The 7-day trial starts **only when you click
it** — nothing switches itself on and then goes dark later.

== Changelog ==

= 1.0.0 =
* First release: payment session, redirect, signed postback, status reconciliation, sandbox mode, block checkout support.
* Pro: refunds (full and partial), two-stage hold with capture on Completed, payment journal.
