=== Keyvey – License sync for NinjaTrader and Sierra Chart ===
Tags: ninjatrader, sierra chart, woocommerce, licensing, stripe
Requires at least: 6.4
Tested up to: 6.8
Requires PHP: 8.1
Stable tag: 0.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Keep NinjaTrader and Sierra Chart add-on licenses in step with WooCommerce, Stripe, Whop and PayPal payments.

== Description ==

Keyvey watches your sales (WooCommerce orders and subscriptions, Stripe, Whop and PayPal webhooks) and keeps the matching NinjaTrader licenses and Sierra Chart DLL authorizations in sync. One product can unlock both:

* Collects the buyer's NinjaTrader account email and/or Sierra Chart account name at checkout.
* Sierra Chart: authorizes the account for your DLL through Sierra Chart's Web API (throttled), with a Reconcile screen that compares Sierra Chart's list with your paid licenses. Not yet run against the live Sierra Chart service.
* Extends the license expiry when a subscription renews.
* Ends access when a subscription is cancelled, a payment is refunded or disputed.
* Retries failed platform calls automatically and shows everything that needs attention in one screen.
* Emails buyers when their license is ready or has ended.
* Lets buyers fix or change their NinjaTrader email themselves ([keyvey_account_change] shortcode).
* Imports your existing customers from CSV, and exports licenses to CSV.
* Groups licenses you must create by hand in NinjaTrader into one batch, with a bulk paste of license IDs.
* Emails you when something needs a human, and shows a health check screen.
* Supports WordPress's personal-data export and erase tools.

Your NinjaTrader and Sierra Chart credentials stay on your own server, encrypted with your site's secret keys. The plugin sends no telemetry.

Free for one product on one platform, up to 10 active licenses. Paid plans (Starter $49/month, Pro $149/month, Business $249/month; yearly = 2 months free; prices pending confirmation) add licenses, products and platforms and are unlocked with a plan key checked offline. Everything is self-serve from Settings → Billing: buy, one-click key install, upgrade, downgrade, card changes and cancellation (Stripe customer portal). Paid keys renew themselves: about once a month the plugin sends only its plan key and the site's domain to billing.keyvey.app to fetch the renewed one. Free sites never contact Keyvey.

= Status =

Early preview. Creating a brand-new NinjaTrader license is a guided manual step (the plugin tells you exactly what to create, you paste back the license ID) until NinjaTrader documents an API for creating licenses. Renewals and revocations use NinjaTrader's documented license update endpoint.

== Installation ==

1. Upload the `keyvey` folder to `/wp-content/plugins/` and activate it.
2. Open **Keyvey → Product mapping** and map each product you sell to a NinjaTrader product ID.
3. Under **Settings**, add your NinjaTrader Ecosystem API details (or keep Mock mode to try it out).
4. For Stripe or Whop, add the webhook URLs shown on the Dashboard and paste the signing secrets into Settings.

== Privacy ==

No data leaves your site except the calls you configure to NinjaTrader / Sierra Chart, and fetching PayPal's signing certificate from PayPal when PayPal webhooks are used. Buyer emails are sent with wp_mail(). Keyvey registers a personal-data exporter and eraser and suggested privacy-policy text.

== External services ==

* Keyvey billing (billing.keyvey.app): only on sites with a paid subscription plan key. About once a day in the 5 days before renewal, when you click Check for a renewed key now, return from Manage billing, or click Move my plan, the plugin sends the plan key (and, for a move, this site's host name) and receives a renewed key. Nothing about your buyers or sales is sent. Manage billing and the plan buttons send you to Stripe-hosted pages. Terms: https://keyvey.app/terms.html, privacy: https://keyvey.app/privacy.html.
* NinjaTrader Ecosystem API, Sierra Chart Web API and PayPal's certificate server: only when you turn them on, as described above.

== Changelog ==

= 0.1.0 =
* First preview.
