=== Vouchermat ===
Contributors: vouchermat
Tags: gift voucher, gift card, voucher, order form, qr payment
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell gift vouchers on your website: the Vouchermat order form as a block or shortcode, with QR or card payment right on the page.

== Description ==

[Vouchermat](https://vouchermat.com/) is an online system for selling gift vouchers – hair salons, restaurants, wellness, shops. Customers order a voucher, pay by bank transfer (with a QR code) or by card, and receive a printable voucher by e-mail.

This plugin puts your Vouchermat order form straight into your WordPress pages – no iframe, no redirect:

* **Block "Vouchermat form"** for the block editor and the **[vouchermat]** shortcode for the classic editor and page builders.
* The form takes your **brand colour, language, header image and texts** from your Vouchermat settings. Nothing else to set up in WordPress.
* After ordering, the customer sees the **payment details and a QR payment** on the same page (and gets them by e-mail).
* With **card payments** (Vouchermat Plus) turned on in Vouchermat, the customer can pay by card straight away (Stripe Checkout) and gets the voucher right after paying.
* **Conversion tracking (Vouchermat Plus):** after a purchase the form reports it to the tools you already have on your website – a GA4 e-commerce `purchase` event for Google Tag Manager, `gtag()` for Google Analytics 4 / Google Ads and `fbq()` for Meta Pixel. You choose the tools in the Vouchermat settings; the plugin itself loads no tracking code and sets no cookies.
* Customers can also **check a voucher's validity** and remaining value inside the form.
* The form is isolated from your theme's styles (Shadow DOM), so it looks right in any theme and does not change your website's look.
* Works in Czech, Slovak and English. A multilingual form (Vouchermat Plus) follows your website's language automatically.
* **WooCommerce (optional):** paid vouchers can be redeemed in your WooCommerce cart – the voucher code works as a coupon worth the remaining value and each redemption is recorded in Vouchermat. You can also sell vouchers as WooCommerce products; Vouchermat issues and e-mails the voucher once the order is paid.

You need a Vouchermat account (the Free plan costs nothing). Services, prices, orders and vouchers are managed in the Vouchermat admin.

= External service =

This plugin connects to **Vouchermat** (https://vouchermat.com), the service that runs your voucher sales. It is required: the order form, its services and prices come from Vouchermat, and orders are created there.

* When a page with the form is shown, the visitor's browser loads the form settings (services, prices, texts, colour) from `https://vouchermat.com/api/v1/public/form/…`.
* When a customer orders, the data they enter in the form (name, e-mail, optionally phone, recipient's name, dedication and delivery address) is sent to `https://vouchermat.com/api/v1/public/order` to create the order. The payment details are then loaded from the same address.
* When a customer types a delivery address, the text is sent to `https://vouchermat.com/api/v1/public/address` for address suggestions.
* When a customer chooses to pay by card (only if you have turned on card payments in Vouchermat), the browser is sent to **Stripe Checkout** (`https://checkout.stripe.com`), where the customer enters the card details and pays; Stripe then sends them back to your page. Card details go only to Stripe, never to your website or to Vouchermat. Stripe terms of service: https://stripe.com/legal/ssa, privacy policy: https://stripe.com/privacy
* When a customer checks a voucher, the code is sent to `https://vouchermat.com/api/v1/public/check/…`.
* The "Check" button in Settings → Vouchermat asks `https://vouchermat.com/api/v1/public/form/…` from your server whether the form exists.
* WooCommerce only, and only after you click "Connect WooCommerce" and approve the access on WooCommerce's own authorization page: WooCommerce sends the API key it creates to `https://vouchermat.com/woocommerce/callback`. Vouchermat then uses the WooCommerce REST API of your site to create, change and delete coupons with voucher codes, read your products and orders, and register order webhooks, which send new and changed orders to `https://vouchermat.com/woocommerce/webhook`. You can stop this at any time by disconnecting in the Vouchermat settings or revoking the key under WooCommerce → Settings → Advanced → REST API.

Conversion tracking sends nothing to Vouchermat or anyone else: when you turn it on in Vouchermat, the form only passes the purchase (order number, amount, currency, voucher name) to the Google Tag Manager, Google Analytics or Meta Pixel code that is already on your page, and those tools then work under your own cookie consent.

No data is sent before a page with the form (or the plugin settings) is opened, and no order data before WooCommerce is connected. The plugin itself stores only the form address in your WordPress database.

Vouchermat terms of service: https://vouchermat.com/obchodni-podminky

== Installation ==

1. Install and activate the plugin (Plugins → Add New → search for "Vouchermat").
2. In the Vouchermat admin open **Forms & services → Embed code → Link** and copy your form address (e.g. `https://vouchermat.com/your-project`).
3. In WordPress go to **Settings → Vouchermat**, paste the address and click **Check**, then **Save**.
4. Add the **Vouchermat form** block to a page, or insert the `[vouchermat]` shortcode.

To show a different form on one page: `[vouchermat form="other-project"]`, or set the address in the block's sidebar.

== Frequently Asked Questions ==

= Do I need a Vouchermat account? =

Yes. The plugin shows your Vouchermat order form; orders, payments and vouchers are handled by Vouchermat. Sign up at https://vouchermat.com/ – the Free plan costs nothing.

= Where do I change the services, prices or colour of the form? =

In the Vouchermat admin. Changes show up on your website straight away.

= Can I hide "Created with Vouchermat" under the form? =

Yes, with the Vouchermat Plus plan (Settings → Content & texts in the Vouchermat admin).

= Can the form be in several languages? =

Yes, with the Vouchermat Plus plan. Turn on more form languages in Settings → Content & texts and translate your services in Forms & services → Translations. The plugin passes your WordPress language to the form, so a Slovak or English page shows the Slovak or English form; the customer then gets the e-mails and the voucher in that language.

= Does it work with caching plugins? =

Yes. The page only contains a placeholder; the form loads its current data from Vouchermat in the visitor's browser.

= I already have the iframe code on my website. =

It keeps working. Replace it with the block or shortcode for the new look without the frame.

== Screenshots ==

1. The order form on a WordPress page.
2. Payment details with the QR code right after ordering.
3. Settings → Vouchermat.
4. The "Vouchermat form" block in the editor.

== Changelog ==

= 1.1.0 =
* Conversion tracking (Vouchermat Plus): purchases are reported to Google Tag Manager, Google Analytics 4 / Google Ads and Meta Pixel on your page.
* WooCommerce: connect the store to Vouchermat – vouchers as coupons in the cart (remaining value, redemptions recorded in Vouchermat) and selling vouchers as WooCommerce products.

= 1.0.2 =
* Translations are delivered by translate.wordpress.org instead of being bundled.

= 1.0.1 =
* The form follows your website's language (multilingual forms with Vouchermat Plus).

= 1.0.0 =
* First version: block, shortcode, settings with form check, Czech and Slovak translations.

== Upgrade Notice ==

= 1.1.0 =
Conversion tracking for Google Analytics, Google Ads and Meta Pixel; WooCommerce: vouchers redeemable in the cart and sold as products.

= 1.0.2 =
Translations now come from translate.wordpress.org.

= 1.0.1 =
Multilingual forms: the form shows in your website's language when your Vouchermat form has it.

= 1.0.0 =
First version.

== Credits ==

The form uses the Geist and Geist Mono fonts by Vercel, licensed under the SIL Open Font License 1.1.
