=== VayaPin Connector ===
Contributors: vayapin
Tags: woocommerce, checkout, address, autofill, vayapin
Requires at least: 6.0
Tested up to: 7.1
Stable tag: 2.3.2
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

VayaPin Checkout Autofill for WooCommerce: one-click address autofill with GPS-precise VayaPin codes. Free plugin; API token from VayaPin. Starter plan includes 50 conversions/month, no credit card.

== Description ==

**Product:** VayaPin Checkout Autofill for WooCommerce (this package: **VayaPin Connector**).

**Stop losing sales at checkout. Stop losing money on failed deliveries.**

41% of customers abandon their cart when address entry is difficult. 39% of deliveries fail due to inaccurate addresses. VayaPin Checkout Autofill helps merchants close the gap: customers enter a short code (e.g. MARIA86) and billing/shipping fields can fill via the VayaPin API.

**WooCommerce:** requires 3.0 or higher; tested through 11.x in marketplace QA. **WordPress:** 6.0+, tested up to 7.1.

**What VayaPin is**

A GPS-precision digital address: a human-readable code mapped to a location, coordinates, entrance photos, and delivery instructions where the profile includes them.

**How it works**

1. Install and configure under WooCommerce / VayaPin admin — classic checkout and WooCommerce Blocks.
2. Customer with a VayaPin enters the code for autofill; without a code they checkout normally and can opt in to create a VayaPin (e.g. “Create my VayaPin for faster checkout everywhere”).
3. Orders can store GPS, instructions, and photos where provided; QR delivery labels for partners where enabled.
4. Customers who create a VayaPin via your store can treat it as a “Favourite Pin” for your brand (VayaPin product behaviour).

**Why merchants use it**

* Less checkout friction, especially on mobile.
* Coordinates and entrance context, not only street text.
* Customer data can stay current when they update their VayaPin.

**Plugin features**

* VayaPin autofill field — label, placeholder, position.
* API lookup — name, address, phone, email, city, postcode, country, GPS (per API response).
* Opt-in for new VayaPin creation.
* Order meta for delivery/GPS; QR labels; delivery metabox on orders.
* Analytics in admin where implemented.
* Classic + Blocks checkout; HPOS compatible; hooks/filters; responsive; consent-oriented flows.

**Pricing**

