﻿=== Payments Square Connect ===
Contributors: wppayments
Tags: woocommerce, square, payments, contact form 7, subscriptions
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.2.2
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Square Hosted Checkout for WooCommerce & Contact Form 7. Always connected to Square, SKU stock sync, one-time and subscription payments.

== Description ==

= Pay on Square's page. Stay connected. Keep stock in sync. =

**Payments Square Connect** is built for store owners who want Square payments that *just work* — without checkout breaking, without surprise disconnects, and without inventory falling out of step.

Customers pay on **Square Hosted Checkout** (Square's secure page, not yours). You get WooCommerce orders, Contact Form 7 payments, and subscriptions — all through **one Square connection**.

**Why merchants choose this plugin:**

* **Checkout that doesn't break** — no card form buried inside your theme; buyers pay on Square and return automatically
* **Always-on Square connection** — access tokens renew in the background so API calls and checkouts keep working
* **Inventory in step (WooCommerce + Square)** — match products by **SKU** and Square catalog stock updates when a WooCommerce order is paid
* **One connect, every channel** — **WooCommerce**, **Contact Form 7**, and **subscriptions** from the same account
* **Security built in** — card data never touches your WordPress server

= Stock stays aligned when you sell on WooCommerce =

Sell on WooCommerce, run your business on Square — keep both sides honest.

When a product **SKU in WooCommerce matches your Square catalog**, checkout sends that line item to Square with the right catalog link. After payment, **Square inventory updates automatically** so your Square Dashboard reflects what actually sold.

No manual mapping screens — use the **same SKU on both sides** and you're done. No matching SKU? The product still goes to checkout **by name and price** so nothing blocks the sale.

**Tip:** Use matching SKUs on WooCommerce products and Square catalog variations for the smoothest inventory sync.

= A connection that keeps working =

Square Connect should not die quietly after a few weeks.

This plugin **renews your Square access token automatically** (daily checks and before API calls) so payment links, checkout settings, and catalog lookups are less likely to fail with a stale connection. The Connect screen shows when your token was last renewed — reconnect once after updating to pick up the latest permissions.

= Quick start =

1. Install and activate **Payments Square Connect**.
2. Open **Payments Square Connect** in the WordPress admin sidebar.
3. Choose **Sandbox** for testing or **Live** for real payments.
4. Click **Payments Square Connect**, sign in with Square, and pick your **Square Location**.
5. Click **Save connection settings**.
6. Turn on WooCommerce and/or Contact Form 7 (see below).

= Where to find settings =

Everything is under **Payments Square Connect** in the admin sidebar:

* **Payments Square Connect** — connect Square, choose Sandbox or Live, pick a location
* **Checkout Settings (Beta)** — wallets, tipping, branding, and policies on Square checkout (**Live mode only**)
* **Subscription Plans** — view your Square plans and copy plan IDs
* **Support** — email, WhatsApp, or the WordPress.org forum

= Connect Square =

Every payment uses this screen first.

1. Go to **Payments Square Connect → Payments Square Connect**.
2. Pick **Sandbox** while testing, or **Live** when you are ready to take real payments.
3. Click **Payments Square Connect** and sign in with your Square account.
4. Choose your **Square Location** from the list.
5. Click **Save connection settings**.

**Tips**

* Start in **Sandbox** so you can test without charging real cards.
* If you move your site to a new address, connect Square again from this page.
* Use **Disconnect Square** if you need to switch accounts.

= WooCommerce =

WooCommerce is **optional**. Install it only if you sell through a WooCommerce store.

1. Complete **Connect Square** above.
2. Go to **WooCommerce → Settings → Payments → Payments Square Connect**.
3. Turn the gateway **on**.
4. Set **Title** and **Description** (what shoppers see at checkout). Example: "Pay with Square".
5. Save and place a test order.

**At checkout:** the customer chooses your Square gateway, is sent to Square to pay, then returns to your **Order received** page.

**Subscriptions (optional):** create plans in Square, refresh **Subscription Plans** in this plugin, then pick a plan on each WooCommerce subscription product.

= Contact Form 7 =

Contact Form 7 is **optional**. Use it for donations, fees, registrations, and similar forms.

**One-time payment**

1. Connect Square first.
2. Add a tag to your form:
   * Fixed amount: `[square_pay amount:25.00]`
   * Amount from a form field: `[square_pay amount-field:your-amount]`
3. Publish the form. After submit, the visitor pays on Square and returns with a success message.

**Subscription signup**

1. Create plans in Square and copy a plan ID from **Subscription Plans**.
2. Add a tag like: `[square_subscribe variation:YOUR_PLAN_ID name:"Silver Membership" amount:15.00]`

= Subscription Plans =

Open **Payments Square Connect → Subscription Plans** to:

* See plans from your Square account
* Click **Refresh from Square** after you add or change plans
* Copy plan IDs for Contact Form 7 tags or WooCommerce products

**Good to know:** some payment methods (such as Cash App Pay and Afterpay) are not available for subscription sign-up.

= Checkout Settings (Beta) =

Customize Square checkout for payments created by this plugin.

**Live mode only** — switch to Live on the Connect screen first.

* **Merchant settings** — Apple Pay, Google Pay, Cash App Pay (Afterpay is managed in Square Dashboard)
* **Location settings** — customer notes, tipping, button style, store policy text

= Requirements =

* WordPress 6.0+
* PHP 7.4+
* A Square seller account
* WooCommerce — optional (for store checkout)
* Contact Form 7 — optional (for form payments)
* WooCommerce Subscriptions — optional (for recurring products)

== Installation ==

1. Activate **Payments Square Connect**.
2. Open **Payments Square Connect** in the admin sidebar.
3. Choose **Sandbox** or **Live**, sign in with Square, and save a location.
4. Enable WooCommerce and/or add Contact Form 7 tags if you need them.

== Frequently Asked Questions ==

= Do I need WooCommerce? =

No. You can take payments through Contact Form 7 without WooCommerce.

= Do I need Contact Form 7? =

No. If you only sell through WooCommerce, you do not need Contact Form 7.

= Where are the settings? =

**Payments Square Connect** in the WordPress admin sidebar.

= What is Sandbox vs Live? =

**Sandbox** is for testing — no real money. **Live** is for real payments. Start in Sandbox, then switch to Live when you are ready.

= How does the customer get back to my site? =

Square sends them back automatically after payment. WooCommerce shoppers see the order confirmation page. Form visitors return to the same form with a success message.

= Can I sell subscriptions? =

Yes. Create plans in Square, then use **Subscription Plans** in this plugin to connect them to WooCommerce products or Contact Form 7 forms.

= Why are Checkout Settings greyed out? =

Checkout Settings work in **Live mode only**. Connect in Live to change wallets, tipping, and branding.

= Is card data stored on my site? =

No. Customers enter payment details on **Square Hosted Checkout**. Your WordPress site does not store card numbers.

= Does WooCommerce stock sync with Square? =

When product **SKUs match** between WooCommerce and your Square catalog, paid orders can update **Square inventory** automatically. WooCommerce also reduces its own stock when payment is confirmed. Use the same SKU on both sides for the best results.

= How do I get help? =

Open **Payments Square Connect → Support** for email, WhatsApp, or the [WordPress.org support forum](https://wordpress.org/support/plugin/payments-connect-square/).

== Screenshots ==

1. Connect your Square account, choose Sandbox or Live, and pick a location.
2. Checkout Settings: wallets, tipping, branding, and policies (Live mode only).
3. Subscription Plans: view Square plans and copy plan IDs.
4. WooCommerce: enable the gateway and set checkout title and description.
5. Contact Form 7: add Square payment tags to a form.
6. Square Hosted Checkout: product names and totals shown on Square's payment page.

== Changelog ==

= 1.2.2 =
* README: shorten plugin short description to fit WordPress.org 150-character limit.

= 1.2.1 =
* README: refreshed plugin description — always-on Square connection, SKU inventory sync, and hosted checkout benefits.

= 1.2.0 =
* OAuth: automatically renew Square access tokens (daily background check and before API calls) so your connection stays active.
* Connect screen: shows when the access token was last renewed.
* WooCommerce: match products to Square catalog by SKU when creating checkout links (Square inventory can update on payment). No SKU match — product name and price are sent as before.
* Reconnect Square after updating to grant catalog read permission for SKU matching.

= 1.1.9 =
* Support page: remove visible WhatsApp phone number; Open WhatsApp button still works.

= 1.1.8 =
* README: simplified, user-friendly documentation.

= 1.1.7 =
* WooCommerce checkout on Square now shows each product name (plus shipping and fees) instead of one generic order line.

= 1.1.6 =
* README: added overview of Square Hosted Checkout benefits.

= 1.1.5 =
* Fixed Cash App Pay setting not saving in Checkout Settings.

= 1.1.4 =
* Improved Square connection permissions for Checkout Settings.

= 1.1.3 =
* Fixed error after connecting Square in some setups.

= 1.1.2 =
* Square Connect works without WooCommerce installed.
* Clearer connection error messages when debug logging is on.

= 1.1.1 =
* New Support page with email, WhatsApp, and forum link.

= 1.1.0 =
* New admin menu with Connect, Checkout Settings, and Subscription Plans.
* Subscriptions for WooCommerce and Contact Form 7.
* Checkout customization for Square hosted pages.

= 1.0.9 =
* More reliable return to your site after Square sign-in.

= 1.0.8 =
* Fixed connection errors after redirect from Square.

= 1.0.7 =
* Fixed connect failures when the site URL changes.

= 1.0.6 =
* Easier first-time Square connection setup.

= 1.0.5 =
* One Square connection for WooCommerce and Contact Form 7.
* Contact Form 7 payment tag support.

= 1.0.4 =
* Plugin updates and licensing improvements.

= 1.0.3 =
* WordPress.org naming and compatibility updates.

= 1.0.2 =
* Display name and text domain updates.

= 1.0.0 =
* Initial release.
