=== EHDM for WooCommerce ===
Contributors: vardan4455
Requires at least: 6.8
Tested up to: 7.1
Requires PHP: 8.1
WC requires at least: 10.6
WC tested up to: 10.6.2
Stable tag: 0.1.56
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Automated Armenian E-Receipt (ehdm) integration for WooCommerce. Generate 100% tax-compliant fiscal receipts for your online store automatically.

== Description ==

EHDM for WooCommerce connects your store to the PayX / E-HDM API so you can print and manage Armenian fiscal receipts from WooCommerce.

Features included in this plugin:

* Login to E-HDM with merchant username and password
* Configure fiscalization, automatic sending, trigger order statuses, default unit and default DEP
* Fill EHDM product fields (ADG code, fiscal name, unit, VAT exempt)
* Send a fiscal receipt from the WooCommerce order screen
* Reverse a fiscal receipt from the order screen or from Receipts History
* Browse printed and returned receipts from WooCommerce > EHDM

== Installation ==

1. Upload the plugin zip in WordPress admin: Plugins > Add New > Upload Plugin.
2. Activate EHDM for WooCommerce. WooCommerce must already be installed and active.
3. Open WooCommerce > EHDM and sign in with your E-HDM username and password.
4. Open the Settings tab and configure fiscalization, automatic sending, trigger statuses, default unit and default DEP.
5. Fill EHDM product fields for each WooCommerce product or variation.
6. Open an order and use Send receipt / Reverse receipt when needed.

== External services ==

This plugin connects to the PayX / E-HDM API hosted at `store.payx.am` (operated by PayX LLC / ehdm.am). The connection is required to authenticate merchants, print fiscal receipts, reverse receipts, and load receipt history.

Data is sent only when a store administrator signs in and uses EHDM features. Depending on the action, the plugin may send:

* Merchant E-HDM username and password (login).
* Order and product fiscal data needed to print or reverse a receipt (product names, quantities, amounts, ADG/good codes, payment split, and related receipt identifiers).
* Receipt / history identifiers when loading receipt history or reversing a receipt.

Service website: https://ehdm.am/
Terms of service: https://ehdm.am/#conditions
Privacy policy: https://ehdm.am/privacy_policy/

== Admin Tabs ==

WooCommerce > EHDM includes:

* Receipts History: loads printed receipts and allows opening PDF receipts or reversing a sale receipt.
* Returned Receipts: loads returned receipts and shows reverse PDF links.
* Settings: credentials session, fiscalization switch, automatic sending, trigger statuses, defaults, and logout.

== Required Product Fields ==

Each fiscalized product must have:

* ADG code
* GTIN, UPC, EAN, or ISBN in WooCommerce product data (used as E-HDM goodCode)
* Fiscal name (HY), maximum 50 characters
* Unit
* DEP or VAT exempt/default DEP configuration

== Order Actions ==

From the WooCommerce order screen, the plugin can:

* Send receipt to E-HDM
* Reverse receipt

== Payment Mapping ==

Cash payment methods use cashAmount when payment method id is cod or cash.
All other payment methods use cardAmount.

== Changelog ==

= 0.1.56 =
* Align readme with implemented UI: remove undocumented connection test, Tools tab, and order actions that are not rendered.

= 0.1.55 =
* Update Tested up to WordPress 7.1 for directory compatibility.

= 0.1.54 =
* Fix login: stop sanitizing passwords with sanitize_text_field (it can alter special characters and cause false wrong-password errors). Improve token header handling for E-HDM API requests.

= 0.1.53 =
* WordPress.org review fixes: enqueue admin scripts properly, document external PayX/E-HDM services, declare WooCommerce plugin dependency, and update contributors.

= 0.1.52 =
* Initial review build.