Plugin download is free. API token from [vayapin.com/developers](https://vayapin.com/developers). **Starter:** 50 conversions/month, free, no credit card. **Paid tiers** (Business, Professional, Scale, Enterprise) — see [vayapin.com/pricing](https://vayapin.com/pricing). Paid SaaS plans include a 30-day money-back guarantee per VayaPin terms.

**Extended copy** (comparison table, stats, full FAQ): see `README.md` in this repository.

== External services ==

This plugin uses the **VayaPin API** during checkout and admin flows.

* Service: VayaPin API
* Endpoint (example): [https://cs.vayapin.com](https://cs.vayapin.com)
* Terms: [VayaPin Terms of Use](https://vayapin.com/terms-of-use)
* Privacy: [VayaPin Privacy Policy](https://vayapin.com/privacy-policy)

Only send data required for API auth and lookups you enable. Use a valid token; disclose flows in your privacy policy.

== Installation ==

1. Upload `vayapin` to `/wp-content/plugins/` or install from a package.
2. Activate under **Plugins**.
3. Install **WooCommerce** (3.0+; validate against your version).
4. Open **VayaPin** / **WooCommerce → VayaPin**, set API key and environment, save.
5. Configure checkout copy, styling, webhooks, delivery options.

API token: [vayapin.com/developers](https://vayapin.com/developers)

== Frequently Asked Questions ==

= Is the free plan completely free — no credit card required? =

Yes. Starter includes 50 conversions/month at no cost, no credit card. All plugin features on Starter per current VayaPin plan rules.

= Will this slow down my store? =

Assets load on checkout with minimal footprint; marketplace positioning references Core Web Vitals. Profile your site with your theme and other plugins.

= What happens when a customer doesn't have a VayaPin? =

They use a normal address. Optional checkbox can offer VayaPin creation; they receive a code by email for future stores.

= Does this work with my theme and checkout setup? =

Compatible with major WooCommerce themes, classic checkout, and Blocks. Hooks/filters for customization; heavy custom checkout may need support.

= Is customer data secure and GDPR compliant? =

Encrypted connections; explicit checkout consent for VayaPin data. You remain responsible for legal basis and notices.

= What if a customer moves or changes contact details? =

Updated VayaPin data applies on their next lookup/order.

= Do my customers need the VayaPin Chrome extension? =

No. Checkout uses the field + API. The Chrome extension is a separate product.

= What data does my store receive per order? =

Name, address, phone, email, city, postcode, country, GPS, entrance type, delivery instructions — as returned by the API.

= What happens if I exceed my monthly conversion limit? =

Alerts at 80% and 100%; overages may apply — [vayapin.com/pricing](https://vayapin.com/pricing).

= Can I use this on multiple WooCommerce sites? =

Yes. Each site should use its own API token; limits are per token.

= What payment gateways does VayaPin work with? =

All major WooCommerce gateways; VayaPin only handles address autofill.

= Do you offer refunds? =

30-day money-back on paid SaaS per VayaPin policy (support@vayapin.com). The plugin file is free.

= Where is documentation and support? =

* [docs.vayapin.com](https://docs.vayapin.com)
* [support.vayapin.com](https://support.vayapin.com)
* [vayapin.com/feature-requests](https://vayapin.com/feature-requests)

== Screenshots ==

1. The ultimate digital address — GPS coordinates, image/video guidance, gate codes, delivery notes, and universal map support for flawless first-attempt deliveries.
2. Next-level checkout and flawless deliveries — one-click autofill via VayaPin alias boosts conversions and eliminates failed drop-offs with GPS-powered delivery.
3. Lightning-fast 1-click checkout — shoppers enter their VayaPin alias to instantly autofill all billing and shipping fields, reducing cart abandonment.
4. Native QR code delivery labels — auto-generated scannable labels on packing slips let any courier navigate to the exact drop-off point without a special app.
5. Track conversions and build trust — monitor VayaPin checkout usage from your WordPress dashboard and display customizable "VayaPin Accepted" trust badges.

== Changelog ==

= 2.3.2 =
* Change: the mobile sheet takes the widget's own background colour instead of white, so the panel and the pin field read as one surface. The colour follows the merchant's accent setting.
* Fix: the sheet's back arrow disappeared under storefront button styling (themes match plain buttons through [type=button], which ties on specificity and loads last). The sheet's own controls are now insulated from it.

= 2.3.1 =
* Fix: inside the mobile sheet the pin row lost its styling (oversized GO button, collapsed input) because the widget styles hang off a class that stayed behind on the original container. The row now matches the desktop layout exactly.
* Fix: the sheet's back button and search field no longer inherit storefront button and input styling.

= 2.3.0 =
* New: on phones the whole widget flow opens in a bottom sheet: pin entry, country picking with search and full-size rows, drag or flick down to dismiss. Desktop keeps the existing popup.
* Fix: the widget scripts relied on jQuery's removed `.load()` shortcut and only ran on sites that still load jQuery Migrate.

= 2.2.9 =
* Fix: typing and backspace were blocked in the VayaPin field after the country list had been opened. The list was hidden by class only, which left the country plugin's key handler bound and it cancelled every key press.
* Fix: the "Not found. Please enter a valid VayaPin." message stayed on screen after closing the popup. It is cleared on close, on reopen, and as soon as the code is edited.

= 2.2.8 =
* Fix: checkout autofill left "Street address" and "Apartment" empty for pins that store the street number or the building name in separate fields (JP pins among them). The street line is now built from road + house number, the second line from building name + addition.
* Fix: city and state fall back to their "_part" counterparts when the primary field is empty.

= 2.2.7 =
* Fix: checkout autofill now clears the "required field" validation errors on the fields it fills, instead of leaving them red until the field is touched manually.
* Fix: new VayaPin creation sent only the last name in the `name` field, which the API rejected with HTTP 422 ("name: must include a last name"). Full first + last name is sent now, per the /v1/pins contract.
* Fix: API validation errors were logged with an empty message, so a failed pin creation showed a bare HTTP_422 with no reason. The error code, message and per-field errors are parsed and stored now.
* Change: Pin Creation History CSV export includes the raw API response for failed attempts.

= 2.2.0 =
* New: VayaConnect — request a VayaPin address from any customer. Adds a Partners tab listing WooCommerce customers with their VayaPin status (verified / pending / none) and a "Request VayaPin address" button.
* New: inbound `pin.address_updated` webhook receiver (REST: /wp-json/vayapin/v1/webhooks) with HMAC-SHA256 verification and replay idempotency. The verified record (VayaPin ID, every script, GPS, QR) is written back to the customer/order automatically.
* New: VayaConnect record surface on the order detail screen and customer profile.
* New: carrier-ready international label (dual-script + QR) at /vayapin-intl-label/{order_id}.
* New: VayaConnect on/off toggle (off by default). The outbound request verb is behind a single contract seam pending the VayaCore backend.

= 2.1.1 =
* Fix: VayaPin widget no longer breaks the WooCommerce checkout form (nested form removed; Place order works again).
* Fix: country dropdown no longer clipped by the popup; anchored below the input and widened.
* Fix: country list now closes when clicking inside the popup.
* Fix: mobile layout — flag positioning, input padding, and full-width GO button.
* Fix: selecting a country on mobile no longer closes the popup.
* Change: Changelog link in settings footer now points to the WordPress.org plugin page.

= 2.0.0 =
* Settings UI refresh, checkout/delivery, webhooks, logging, compatibility. Readme aligned with WooCommerce marketplace listing and API disclosure.

= 1.0.0 =
* Initial public structure for the VayaPin Connector plugin.

== Upgrade Notice ==

= 2.3.2 =
Mobile sheet visual fixes: single tinted surface and a visible back arrow.

= 2.3.1 =
Fixes the pin row layout inside the mobile sheet.

= 2.3.0 =
Adds the mobile bottom sheet and fixes empty street fields after autofill. Test the checkout widget on a phone after updating.

= 2.2.9 =
Fixes the VayaPin input becoming uneditable after opening the country list, and the stale "Not found" message.

= 2.2.8 =
Fixes empty street address fields after autofill for pins with a separate house number or building name.

= 2.2.7 =
Fixes checkout validation errors sticking after autofill and VayaPin creation failing with HTTP 422. Recommended for all stores.

= 2.2.0 =
Adds VayaConnect (Partners tab + inbound address webhook). Disabled by default — enable it under the Partners tab and set a webhook secret. Re-save permalinks if the international label URL 404s.

= 2.1.1 =
Checkout reliability fixes (Place order, country dropdown, mobile). Recommended for all stores. Test checkout on staging after update.

= 2.0.0 =
Major update: review settings, re-save if needed, test checkout on staging.
