=== CatCode Card Payments with Fondy for WooCommerce ===
Contributors: catcodestudio
Tags: fondy, payment gateway, woocommerce, credit card, ukraine
Requires at least: 5.6
Tested up to: 7.0
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 payments in WooCommerce via Fondy: hosted checkout page, signed callbacks and automatic status reconciliation.

== Description ==

An independent Fondy payment gateway for WooCommerce. Customers are redirected to the secure Fondy payment page and the order is confirmed automatically once Fondy calls back.

Fondy is a third-party product; this is an independent integration, not affiliated with or endorsed by Fondy. You need your own Fondy merchant account to accept live payments.

Features:

* Card payments (Visa, Mastercard), Apple Pay and Google Pay through the hosted Fondy page — card data never touches your site.
* Automatic order confirmation via the server_callback webhook, verified with a SHA1 signature.
* Transaction status reconciliation when the customer returns to the shop, so a payment is not lost if the callback is delayed.
* The paid amount is checked against the order total before it is marked as paid.
* Test mode using the public Fondy test merchant — place a full test order before signing a contract.
* Supports both the classic and the block-based (Gutenberg) checkout.
* Currencies: UAH, USD, EUR, GBP, CZK.
* The interface is fully translated into Ukrainian. / Інтерфейс плагіна повністю перекладено українською.

== Installation ==

1. Upload the plugin to `/wp-content/plugins/` and activate it.
2. Go to WooCommerce → Settings → Payments → Fondy.
3. To try it out, leave "Test mode" enabled — payments run through the public Fondy test merchant and no real money is charged. For live payments turn it off and fill in the Merchant ID and secret key from your Fondy account.
4. There is no need to set the callback URL manually in the Fondy account — the plugin sends `server_callback_url` with every payment.

== External services ==

This plugin connects to the Fondy payment API to process payments. This connection is required for the plugin to work — without it no payment can be created or verified.

What is sent, and when:

* When a customer places an order with this gateway, the plugin builds a signed form and the customer's browser posts it to `https://pay.fondy.eu/api/checkout/redirect/`. That form carries your merchant ID, the order reference, the amount, the currency, the order description, the customer's e-mail address, the interface language and the return/callback URLs of your site. The customer then enters card details on Fondy's own page — card data never reaches your site.
* When the customer returns from the payment page, and when Fondy calls your site back on the `server_callback_url`, the plugin requests the current state of that transaction from `https://pay.fondy.eu/api/status/order_id`, sending your merchant ID and the order reference, to confirm whether the order is paid.

Every request is signed with your merchant secret key, which never leaves your server. No data is sent to Fondy unless a customer starts a payment or returns from the payment page.

Service provider: Fondy.
Terms and conditions: https://fondy.io/gb/terms-and-conditions/
Privacy notice: https://fondy.io/gb/privacy-notice/

== Frequently Asked Questions ==

= Do I need a Fondy contract to test the plugin? =

No. Leave test mode enabled — the plugin uses Fondy's public test merchant, so you can place a full test order before signing anything.

= Why is the order still pending after a successful payment? =

The order is confirmed by the server_callback webhook. Make sure your site is reachable from the internet — Fondy cannot reach `localhost` or a site behind HTTP authentication. As a fallback the plugin also re-checks the status when the customer returns to the shop.

= Which currencies are supported? =

UAH, USD, EUR, GBP and CZK, as allowed by your Fondy merchant account.

= Does it work with the block checkout? =

Yes, both the classic shortcode checkout and the block-based checkout are supported.

= Where is the card data processed? =

Entirely on the Fondy side. The customer is redirected to Fondy's own payment page, so no card details are entered on or stored by your site.

== Screenshots ==

1. Fondy gateway settings in WooCommerce.
2. Fondy payment method on the checkout page.

== Changelog ==

= 1.0.1 =
* Fixed a double "payment received": the Fondy callback and the buyer's return could both complete the same order, leaving two payments and a double stock reduction. They are serialised now, and the loser re-reads the order — including from the HPOS order cache.
* The buyer's return no longer says "payment not completed" on an order the callback has just paid.

= 1.0.0 =
* First release.
