=== Devtonic Payment Gateway for Lemon Squeezy ===
Contributors: hamzaafridi05
Donate link: https://devtonicstudios.com/lemon-squeezy/
Tags: lemon squeezy, payment gateway, payments, digital products, merchant of record
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept Lemon Squeezy payments at your WooCommerce checkout. A real payment gateway with automatic order updates and one-click webhook setup.

== Description ==

This plugin adds Lemon Squeezy as a payment method at your WooCommerce checkout. Customers pick Lemon Squeezy, pay on the secure Lemon Squeezy hosted checkout, and come back to your store. The WooCommerce order is updated automatically by webhook. No copying orders between two dashboards.

If your shop runs on WooCommerce and you want Lemon Squeezy to process the payments, this plugin is the bridge between the two.

Because Lemon Squeezy is a merchant of record, it handles sales tax, VAT, and global payment compliance on its side. You sell from your own WooCommerce store, Lemon Squeezy takes care of the tax paperwork.

I built this plugin because I needed it for my own store. I process my own payments through it every day. If it breaks, I feel it first.

= What the free version does =

* Adds Lemon Squeezy as a real WooCommerce payment gateway (redirect checkout)
* Marks WooCommerce orders paid automatically when the payment goes through
* Syncs refunds made in Lemon Squeezy back to the WooCommerce order
* One-click webhook setup: the plugin registers the webhook on Lemon Squeezy for you
* Every webhook request is verified with an HMAC-SHA256 signature before anything is processed
* Test mode so you can try the whole flow with test cards before going live
* Works with classic checkout and block checkout
* Compatible with WooCommerce High-Performance Order Storage (HPOS)
* Works with simple and variable products, with a Lemon Squeezy variant ID on the product and on each variation

= Pro version =

Everything in the free plugin keeps working forever. The [Pro version](https://devtonicstudios.com/lemon-squeezy/) adds what bigger stores need:

* Subscriptions: full lifecycle sync with 14 webhook events, no separate subscriptions plugin required
* License keys delivered onto the WooCommerce order and order emails automatically
* Overlay checkout: customers pay in a popup without leaving your site
* Refunds processed straight from the WooCommerce order screen
* One-click product sync with a variant dropdown on every product

= Requirements =

* WooCommerce 6.0 or newer
* PHP 7.4 or newer
* An SSL certificate (HTTPS), required for webhooks
* A free Lemon Squeezy account with at least one product

== External services ==

This plugin connects to the Lemon Squeezy API to process payments. It is not possible to use the plugin without this connection.

* When a customer checks out, the plugin sends the order total, order number, the customer's billing email, name, and billing country, state, and postcode to api.lemonsqueezy.com to create the checkout session. The customer is then redirected to a checkout page hosted by Lemon Squeezy.
* When you click "Register Webhook" or "Test Connection" in the admin, the plugin calls api.lemonsqueezy.com with your API key.
* Lemon Squeezy sends webhook notifications back to your site when orders are created or refunded.

This service is provided by Lemon Squeezy LLC: [terms of service](https://www.lemonsqueezy.com/terms), [privacy policy](https://www.lemonsqueezy.com/privacy).

== Installation ==

1. Install and activate the plugin (WooCommerce must be active).
2. Go to WooCommerce, then Settings, then Payments, then Lemon Squeezy.
3. Paste your API key and Store ID from your Lemon Squeezy dashboard (Settings, then API).
4. Go to WooCommerce, then Lemon Squeezy, and click "Register Webhook on Lemon Squeezy".
5. Edit a product and enter its Lemon Squeezy variant ID in the General tab.
6. Keep Test Mode on, make a test purchase with card 4242 4242 4242 4242, and check the order updates.
7. Turn off Test Mode to accept live payments.

The whole setup takes about 5 minutes.

== Frequently Asked Questions ==

= How is this different from the official Lemon Squeezy plugin? =

The official Lemon Squeezy plugin provides a standalone storefront that works independently of WooCommerce. This plugin serves a different purpose: it adds Lemon Squeezy as a payment method inside your existing WooCommerce store, so your orders and products stay in WooCommerce.

= Does it support subscriptions? =

Recurring subscription sync is a Pro feature. The free version handles one-time payments. In Pro, all 14 subscription webhook events are synced to the WooCommerce order, with no separate subscriptions plugin needed.

= Does it deliver license keys? =

License key delivery onto orders and emails is a Pro feature.

= Does it work with variable products? =

Yes. Put the Lemon Squeezy variant ID on the product, and on each variation if they map to different Lemon Squeezy variants. A variation with no ID of its own falls back to the one on the parent product.

= Do my orders stay in WooCommerce? =

Yes. That is the whole point. Orders are created and updated in your own WooCommerce database. If you ever stop using Lemon Squeezy, your order history stays with you.

= Is the webhook secure? =

Yes. Every webhook request must carry a valid HMAC-SHA256 signature. Requests with a missing or invalid signature are rejected with a 401 before any data is touched.

= Does this plugin charge any fees? =

No. The plugin is free. Lemon Squeezy charges its own payment processing fees on their side.

== Screenshots ==

1. Lemon Squeezy as a payment method at the WooCommerce checkout.
2. Gateway settings: API key, store ID, test mode and checkout language.
3. The Lemon Squeezy admin page with one-click webhook registration.
4. A WooCommerce order updated automatically after payment.
5. The Lemon Squeezy variant ID field on a product.
6. The same field on each variation of a variable product.

== Changelog ==

= 1.0.0 =
* First release.
* Lemon Squeezy payment gateway with redirect checkout.
* Automatic order updates via signed webhooks (order created, order refunded).
* One-click webhook registration.
* Test mode, HPOS compatibility, classic and block checkout support.

== Upgrade Notice ==

= 1.0.0 =
First release.
