=== Trust Teddy Connector for WooCommerce ===
Contributors: ttdev2
Tags: woocommerce, gift, checkout, gifting, address
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Let a shopper buy a gift without knowing the recipient's shipping address — the recipient supplies it themselves after accepting.

== Description ==

Trust Teddy lets a shopper buy a gift for someone without knowing their shipping address. At checkout, the buyer can choose gift messaging instead of entering an address; the recipient is then emailed a private link where they accept or decline the gift and, on acceptance, enter their own address directly. The order only moves forward for fulfillment once the recipient has approved it.

This plugin is the WooCommerce-side connector: it adds the gift checkbox to checkout, creates the recipient-facing pages, and keeps the order status in sync with what's happening on the Trust Teddy Orchestration Layer (Core).

= Features =

* Works with both WooCommerce checkout modes — classic (shortcode) and Blocks — with a matching Trust Teddy panel in each.
* A single checkbox on checkout: "Don't have the recipient's shipping address? Use Trust Teddy." Unchecked, checkout behaves exactly like stock WooCommerce. Checked, the shipping address fields hide, no shipping is charged, and the buyer is taken to gift messaging instead.
* Automatically creates its own required pages on activation (gift checkout confirmation, claim page) — no manual page setup.
* One-click registration with Trust Teddy Core from the plugin's settings page. The Core URL is built into the plugin and the per-store API key is issued automatically on registration — nothing to configure by hand.
* New stores register in a disabled state; a Trust Teddy admin must approve the store from the Core dashboard before it can process real gifts.
* Distinct, accurate order statuses so a merchant can tell what happened without opening the order — see the Order Statuses section below.
* Optional SMS notifications (in addition to email) when a contact phone number is set on the settings page.

= Requirements =

* WordPress with WooCommerce active (the plugin declares WooCommerce as a hard dependency and will not run without it).
* A reachable Trust Teddy Orchestration Layer (Core) instance — the URL is baked into the plugin build, not something a merchant configures.

= Order statuses =

* Gift invited — awaiting address: Recipient has been emailed their claim link and hasn't responded yet.
* Gift declined: Recipient declined the gift; payment hold released, no charge.
* Gift invite expired: The recipient's claim link expired before they responded.

Once a recipient accepts and submits their address, the order proceeds through WooCommerce's normal order lifecycle like any other order.

== Installation ==

1. In WordPress admin, go to Plugins → Add New → Upload Plugin and upload the plugin zip, then Activate.
2. On activation, the plugin automatically creates its required pages (gift checkout confirmation, claim page) — no manual setup needed.
3. Go to WooCommerce → Settings → Trust Teddy.
4. (Optional) Enter a Contact Phone in E.164 format (e.g. +15551234567) to also receive SMS notifications alongside email.
5. Click "Register with Trust Teddy Core".
6. Wait for a Trust Teddy admin to approve the store from the Core admin dashboard — new stores register disabled by default and can't process real gifts until approved.
7. Once approved, the store's Merchant ID appears on the settings page and the "Don't have the recipient's shipping address? Use Trust Teddy" option is live on checkout.

No manual entry of an API key or Core URL is required at any point.

== External services ==

This plugin connects to Trust Teddy Core, the Trust Teddy Orchestration Layer that powers the "hide the shipping address, use gift messaging instead" feature. It's required for the plugin to work — Core is what invites the recipient, collects their shipping address, and hands it back to your store for fulfillment.

The plugin sends data to Trust Teddy Core in these cases:

* When you click "Register with Trust Teddy Core" on the settings page: your store's URL, store name, and admin email (and phone number, if you've entered one) are sent to create your merchant account.
* When a customer places a gift order: the order's line items, total amount, and the buyer's name/email are sent, so Core can invite the recipient.
* When the recipient accepts the gift: the recipient's name, email, phone, and the shipping address they enter are sent to Core, encrypted at rest, and released back to your store once fulfillment is ready.
* Each time you save the settings page: your admin email and contact phone (if set) are re-sent to keep your Core account's contact info current.

This service is provided by Trust Teddy: [Terms of Service](https://trustteddy.com/terms/), [Privacy Policy](https://trustteddy.com/privacy/).

== Frequently Asked Questions ==

= Where can I find the FAQ content? =

Pending — FAQ content to be supplied by Trust Teddy and added here before marketplace submission.

== Screenshots ==

1. To be added — marketplace screenshots are pending.

== Changelog ==

= 0.1.0 =
* Initial release.
