=== KeedPay Checkout for WooCommerce ===
Contributors: break1st, specterlabs
Tags: woocommerce, checkout, payment, redirect, keedpay
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.3
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Official KeedPay plugin for WooCommerce. Redirects checkout to KeedPay for secure plan-based payments.

== Description ==

**KeedPay Checkout for WooCommerce** is the official plugin developed by KeedPay to seamlessly integrate their payment system with WooCommerce. It redirects customers from the default WooCommerce checkout to KeedPay's external checkout page. Each WooCommerce product (or product variation) can be linked to a KeedPay plan by filling the **"Plan ID"** field added to the product edit screen.

### Key Features:
* Official integration with KeedPay's payment platform.
* Automatic redirect from WooCommerce checkout to KeedPay.
* Sends one or multiple plan IDs as query parameters.
* Adds a "Plan ID" field to product and variation edit screens.
* Option to enable/disable the redirect from plugin settings.
* Secure handling of the payment redirection process via KeedPay.

### How the plugin works
When a customer initiates checkout on WooCommerce, the plugin uses the Plan ID set on the product (or variation) to redirect them to the KeedPay payment page. Only the Plan ID is passed to KeedPay, which is used to direct the customer to the correct plan for payment. The customer completes the transaction directly on the KeedPay platform.

**This plugin does not store or handle payment data locally.** All payment processing happens securely through KeedPay.

### Data usage and privacy
When a customer initiates a purchase, the following data is sent to KeedPay:
- The `plan_id` defined in the product settings.

**KeedPay handles all payment data securely.**

For more details on KeedPay's data handling practices, please refer to their Privacy Policy and Terms of Service:
- [KeedPay Terms of Service](https://keedpay.com.br/terms-of-use.pdf)
- [KeedPay Privacy Policy](https://keedpay.com.br/privacy-policies.pdf)

**Note:** This is the official plugin developed by KeedPay to integrate WooCommerce stores with the KeedPay payment platform. It is supported and maintained by the KeedPay team.

== Installation ==

1. Upload the `keedpay-checkout-for-woocommerce` folder to `/wp-content/plugins/`.
2. Activate the plugin through the 'Plugins' menu in WordPress.
3. Go to **Products → Edit product**, open the **General** tab, and fill the **Plan ID** field with the plan code from your KeedPay dashboard. For variations, fill it in the variation options.
4. (Optional) Go to **Settings → KeedPay Checkout** to enable/disable the automatic redirect.
5. Add products to the cart and click the checkout button; the customer will be redirected to KeedPay's checkout page to complete the payment.

== Frequently Asked Questions ==

= What is the KeedPay platform? =
KeedPay is an online payment platform that intermediates the sale of digital and physical products and services. It provides tools for creators and affiliates to create and manage their sales, including options for recurring payments (subscriptions), customizable checkout, and a members area.

= How do I link a product to a KeedPay plan? =
Edit the product, go to the **General** tab and fill the **Plan ID** field that this plugin adds. For variable products, fill the Plan ID in the variation settings.

= What format are plan IDs sent in? =
Plan IDs are sent as repeated query parameters. For example:
https://app.keedpay.com.br/checkout/PRIMEIRO_PLAN_ID?plan_id=PRIMEIRO_PLAN_ID&plan_id=OUTRO_PLAN_ID

== Changelog ==

= 1.0.1 =
* Added nonce to the Plan ID field of the variations
= 1.0.2 =
* Enhance plan ID retrieval by accounting for product quantities in the cart
= 1.0.3 =
* Remove primary cart item from query params