=== Sendaro — Couriers for online stores ===
Contributors: trifon04
Tags: woocommerce, econt, speedy, shipping, cash on delivery
Requires at least: 5.6
Tested up to: 7.0
Requires PHP: 7.2
Stable tag: 1.0.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Embedded checkout with Bulgarian couriers (Econt, Speedy), automatic waybills and cash on delivery — connects your store to Sendaro in one click.

== Description ==

**Sendaro** turns your WooCommerce checkout into a fast, localized flow for Bulgaria: customers pick a courier and an office / parcel locker / home address right inside the checkout, and you get a ready-to-print waybill with one click from the Sendaro dashboard.

Sendaro is a hosted service (external SaaS). This plugin connects your WooCommerce store to your Sendaro account and loads the embedded checkout on your storefront. A free Sendaro account is required — sign up at https://sendaro.bg

= What it does =

* **Embedded checkout** with courier selection (Econt, Speedy and more), office / parcel locker / home address, a map of offices and geolocation.
* **Automatic waybills** — create them with one click from the Sendaro dashboard.
* **Cash on delivery** with real-time shipping cost calculation.
* **Dual prices** (EUR/BGN) using the official fixing rate.
* **Returns (RMA)** — a customer portal and optional prepaid return waybills.
* **SMS notifications** and automations (optional).
* **Orders are created automatically** both in your WooCommerce and in Sendaro.

= One-click connection =

After activating, open the **Sendaro** menu and click **"Connect to Sendaro"**. You approve it in your own Sendaro account — done. No API keys to enter and no code to paste: the plugin connects server-to-server and embeds the checkout automatically.

Don't have an account? Create a free one at https://sendaro.bg

== External services ==

This plugin connects to **Sendaro** (https://app.sendaro.bg) — the service that powers the checkout, couriers and waybills.

* **When:** on clicking "Connect to Sendaro", the plugin creates WooCommerce REST keys and hands them to Sendaro (a one-time, server-to-server handshake) so Sendaro can create/read orders. On the storefront, the embedded checkout script (app.sendaro.bg/checkout.js) is loaded.
* **What data:** order data (line items, totals, the delivery address/office, the buyer's contact details) — in order to create the order and the waybill.
* Terms: https://app.sendaro.bg/terms — Privacy: https://app.sendaro.bg/privacy

== Installation ==

1. Install the plugin (Plugins → Add New → search for "Sendaro", or upload the zip).
2. Activate it.
3. Open the **Sendaro** menu → click **"Connect to Sendaro"** → approve it in your Sendaro account.
4. Done — the embedded checkout is active.

== Frequently Asked Questions ==

= Do I need a Sendaro account? =
Yes — a free account at https://sendaro.bg. The plugin links your WooCommerce store to it.

= Do I have to enter API keys? =
No. Connecting is one click — the plugin creates and hands over the keys automatically, server-to-server.

= Which couriers are supported? =
Econt and Speedy are live; more are being added. Couriers are configured in the Sendaro dashboard.

== Changelog ==

= 1.0.1 =
* Fees from WooCommerce (COD fee, small-order fee) are now included in the cash-on-delivery amount.
* Items identified by SKU are no longer dropped from the WooCommerce order.
* A network error while creating an order is no longer retried — no more duplicate orders.
* A failed write-back to WooCommerce (expired key) is now shown on the order instead of failing silently.
* If the Sendaro checkout cannot load, the store's own checkout is restored instead of leaving the page without one.
* Old Sendaro REST keys are revoked; webhooks are removed even when WooCommerce is deactivated.
* Disconnecting now tells Sendaro, so the store is no longer shown as connected after the keys are revoked.
* New setting: the floating "Return an order" button can be turned off.
* Stores with "Plain" permalinks can now complete the connection (the handshake also tries the query-string REST route).
* No more flash of the native checkout before the Sendaro checkout takes over (early hide with a 7-second safety fallback).

= 1.0.0 =
* First release: one-click connection (OAuth-style), embedded checkout, automatic waybills, cash on delivery, returns.

== Upgrade Notice ==

= 1.0.1 =
Fixes money-path issues (fees and SKU items in the cash-on-delivery amount) and prevents duplicate orders. Recommended for all stores.

= 1.0.0 =
First release.
