=== fpoho Payment Gateway ===
Contributors:      fpoho, shamotj
Tags:              woocommerce, payment gateway, meal vouchers, benefit vouchers, stravenky
Requires at least: 6.4
Tested up to:      7.1
Requires PHP:      7.4
Stable tag:        1.0.4
WC requires at least: 8.0
WC tested up to:   10.7
License:           GPL-2.0+
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

WooCommerce payment gateway for fpoho electronic meal vouchers and benefit vouchers.

== Description ==

This plugin integrates the fpoho online payment terminal with WooCommerce, allowing customers
to pay for their orders using fpoho electronic meal vouchers (eStravenky) and benefit vouchers
(eBenefitné poukážky) issued by fpoho, s.r.o.

= How it works =

1. The customer selects "fpoho Payment" at checkout and places the order.
2. They are redirected to the secure fpoho payment terminal where they authenticate with their fpoho card credentials.
3. After a successful payment the customer is returned to your shop's thank-you page.
4. An asynchronous notification from the fpoho gateway updates the order status automatically.

= Features =

* Redirect-based payment flow – no card data touches your server.
* Asynchronous NURL (server-to-server) notification for reliable order status updates.
* Test mode using the fpoho sandbox environment.
* Refund (storno) support directly from the WooCommerce order screen.
* HPOS (High-Performance Order Storage) compatible.
* Translations ready – Slovak (sk_SK) translation available via translate.wordpress.org.

= Requirements =

* WordPress 6.4 or later
* WooCommerce 8.0 or later
* PHP 7.4 or later
* An active merchant contract with fpoho, s.r.o. (MID, VPOS, and KEY credentials)

== Installation ==

1. Upload the `fpoho-payment-gateway` directory to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** menu in WordPress.
3. Go to **WooCommerce > Settings > Payments** and click **fpoho Payment**.
4. Enable the gateway and enter your credentials:
   * **Merchant ID (MID)** – provided by fpoho after signing the merchant contract.
   * **Terminal ID (VPOS)** – provided by fpoho after signing the merchant contract.
   * **Secret Key** – 64-character hexadecimal HMAC key provided by fpoho.
5. Disable **Test Mode** when you are ready to accept live payments.

== Frequently Asked Questions ==

= Where do I get my MID, VPOS, and Secret Key? =

These credentials are provided by fpoho, s.r.o. after you sign the merchant contract.
Contact [infoservis@fpoho.sk](mailto:infoservis@fpoho.sk) for more information.

= What is the NURL (Notification URL)? =

The plugin automatically sets the NURL for every payment request. The URL is:
`https://yoursite.com/?wc-api=WC_Fpoho_Payment_Gateway`
You may need to provide this URL to fpoho before going live so their system can whitelist it.

= Does the plugin support refunds? =

Yes. Full and partial refunds can be processed from the WooCommerce order screen
(**WooCommerce > Orders > [Order] > Refund**) as long as the order has a gateway transaction ID.

= Can I use the plugin in test mode? =

Yes. Enable **Test Mode** in the gateway settings. The plugin will use the fpoho sandbox
environment (`https://testovacie-platby.fpoho.sk/`) with built-in test credentials, so
your live credentials are ignored while test mode is on.

== External services ==

This plugin connects to the fpoho online payment terminal operated by fpoho, s.r.o.
in order to process payments made with electronic meal vouchers and benefit vouchers.
The terminal is contacted only when a customer chooses the fpoho payment method at
checkout, and when a shop administrator issues a refund.

Data sent when a customer places an order and selects the fpoho payment method:
merchant ID, terminal ID, customer reference, order number, the customer's billing
e-mail address, order total, currency, timestamp, order description, and the return
and notification URLs of the shop. A refund request sends the merchant ID, terminal ID,
gateway transaction ID, amount, currency and timestamp.

No other data is transmitted, and the plugin contacts no other service.

Endpoints:

* https://online-platby.fpoho.sk/terminal/ - payment, production
* https://online-platby.fpoho.sk/storno/ - refund, production
* https://testovacie-platby.fpoho.sk/ - sandbox, used only while test mode is enabled

Service provider: fpoho, s.r.o., Kalov 356, 010 01 Zilina, Slovakia - https://fpoho.sk/
Privacy policy: https://fpoho.sk/ochrana-osobnych-udajov/
Terms of service: https://fpoho.sk/engine/wp-content/uploads/2025/02/VOP-prevadzky-1.6.2024.pdf

The terms of service linked above are the "Všeobecné obchodné podmienky k Zmluve o vzájomnej
spolupráci pri akceptovaní produktov spoločnosti fpoho, s.r.o.", effective 1 June 2024,
available in Slovak only and also listed at https://fpoho.sk/dokumenty-na-stiahnutie/.
They govern the acceptance of fpoho products, and their section 2.16 covers the payment
gateway this plugin connects to.

Merchants receive their credentials (MID, VPOS and secret key) from fpoho, s.r.o. under the
merchant agreement these terms belong to; the terminal cannot be used without one.

== Screenshots ==

1. The fpoho Payment Gateway settings screen under WooCommerce > Settings > Payments.

== Changelog ==

= 1.0.4 =
* Replace the inline redirect script on the payment receipt page with a properly enqueued script, per WordPress.org plugin review guidelines.
* Remove the bundled Slovak (sk_SK) translation files; the translation will be provided via translate.wordpress.org instead.

= 1.0.3 =
* Test mode is now disabled by default on new installs, so the gateway is live-ready out of the box.

= 1.0.2 =
* Add plugin icon and banner images for the plugin directory listing.
* Confirm compatibility with WordPress 7.1.

= 1.0.1 =
* Add settings screen screenshot for the plugin directory listing.

= 1.0.0 =
* Initial release.

== Upgrade Notice ==

= 1.0.4 =
No functional changes for merchants; addresses WordPress.org plugin review requirements.

= 1.0.3 =
Test mode now defaults to off for new installs. Existing installs keep their saved setting unchanged.

= 1.0.2 =
Adds plugin icon and banner images to the directory listing. No functional changes.
