=== UID Check for bexio ===
Contributors: gstrainovic
Tags: woocommerce, bexio, uid, switzerland, b2b
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 8.1
Requires Plugins: woocommerce, strainovic-uid-check-schweiz
Stable tag: 0.3.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Validates the Swiss UID at checkout, stores the result of the UID register with every order and sends it to bexio.

== Description ==

Everything from Strainovic UID Check Schweiz (UID field and validation in the classic checkout, the checkout block and Contact Form 7), plus:

* The result of the UID register (status, company name, legal form, address, VAT registration, time of the check) is stored with the order and shown in a box on the order screen (HPOS compatible). The register is queried again when the order is placed, so the stored time is the time of that query.
* After the order is created, the result is sent to bexio in the background: the contact is found by email or created as a company from the UID register data, and the check is added as a note with the order number.
* Errors never block the checkout; the transfer is retried automatically and logged.
* Connection to bexio with one click through strainovic-connect, no bexio developer app needed.

This plugin is an add-on to the free plugin Strainovic UID Check Schweiz from the WordPress plugin directory, which provides the UID field and validation and receives its updates there. Keep both active; this plugin takes over the start of the free version so the field and the check are registered only once.

== Installation ==

1. Install and activate Strainovic UID Check Schweiz from the plugin directory (WooCommerce is required as well).
2. Upload this plugin and activate it.
3. Go to Settings, UID Check for bexio, and click «Connect to bexio».

== External services ==

This plugin connects to three external services.

UID register of the Swiss Federal Statistical Office (https://www.uid-wse.admin.ch/V5.0/PublicServices.svc): when a customer enters a UID, the UID is sent to check whether the company exists and is active; it is sent once more when the order is placed, to store the current result with the order. Terms of use: https://www.admin.ch/en/terms-and-conditions Privacy policy: https://www.admin.ch/en/terms-and-conditions#Privacy-Notice

strainovic-connect (https://connect.strainovic-it.ch), operated by Strainovic IT: when you connect to bexio, the site URL and the admin email are sent once to register the website; afterwards the service handles the bexio login and renews the access token. No order or customer data is sent to this service. Terms and privacy policy: https://www.strainovic-it.ch/uid-check/

bexio API (https://api.bexio.com), operated by bexio AG: for every order with a UID, the customer's email address, the company data from the UID register and the order number are sent to your bexio account. API terms and documentation: https://docs.bexio.com/ Privacy policy: https://www.bexio.com/de-CH/datenschutz

== Changelog ==

= 0.3.2 =
* While an invoice is open, the settings page says so and names the last day of the transfer to bexio (the due date), instead of «Free trial until» or «Active until».

= 0.3.1 =
* Texts for the automatic annual invoices: during the trial the settings page says that the annual invoice is sent by email to your billing address; after the trial or the paid year it says to pay the invoice to continue. The link is now labelled «Billing address and invoices».

= 0.3.0 =
* When the trial or the paid year has ended, the notice links to the order page of strainovic-connect for this website.
* The website language is sent when the website registers, so reminders and the order page use it.

= 0.2.0 =
* Add-on to the free plugin Strainovic UID Check Schweiz, which must now be installed and active; the UID check itself is updated through the plugin directory. Without it, this plugin only shows a notice.

= 0.1.1 =
* The UID register is queried when the order is placed, so the time stored with the order is the time of that query (the daily cache only serves the checkout field).
* bexio note: every item on its own line.
* Display name «UID Check for bexio».

= 0.1.0 =
* First version: check result on the order, transfer to bexio as contact and note, connection through strainovic-connect.
