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

Square Hosted Checkout for WooCommerce, CF7, WPForms & Fluent Forms. Payment links, wallets, SKU sync.

== 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, WPForms, Fluent Forms payments, payment link buttons, and subscriptions — all through **one Square connection**.

**Why merchants choose this plugin:**

* **No extra plugin fee** — this plugin does not add a per-payment charge on top of Square's processing rates
* **24/7 support available anytime** — email, WhatsApp, and the WordPress.org forum whenever you need help
* **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**, **WPForms**, **Fluent Forms**, **payment link buttons**, and **subscriptions** from the same account
* **Digital wallets everywhere** — **Apple Pay**, **Google Pay**, **Cash App Pay**, and **Afterpay/Clearpay** on WooCommerce, Contact Form 7, WPForms, Fluent Forms, and payment link buttons (when enabled in Square)
* **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, Contact Form 7, WPForms, Fluent Forms, and/or payment link buttons (see below).

= Payment link button (no form plugin required) =

Add a **Pay Now** button on any page or post — no WooCommerce or form builder required.

**Shortcode**

`[square_payment_link amount="25.00" label="Pay Now" description="Consultation fee"]`

Alias: `[square_pay_link]`

**Gutenberg block**

1. Edit any page or post in the block editor.
2. Click **+** and search for **Square Payment Link**.
3. In the block sidebar, set **Amount**, **Button label**, and optional **Description** / **Currency**.
4. Publish the page. Visitors click the button, complete payment on Square, and return to the same page with a thank-you message.

**Shortcode block:** add a Shortcode block and paste the shortcode above if you prefer.

= 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** — **24/7 support available anytime** via 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.

**Payment methods:** One-time CF7 payments use **Square Hosted Checkout** — the same page as WooCommerce. Buyers can pay with **Apple Pay**, **Google Pay**, **Cash App Pay**, **Afterpay/Clearpay**, or card when those methods are enabled under **Checkout Settings** (and Afterpay in the Square Dashboard). No extra setup per form.

**One-time payment**

1. Connect Square first.
2. Enable wallets under **Checkout Settings → Merchant settings** (Live mode).
3. Add a tag to your form:
   * Fixed amount: `[square_pay amount:25.00]`
   * Amount from a form field: `[square_pay amount-field:your-amount]`
