=== Aymakan Shipping ===
Contributors: aymakan
Tags: shipping, woocommerce, courier, tracking, delivery
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
WC requires at least: 8.0
WC tested up to: 11.1
Stable tag: 3.2.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Create Aymakan shipments, print AWBs, and sync tracking status in WooCommerce.

== Description ==

Aymakan Shipping connects a WooCommerce store to Aymakan so merchants can quote delivery rates at checkout and create shipments from the order screen.

= Features =

* Show an Aymakan shipping rate on classic checkout and the Cart/Checkout blocks
* Create a shipment and airway bill from an order
* Create shipments and print airway bills in bulk
* Store tracking numbers on the order using the WooCommerce order API
* Receive delivery status updates from Aymakan
* Works with High-Performance Order Storage (HPOS)
* Optional Dokan vendor pickup addresses

= Requirements =

* WordPress 6.2 or later
* WooCommerce 8.0 or later
* PHP 7.4 or later

== External services ==

This plugin connects to Aymakan to calculate shipping rates, create shipments, download airway bills, and load the supported city list.

* Production API: https://api.aymakan.net/v2
* Sandbox API (when Test Mode is enabled): https://dev-api.aymakan.com.sa/v2
* Tracking pages: https://aymakan.com and https://dev.aymakan.com

Requests include the store API key, pickup and delivery address, order reference, declared value, and shipment weight. Aymakan’s service terms apply: https://www.aymakan.com

Status updates are received at a private REST URL that includes a secret token. Copy that URL from the Aymakan shipping method settings into the Aymakan dashboard.

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/aymakan-shipping`, or upload the zip from Plugins → Add New.
2. Activate Aymakan Shipping. WooCommerce must already be active.
3. Go to WooCommerce → Settings → Shipping and add Aymakan to a shipping zone.
4. Enter the API key and warehouse collection details.
5. Copy the webhook URL into the Aymakan dashboard.

== Frequently Asked Questions ==

= Where do I find the API key? =

In the Aymakan account, open Integrations and copy the API key into the shipping method settings.

= Why is checkout not showing a shipping price? =

Confirm Aymakan is enabled inside a shipping zone that matches the customer address, the API key is saved, and Shipping Cost is set to “Aymakan Cost” or “Custom Cost”. Turn Test Mode on only when using a sandbox key.

= The create-shipment screen shows a translation notice. =

That notice is printed by another plugin loading translations before WordPress is ready. It is not part of Aymakan Shipping. On a live site, set `WP_DEBUG_DISPLAY` to false.

== Changelog ==

= 3.2.4 =
* Load saved shipping-zone settings before the settings form is rendered.

= 3.2.3 =
* Escape shipment forms and tracking links before they are printed.
* Sanitize shipment and webhook data, and verify the admin nonce before reading form input.

= 3.2.2 =
* Cleared Plugin Check warnings for the create-shipment screen, settings lookup, and translation loading.

= 3.2.1 =
* Keep debug notices from other plugins out of admin-ajax and checkout JSON responses.
* Show Aymakan checkout rates when the pricing API returns any supported price field.
* Require a secret token on the order-status webhook.
* Use the text domain `aymakan-shipping` so the plugin matches the WordPress.org slug.

= 3.2.0 =
* Declared compatibility with WooCommerce HPOS and Cart/Checkout blocks.
* Store shipment data with the WooCommerce order API.
* Added WordPress and WooCommerce version requirements.
* Registered the Shipped order status used by Aymakan webhooks.
* Limited shipment actions to shop managers and removed public AJAX hooks.

== Upgrade Notice ==

= 3.2.1 =
Copy the new webhook URL from the Aymakan shipping settings into your Aymakan dashboard. The URL now includes a secret token.
