=== LendPro Payment Gateway ===
Contributors: lendproplugin
Tags: woocommerce, payment, bnpl, buy-now-pay-later, financing
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 2.1.24
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
Requires Plugins: woocommerce

Adds LendPro as a Buy Now, Pay Later payment method to WooCommerce using a popup iframe and webhook confirmation.

== Description ==

LendPro Payment Gateway integrates [LendPro](https://www.mylendpro.com) into WooCommerce as a Buy Now, Pay Later (BNPL) payment method. Customers complete their LendPro financing application inside a popup iframe without leaving your store. Payment confirmation is handled automatically via webhooks.

**Features:**

* BNPL checkout via LendPro popup iframe
* Pre-qualification banner (shortcode `[lendpro_banner]`) — lets customers check financing eligibility before reaching checkout
* Automatic billing address sync from LendPro to the WooCommerce order
* Guest and logged-in customer support via a persistent customer key
* Order splitting for mixed leasable/non-leasable carts
* WooCommerce HPOS (High-Performance Order Storage) compatible

**Third-Party Service**

This plugin connects to the LendPro API, a third-party BNPL financing platform operated by LendPro Financial Corp. The API is used to:

1. Launch a financing application inside a checkout popup iframe
2. Receive payment confirmation via an incoming webhook

Customer data (name, email, phone, billing and shipping address, cart items) is transmitted to LendPro servers when a customer initiates checkout or a pre-qualification application. This transmission occurs only when the customer actively clicks to proceed with LendPro financing.

* LendPro website: https://www.mylendpro.com
* LendPro Terms of Use: https://www.mylendpro.com/privacy-notice
* LendPro Privacy Policy: https://www.mylendpro.com/privacy-notice

You must have an active merchant account with LendPro to use this plugin.

**Privacy**

This plugin sets a first-party cookie (`_lendpro_customer_key`) to track a returning customer's financing application across sessions. For logged-in users the key is stored in user meta instead of a cookie. The cookie contains only a random identifier — no personal data. Site owners using this plugin should update their privacy policy and cookie notice accordingly.

No data is sent to external servers automatically on page load. Data is only transmitted to LendPro when the customer explicitly interacts with the LendPro checkout or pre-qualification flow.

== Installation ==

1. Upload the `lendpro-payments` folder to `/wp-content/plugins/`.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Go to **WooCommerce → Settings → Payments → LendPro** and enter your API credentials (provided by LendPro).
4. Copy the generated **Webhook Secret** and provide it to your LendPro account manager, or use the **Sync Webhook** button to register it automatically.

== Frequently Asked Questions ==

= Do I need a LendPro account? =

Yes. You must have an active merchant account with LendPro. Contact [LendPro](https://www.mylendpro.com) to get started.

= Does this work with WooCommerce Blocks checkout? =

Not currently. The Blocks checkout integration is under development. The plugin works with the classic WooCommerce checkout.

= What data is sent to LendPro? =

When a customer initiates a LendPro payment or pre-qualification, the following data is transmitted to LendPro's servers: first name, last name, email address, phone number, billing address, shipping address, and cart item details (description, SKU, quantity, price).

= Is HPOS supported? =

Yes. The plugin declares compatibility with WooCommerce High-Performance Order Storage (custom order tables).

== Changelog ==

= 2.1.19 =
* Removed redundant Plugin URI header to resolve validation warnings.

= 2.1.18 =
* Added a new release version for recent minor changes.

= 2.1.17 =
* Final code sanitation and missing WordPress Plugin Check corrections.

= 2.1.16 =
* Update "Tested up to" and "Requires at least" headers for WordPress Plugin Directory compliance.

= 2.1.15 =
* Resolved all remaining WordPress Plugin Check issues for repository approval.

= 2.1.14 =
* Fix fatal error caused by malformed isset checks in $_GET/$_POST validation.

= 2.1.13 =
* Fix syntax errors from escaped quotes.

= 2.1.12 =
* Addressed WordPress plugin checker feedback (localization, escaping, DB queries, naming conventions).

= 2.1.10 =
* Internal release — stability improvements and code quality fixes for WordPress.org submission

= 2.1.0 =
* Added order splitting for mixed leasable/non-leasable carts
* Added billing address sync from LendPro webhook to WooCommerce order

= 2.0.0 =
* Initial public release with popup iframe checkout and webhook confirmation

== Upgrade Notice ==

= 2.1.10 =
Recommended update. Includes stability improvements.