4. Publish the form. After submit, the visitor pays on Square (with your enabled wallets) 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]`

**Note:** Cash App Pay and Afterpay are for one-time CF7 payments only — not subscription signup.

= WPForms =

WPForms is **optional**. Use it for donations, fees, registrations, and similar forms with the familiar WPForms builder.

**Payment methods:** One-time WPForms payments also use **Square Hosted Checkout**. Visitors can pay with **Apple Pay**, **Google Pay**, **Cash App Pay**, **Afterpay/Clearpay**, or card — the same wallets as WooCommerce and Contact Form 7 when enabled in **Checkout Settings**.

**One-time payment**

1. Connect Square first.
2. Enable wallets under **Checkout Settings → Merchant settings** (Live mode).
3. Edit your form in **WPForms → All Forms**.
4. Add a **Single Item** payment field for the amount.
5. Add the **Square Hosted Checkout** field (under Payment fields).
6. Open **Payments** in the form builder and enable **Payments Square Connect → One-time payments**.
7. Publish the form. After submit, the visitor pays on Square (with your enabled wallets) and returns with a success message.

**Subscription signup**

1. Create plans in Square and copy a variation ID from **Subscription Plans**.
2. In the form **Payments** panel, enable **Subscription signup** and paste the **Square plan variation ID**.

**Note:** Cash App Pay and Afterpay are for one-time WPForms payments only — not subscription signup.

= Fluent Forms =

**Fluent Forms Pro** is required (payment module). Use the same Square connection as WooCommerce — you do not enter separate Square API keys in Fluent Forms.

**Payment methods:** One-time Fluent Forms payments use **Square Hosted Checkout** with **Apple Pay**, **Google Pay**, **Cash App Pay**, **Afterpay/Clearpay**, or card when enabled under **Checkout Settings**.

**One-time payment**

1. Connect Square first.
2. In **Fluent Forms → Global Settings → Payment**, enable the payment module.
3. Open **Payment Methods** and enable **Payments Square Connect**.
4. Create a form with payment item fields, a **Payment Summary**, and a **Payment Method** field.
5. In the Payment Method field, select **Payments Square Connect** / **Square Hosted Checkout**.
6. Publish the form. After submit, the visitor pays on Square and returns with a success message.

**Note:** Subscription items are not supported through this Square hosted checkout integration yet.

= 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, WPForms forms, 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 **all** payments created by this plugin — WooCommerce, Contact Form 7, WPForms, and Fluent Forms.

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

* **Merchant settings** — turn on **Apple Pay**, **Google Pay**, and **Cash App Pay** for every hosted checkout from this plugin. **Afterpay/Clearpay** is enabled or disabled in the Square Dashboard (shown as read-only in the plugin).
* **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)
* WPForms — optional (for form payments)
* Fluent Forms Pro — 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, WPForms, Contact Form 7, Fluent Forms, and/or add payment link buttons if you need them.

== Frequently Asked Questions ==

= Do I need WooCommerce? =

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

= Do I need Contact Form 7? =

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

= Do I need WPForms? =

No. WooCommerce and Contact Form 7 work independently. Use WPForms only if you want the WPForms builder.

= 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, Contact Form 7 forms, or WPForms.

= Does this plugin charge an extra fee on payments? =

No. **Payments Square Connect** does not add a platform or application fee on top of your payments. You pay Square's normal card processing rates only.

= Is support available? =

Yes. **24/7 support available anytime** — open **Payments Square Connect → Support** for email, WhatsApp, or the [WordPress.org support forum](https://wordpress.org/support/plugin/payments-connect-square/).

= 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.

= Do Contact Form 7 and WPForms support Apple Pay, Google Pay, Cash App, and Afterpay? =

Yes. **One-time** payments from Contact Form 7 and WPForms use the same **Square Hosted Checkout** as WooCommerce. Enable **Apple Pay**, **Google Pay**, and **Cash App Pay** under **Payments Square Connect → Checkout Settings → Merchant settings** (Live mode). Enable **Afterpay/Clearpay** in your Square Dashboard. Buyers see whichever wallets you have turned on, plus card entry on Square's page.

Cash App Pay and Afterpay are **not** available for subscription signup on CF7 or WPForms forms.

= Do Fluent Forms work with Square wallets? =

Yes, with **Fluent Forms Pro**. Enable **Payments Square Connect** under **Fluent Forms → Global Settings → Payment → Payment Methods**, then add a **Payment Method** field to your form and select Square Hosted Checkout. Wallets follow the same **Checkout Settings** as WooCommerce.

== 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. WPForms: Square Hosted Checkout field and Payments Square Connect panel.
7. Square Hosted Checkout: product names and totals shown on Square's payment page.

== Changelog ==

= 1.3.3 =
* **WooCommerce checkout** — orders stay **Pending** when customers are redirected to Square Hosted Checkout; they move to **Processing** only after Square confirms payment (fixes abandoned checkouts showing as Processing too early).
* **Webhooks** — Square payment-completed webhooks now update orders that are still **Pending** after redirect.

= 1.3.2 =
* **Fluent Forms Pro** — Square Hosted Checkout payment method using your existing Square connection.
* **Payment link button** — `[square_payment_link]` shortcode and **Square Payment Link** Gutenberg block for pages and posts without WooCommerce or a form plugin.
* **Documentation** — README updates for wallets, Fluent Forms, payment links, and Gutenberg usage.

= 1.3.1 =
* **Cash App Pay & Afterpay** — payment links now pass `accepted_payment_methods` (Cash App Pay and Afterpay/Clearpay) per Square Checkout API requirements so enabled wallets appear on hosted checkout.

= 1.3.0 =
* **WPForms** — Square Hosted Checkout field, Payments Square Connect panel, one-time payments and subscription signup.
* **24/7 support** — help available anytime via Support page (email, WhatsApp, forum).

= 1.2.x (1.2.0 – 1.2.2) =
* Automatic Square OAuth token renewal; connect screen shows last renewal time.
* WooCommerce SKU catalog matching and Square inventory sync on paid orders.
* Documentation and plugin listing improvements.

= 1.1.x (1.1.0 – 1.1.9) =
* Admin menu: Connect, Checkout Settings (Beta), Subscription Plans, Support.
* Subscriptions for WooCommerce and Contact Form 7; checkout customization on Square hosted pages.
* WooCommerce itemized checkout lines; connection, Cash App Pay, and checkout settings fixes.

= 1.0.x (1.0.0 – 1.0.9) =
* Initial release: Square Hosted Checkout for WooCommerce and Contact Form 7, one shared Square connection.
* OAuth reliability, site URL change handling, and connection setup improvements.
