=== Kunfupay for WooCommerce ===
Tags: woocommerce, payments, checkout, kunfupay
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept one-time EUR payments through Kunfupay hosted checkout.

== Description ==

Kunfupay for WooCommerce adds Kunfupay as a redirect payment gateway for both
classic checkout and Cart & Checkout Blocks. Payment confirmation is accepted
only from a valid signed webhook or an authenticated checkout-status request.

The store never handles card data or payment credentials.

This plugin connects to the Kunfupay external service to test the merchant's
API credentials, create hosted checkout sessions, and retrieve payment status.
See the External services section for the exact data that is sent and links to
Kunfupay's terms and privacy policy.

== External services ==

This plugin connects to Kunfupay, a payment service provided by Kunfu Global,
Inc. The connection is required for the payment gateway to work.

The plugin sends requests to https://api.kunfupay.com in these situations:

* When a store administrator tests the connection, the saved API key is sent in
  a server-to-server request so Kunfupay can authenticate the merchant account.
* When a customer chooses Kunfupay, the plugin sends the order amount and
  currency, an order description containing the WooCommerce order number and
  store name, an opaque order reference, success and cancellation URLs, a hash
  of the store URL, and the plugin version. Kunfupay uses this information to
  create the hosted checkout session.
* While an order is awaiting confirmation, the plugin sends the Kunfupay
  checkout-session identifier in authenticated server-to-server requests to
  retrieve its payment status.

The customer is redirected to https://store.kunfupay.com to complete payment.
Any information entered on that hosted checkout is provided directly to
Kunfupay and is handled according to Kunfupay's policies.

Kunfupay Terms of Use: https://kunfupay.com/en/legal/terms
Kunfupay Privacy Policy: https://kunfupay.com/en/legal/privacy

== Installation ==

1. Upload and activate the plugin ZIP.
2. Open WooCommerce > Settings > Payments > Kunfupay.
3. Save the Kunfupay API key and test the connection.
4. Register the displayed webhook URL in Kunfupay for payment.completed and payment.failed.
5. Save the same webhook signing secret in WooCommerce and enable the gateway.

The gateway is available only when the WooCommerce store currency is EUR.

== Frequently Asked Questions ==

= Does the plugin collect card details? =

No. Customers are redirected to Kunfupay hosted checkout.

= What data does the plugin send to Kunfupay? =

The plugin sends only the merchant authentication, order, return URL, and
technical information described in the External services section. It does not
send card data from WooCommerce.

= Does payment.failed fail the WooCommerce order? =

No. A failed payment attempt is non-terminal because the customer may retry.

= What happens if webhook delivery is delayed? =

The plugin performs authenticated, scheduled checkout-status reconciliation.

== Changelog ==

= 1.0.4 =

* Make database locks ownership-aware and atomic during stale-lock takeover and release.

= 1.0.3 =

* Limit administrator notices to the relevant WordPress and WooCommerce screens.
* Remove private source-repository links from the distributed package.

= 1.0.2 =

* Document the Kunfupay external service, transmitted order data, and legal policies for WordPress.org distribution.
* Align the distributed package with WordPress.org Plugin Check recommendations.

= 1.0.1 =

* Use the canonical Kunfupay API and hosted checkout domains in production.

= 1.0.0 =

* Initial production release.
* Hosted one-time checkout sessions in EUR.
* Classic Checkout, Checkout Blocks, and HPOS compatibility.
* Signed webhooks, duplicate protection, and status reconciliation.
