=== French Bank Payments for WooCommerce ===
Contributors: catcodestudio
Tags: up2pay, e-transactions, monetico, systempay, credit agricole
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

Up2pay e-Transactions, Monetico and Systempay in one plugin: card payments on the bank's secure page, every order confirmed by the bank's signature.

== Description ==

One plugin for the payment pages of the big French banks. Switch on the one of your merchant contract — or several, the buyer picks one at checkout. Works on the classic checkout and on the block checkout, with HPOS.

**Up2pay e-Transactions** — Crédit Agricole (the Paybox platform). The form is sealed with your HMAC key; the bank's answers are checked against its RSA public key. Test and production platforms; a switch uses the shared demo account of the test platform, so you can try the whole flow before the contract is signed.

**Monetico** — Crédit Mutuel and CIC (Monetico Paiement, form version 3.0). The form and the bank's server call are sealed with the MAC of your security key; the 3-D Secure order context is sent with every payment.

**Systempay** — Banque Populaire and Caisse d'Épargne. Form signed with HMAC-SHA-256 (or SHA-1 for old shops); the bank's notification and the buyer's return are checked against the same signature.

= How an order becomes paid =

* Only from what the bank signed: the server-to-server notification, or (Up2pay, Systempay) the signed parameters of the buyer's return. A call whose signature does not match is refused and logged.
* The amount and the currency paid are compared with the order; a mismatch puts the order on hold with a note instead of shipping it.
* The notification and the buyer's return often arrive in the same second. A lock makes sure the payment is recorded once: one note, one stock reduction.
* A buyer who comes back before the bank has confirmed sees "waiting for confirmation" and the page refreshes by itself, instead of an "order received" page on an unpaid order.
* Refused or cancelled payment: the buyer goes back to the pay page with a plain message, the cart is kept, and the order note keeps the bank's reason. A new attempt gets a new reference.
* Each payment attempt gets its own reference with a prefix you choose, so two shops on one merchant account never collide.
* The page that sends the buyer to the bank is our own small page, independent of the theme — the same on classic and block themes.

Keys are stored encrypted. Errors always go to the WooCommerce log (source french-bank-payments); full logging of the forms and answers is a switch. "Check connection" asks Up2pay's platform to open a payment page with your credentials, and checks Systempay's REST password when you add it.

// @pro-begin
The plugin is in English and French.
// @pro-end

// @pro-begin
= Pro =

* Refunds from the order screen — full or partial — sent to the bank: Up2pay through its server API, Monetico through the "recrédit" service, Systempay through its REST API. The bank's answer goes to the order notes.
* One payment journal for the three banks: reference, transaction, card, amount, refunds and the state of every payment.
* Order-total limits per bank — for example large orders only on the bank with the lower fee.

Try Pro for 7 days from WooCommerce → French Bank Payments: no card, it never starts by itself, and payments keep working after the trial. A licence for 1–5 years covers updates and support for its term; one key works on two sites (the shop and its test copy).
// @pro-end

== Installation ==

1. Install and activate the plugin. WooCommerce must be active, and the shop currency must be the euro (EUR).
2. Open WooCommerce → French Bank Payments to see the three banks, or WooCommerce → Settings → Payments.
3. For the bank you use: choose the environment, enter the credentials from the welcome e-mail and the key, save, press "Check connection".
4. Monetico: give the notification URL shown on the settings screen to the Monetico support as the return URL of your TPE. Systempay: copy it into the back office (notification rules, URL at the end of the payment). Up2pay: nothing to do, it goes with every payment.
5. Make one test payment with a test card of your bank, then switch the environment to production.

== Frequently Asked Questions ==

= Which bank do I need? =

The one that holds your merchant contract for online card payments: Crédit Agricole → Up2pay e-Transactions; Crédit Mutuel or CIC → Monetico; Banque Populaire or Caisse d'Épargne → Systempay.

= Can I try it without a contract? =

Up2pay: yes, tick "Demo account" in the Test environment — it uses the shared test account that Crédit Agricole publishes for integrators, and nothing is charged. Monetico and Systempay give test credentials with the contract.

= Do I need the notification URL? =

For Monetico, yes: it is the only way the result reaches the shop. For Up2pay it is sent automatically. For Systempay the signed return confirms the order too, but only the notification covers a buyer who closes the tab after paying.

= Which currencies? =

EUR. The methods stay hidden at checkout in a shop with another currency (the filter ccfb_supported_currencies opens USD, GBP or CHF if your contract covers them).

= Where are the logs? =

WooCommerce → Status → Logs, source french-bank-payments.

== Changelog ==

= 1.0.0 =
* Up2pay e-Transactions, Monetico and Systempay in one plugin.
* Classic and block checkout, HPOS.
* Orders confirmed only by the bank's signature (RSA for Up2pay, MAC for Monetico, HMAC-SHA-256 for Systempay), amount check, a lock against double recording, waiting screen until the bank confirms.
// @pro-begin
* Pro: refunds from the order screen, payment journal, order-total limits per bank.
* Pro: updates from catcode.com.ua in Dashboard → Updates while the licence covers updates.
// @pro-end
