# WooCommerce

## PayKKa for WooCommerce Payment Plugin

PayKKa for WooCommerce integrates WooCommerce with PayKKa payment services. The plugin provides the following checkout experience:

- **PayKKa Hosted**: Customers are redirected from WooCommerce checkout to PayKKa Hosted Checkout to complete payment.


The plugin supports payment status synchronization, refunds, sandbox testing, and production traffic switching.

## Preparation

### System Requirements

- [WordPress](https://developer.wordpress.org/advanced-administration/before-install/howto-install/) 6.0 or later
- [WooCommerce](https://woocommerce.com/document/installing-woocommerce/) 9.0.0 or later
- [PHP](https://www.php.net/manual/install.php) 7.4 or later


### Register a PayKKa Account

Complete sandbox account registration, identity verification, merchant onboarding, and transaction key configuration as described in the [Integration Guide](/payments/docs/introduction/integrated-guide). Then obtain the following information from PayKKa:

- Sandbox App ID, Merchant ID, private key, and Client Key
- Production App ID, Merchant ID, private key, and Client Key
- PayKKa platform public key used for webhook signature verification


Contact your integration representative if you need to enable specific payment methods or obtain production credentials.

## Install the Plugin

Contact your integration representative to obtain the payment plugin package.

1. In the WordPress admin, go to **Plugins -> Add New -> Upload Plugin**.
2. Select the PayKKa for WooCommerce ZIP file.
3. Click **Install Now**, then click **Activate Plugin**.
4. Confirm that **PayKKa for WooCommerce** appears in the installed plugin list.


## Configure PayKKa Hosted

### Open the Gateway Settings

In the WordPress admin, go to **WooCommerce -> Settings -> Payments -> PayKKa Hosted -> Manage**.

The PayKKa Hosted settings page contains three tabs:

- **Connection settings**
- **Standard payments**
- **Advanced settings**


### Connection Settings

On the **Connection settings** tab:

1. Select **Enable PayKKa payments**.
2. Enter the payment method title and description shown to customers at checkout.
3. Save the settings.


### Standard Payments

On the **Standard payments** tab, configure sandbox and production credentials separately:

1. Select **Sandbox** for testing, or clear it for production.
2. Enter **Sandbox Private Key**, **Sandbox Merchant Id**, required **Sandbox App Id**, and **Sandbox Client Key**.
3. Enter **Private Key**, **Merchant Id**, required **App Id**, and **Live Client Key** for production.
4. Select the production **API region**:
  - Europe: `https://openapi.eu.paykka.com`
  - Hong Kong: `https://openapi.paykka.com`
5. Save the settings.


The App ID is required. It is sent in the `x-paykka-appid` request header and must not be left empty or replaced with the Merchant ID.

### Advanced Settings

On the **Advanced settings** tab:

1. Enable debug mode and request-result logging only while troubleshooting.
2. Paste the PayKKa platform public key to enforce verification of the `x-paykka-sign` webhook signature.
3. Save the settings.


Keep the platform public key configured in production. Leave it empty only for temporary sandbox debugging.

## Test and Verify Payments

### Checkout Display

Place a test order from the storefront and confirm that the enabled PayKKa payment methods are displayed.

### PayKKa Hosted Payment

1. Select **PayKKa Hosted** at checkout.
2. Place the order and complete payment on PayKKa Hosted Checkout.
3. Confirm that the customer returns to the WooCommerce order-received page.
4. Confirm that the WooCommerce order status and PayKKa transaction status are both updated.


## Go Live

Before accepting live payments:

1. Clear **Sandbox** in **PayKKa Hosted -> Standard payments**.
2. Confirm that the production App ID, Merchant ID, private key, Client Key, and API region are correct.
3. Disable debug mode and request-result logging.
4. Complete a live payment, refund check, and webhook verification.


## Updates and Maintenance

- Upgrade the plugin with a package provided by your integration representative.
- Back up your WordPress site and test the upgrade in a non-production environment first.
- Keep WordPress, WooCommerce, PHP, and the PayKKa plugin up to date.
- Rotate transaction keys according to your security policy and update the plugin configuration immediately after rotation.