=== Zebby VAT Validation for WooCommerce ===
Contributors: rperednikas
Tags: woocommerce, vat, validation, checkout, tax
Requires at least: 5.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 2.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Provides VAT validation during WooCommerce checkout using the Zebby VAT API.

== Description ==

Adds a VAT field to the WooCommerce checkout page (both classic and blocks). Validates the entered VAT number using the Zebby VAT API (https://api.zebby.io) and displays the result. Optionally allows for VAT exemption based on validation status and country rules.

Features:
* Adds VAT field to classic & block checkout.
* Real-time validation via AJAX (configurable).
* Displays validation success/failure/error messages.
* Displays company name if provided by API.
* Configurable API key and endpoint URL.
* Option to enforce VAT field requirement.
* Option to enable automatic VAT exemption for valid numbers in specific countries.
* Dedicated settings page.
* Debug logging option.

== Installation ==

1. Upload the `zebby-vat-validation` folder to the `/wp-content/plugins/` directory.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to the 'Zebby VAT' settings page in the WordPress admin menu.
4. Enter your Zebby VAT API Key (`x-api-key`) obtained from Zebby.
5. Configure other settings as needed.

== Frequently Asked Questions ==

*   **Where do I get an API key?**
    You need to obtain an API key from Zebby.

*   **Does this work with the new block-based checkout?**
    Yes, support for the block-based checkout is included.

== Screenshots ==

1. Settings page
2. VAT field on classic checkout
3. VAT field on block checkout

== Changelog ==

= 2.0.1 =
* Fixed WordPress security issues including nonce verification, input sanitization, and output escaping.
* Improved internationalization with proper numbered placeholders.
* Enhanced security for AJAX handlers and form submissions.
* Fixed development function usage in production code.

= 2.0.0 =
* Major security and compatibility improvements.
* Enhanced VAT validation and exemption logic.
* Improved admin interface and error handling.

= 0.1.0 =
* Initial release.

== Upgrade Notice ==

= 2.0.1 =
* Critical security update - recommended for all users.

== Data Sent to Zebby API ==

This plugin sends the following data to the Zebby VAT API for validation purposes:
- VAT number (required for validation)
- Country code (to determine applicable VAT rules)
- (Optionally) Company name, if provided by the user

This data is used solely to validate the VAT number and determine VAT exemption eligibility during checkout. No other personal or sensitive data is sent. 