=== Tan Delivery for WooCommerce ===
Contributors: tandelivery
Tags: shipping, delivery, courier, georgia, woocommerce
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 0.5.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Courier delivery by Tan for your shop: the price at checkout, orders sent to Tan automatically, and every delivery's status right in WooCommerce.

== Description ==

* "Tan courier" at checkout, priced by Tan for each customer's address.
* Orders go to Tan automatically when paid (or by hand), and can be cancelled before pickup.
* The delivery status appears on the order and on the customer's order page; a delivered order can complete itself.
* Works with the new order tables (HPOS) and the block checkout. In Georgian and English.

You need an approved Tan partner business and an API key from the partner cabinet.

== Installation ==

1. Download the plugin from https://app.tandelivery.ge/developers (WooCommerce plugin), upload it under Plugins → Add New → Upload Plugin, and activate it. Later versions arrive as ordinary WordPress updates.
2. WooCommerce → Settings → Tan: paste your API key (start with a test key) and choose the pickup point.
3. WooCommerce → Settings → Shipping: add "Tan delivery" to your Georgia zone.

== Frequently Asked Questions ==

= Why is Tan not shown in the cart? =

The cart's shipping calculator asks only for a town. Tan prices the exact address, so it appears at checkout once the street is typed.

= Which phone numbers work? =

A Georgian mobile number. The courier calls the recipient, and Tan texts them a link to follow the parcel, so checkout asks for one when Tan is chosen.

= What happens if Tan cannot be reached? =

The order is sent in the background and tried again after 1, 5, 15 and 60 minutes. Each attempt is safe: Tan never makes a second delivery for the same order.

= Can I test without a courier coming? =

Yes. With a test key (tan_test_…) orders are never shown to couriers, nothing is charged, and they move through the delivery statuses by themselves.

== External services ==

This plugin connects to the Tan Partner API (https://api.tandelivery.ge), run by Tan, to price and deliver your orders. It sends:

* At checkout, while the customer types — before any purchase: the delivery address and town, and the basket's weight, to get a price (POST /quotes).
* When an order is sent to Tan: the recipient's name and phone, the delivery address and note, the parcel's weight and contents, and your order number (POST /orders).
* Every five minutes (hourly once a webhook is set): a request for status changes of your Tan orders (GET /events).

Tan's webhooks, if you set one up, are received at /wp-json/tan/v1/webhook and checked against your signing secret. Your API key is sent only to api.tandelivery.ge.

Terms of service: https://app.tandelivery.ge/terms

== Changelog ==

= 0.5.0 =
* Updates from Tan's own site: a new version shows as an ordinary update in WordPress and installs with one click (Update URI; WordPress.org is never asked).

= 0.4.0 =
* Orders are sent in the background (Action Scheduler) and retried when Tan cannot be reached.
* "Send to Tan again" after a cancelled or expired delivery.
* The courier's name, vehicle and — while the delivery runs — phone in the order's Tan box.
* Waiting-for-payment and declined payments are shown and noted.
* Checkout asks for a Georgian mobile number; Tan is offered only in lari; a tax setting (no tax by default); faster price lookups that do not hold checkout up.
* The API key and webhook secret never appear in the page; an empty field keeps them.
* Saving settings while Tan's list cannot load no longer resets the pickup point.
* With a webhook, statuses are still read hourly as a safety net; the settings show when the last webhook arrived.
* Russian translation; translations built from .po files (bin/i18n).

= 0.3.6 =
* Plugins list: the Tan mark, a Georgian name and description, links to the docs and the partner cabinet, Tan's colour on the row.
* Tan shipping lines read "Delivery: Standard / Express".

= 0.3.3 =
* Checkout: the Tan mark, a line under each option saying what the customer gets, express marked ⚡, Tan's green on the chosen option (block and classic checkout).
* Orders list: a Tan column with the delivery status, a progress bar and Tan's number.

= 0.2.4 =
* No server setting: a test key is test mode on Tan's server, so there is nothing to choose.
* Tan-styled dropdowns and a switch for "Complete on delivery".

= 0.2.1 =
* "Refresh the list" beside the pickup point, so a point just added in the partner cabinet shows at once.

= 0.2.0 =
* Tan's look: the logo, a branded settings page with connection, update and delivery tiles, and a delivery progress bar on the order and the customer's order page.
* A late or repeated update can no longer undo a delivered or cancelled status.
* Phone required at checkout when Tan delivery is chosen.

= 0.1.0 =
* First version.
