=== Paykoko - BNPL Payment Gateway ===
Contributors: kokopay
Tags: woocommerce, payment gateway, buy now pay later, koko, bnpl
Requires at least: 5.8
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 3.0.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Accept BNPL (Buy Now Pay Later) payments on your WooCommerce store via Koko — pay in 3 interest-free instalments.

== Description ==

Paykoko WooCommerce Plugin allows you to accept payments on your WooCommerce store via Koko accounts and allows installment-based payments.

**Features:**

* Accept Koko BNPL payments at checkout
* Display installment price breakdown on product and cart pages
* Full WooCommerce Blocks (Gutenberg checkout) support
* Sandbox/test mode for safe development
* OpenSSL signature verification for secure server callbacks
* Compatible with Woo Discount Rules

**How it works:**

Customers choose Koko at checkout, are redirected to the Koko payment page to confirm their 3-instalment plan, and are returned to your store upon completion. Order status is updated automatically via signed server callbacks.

== Installation ==

1. Go to **Plugins > Add New** in your WordPress admin.
2. Search for **Paykoko** and click **Install Now**.
3. Activate the plugin through the **Plugins** screen in WordPress.
4. Go to **WooCommerce > Settings > Payments** and enable **Koko: Buy Now Pay Later**.
5. Enter your Koko Merchant ID, API Key, Public Key, and Private Key (provided by Koko).
6. Enable **Sandbox Mode** for testing, then disable it for live payments.

== Frequently Asked Questions ==

= Do I need a Koko account to use this plugin? =

Yes. You need a Koko merchant account with a Merchant ID, API Key, and RSA key pair. Contact Koko to get your credentials.

= Is there a test mode available? =

Yes. Enable **Sandbox Mode** in the plugin settings to use the Koko QA environment for testing without real payments.

= Which WooCommerce versions are supported? =

The plugin supports WooCommerce 5.0 and above, including full WooCommerce Blocks (Gutenberg) checkout support.

= What currencies are supported? =

The plugin passes your WooCommerce store currency to Koko. Please confirm supported currencies with Koko directly.

== Screenshots ==

1. Koko payment option at WooCommerce checkout
2. Installment price breakdown on a product page
3. Plugin settings screen in WooCommerce > Payments


== External Services ==

This plugin connects to the Koko (Paykoko) payment API to process BNPL (Buy Now, Pay Later) payments on your WooCommerce store.

**What the service is and what it is used for:**
Koko is a third-party BNPL payment provider. This plugin sends order data to the Koko API to create a payment session and redirect the customer to complete their payment in 3 interest-free instalments.

**What data is sent and when:**
When a customer proceeds to pay using Koko at checkout, the following order data is sent to the Koko API:
- Merchant ID and API Key (to authenticate the request)
- Order ID, order total, and currency
- Customer first name, last name, email, and phone number
- Return, response, and cancel URLs

No payment card data is handled by this plugin — all sensitive payment processing happens on Koko's platform.

**Sandbox vs Live:**
- Sandbox (testing): `https://qaapi.paykoko.com`
- Live (production): `https://prodapi.paykoko.com`

**Service links:**
- Terms of Service: https://paykoko.com/m/terms
- Privacy Policy: https://paykoko.com/m/privacy

== Changelog ==

= 3.0.4 =
* Improved server callback handling for JSON and form-encoded payloads
* Added orderView API verification for browser-redirect edge cases
* Enhanced debug logging (only active when Debug Mode is enabled)
* OpenSSL key handling improved for PHP 7.x and PHP 8.x compatibility
* Code hardening: all outputs escaped, all inputs sanitised

== Upgrade Notice ==

= 3.0.4 =
Security and stability improvements. Update recommended for all users.
