# WooCommerce (WordPress)

[WooCommerce](https://woocommerce.com/) is a WordPress plugin that transforms a WordPress website into a fully functional e-Commerce platform. WooCommerce enables website owners to set up online stores with ease. It provides a range of features for managing products, inventory, orders, and payments, making it a popular choice for businesses and individuals looking to establish an online presence for selling goods or services. With WooCommerce, users can customize their online stores and leverage various extensions and themes to enhance the functionality and appearance of their e-Commerce websites.

***

## Requirements

Before you integrate your WordPress website with DOKU, make sure that you have fulfilled the following requirements:

1. Create a website with [WordPress](https://wordpress.org/)
2. Create a [DOKU Business Account](https://docs.doku.com/get-started/create-account#create-your-first-business-account)
3. WordPress version 5.6 or higher. This plugin is tested with Wordpress 6.7.2
4. WooCommerce version 4.9.0 or higher. This plugin is tested with WooCommerce v10.0.0
5. PHP version 8.2 or higher
6. MySQL version 5.6 or higher

***

## Integration Guide

This integration guide consists of 3 **mandatory** steps:

1. Install DOKU Plugin on WooCommerce
2. Configure DOKU Payment in WooCommerce
3. Set Up Payment Notification on DOKU Dashboard

#### Step 1: Install DOKU Plugin on WooCommerce

<figure><img src="https://1457116080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWIsxU2UGMS7iidoMSuyz%2Fuploads%2F1n9Zwt91JSPaof5jmDOO%2FDoku%20Add%20Plugins.jpeg?alt=media&#x26;token=e365e08c-b242-4113-987b-198b8e816a25" alt="" width="563"><figcaption></figcaption></figure>

1. Log in to your Wordpress Dashboard
2. Navigate to **Plugins** > **Add New Plugin**
3. Search for **DOKU Payment**, then click **Install Now**

#### Step 2: Configure DOKU Payment in WooCommerce

<figure><img src="https://1457116080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWIsxU2UGMS7iidoMSuyz%2Fuploads%2F6AFfCijyKQgvBtXDyE7m%2FDoku%20Configure%201.jpeg?alt=media&#x26;token=c2ca2869-8e92-4ef1-b359-c29d75cbe664" alt="" width="563"><figcaption></figcaption></figure>

1. Go to **WooCommerce** > **Settings** > **Payments** tab
2. Make sure **DOKU-Checkout** and **DOKU General-Configuration** are enabled, then click **Manage** on **DOKU General-Configuration**.
3. Configure the following required fields:
   * **Enable DOKU**: Checkbox must be ticked
   * **Environment**
     * For testing transactions, select **Sandbox**
     * For processing real transactions, select **Production**
   * **Sandbox Client ID**: Client ID retrieved from [DOKU Sandbox](https://sandbox.doku.com/bo/developer/api-keys?utm_source=docs)
   * **Sandbox Secret Key**: Secret Key retrieved from [DOKU Sandbox](https://sandbox.doku.com/bo/developer/api-keys?utm_source=docs)
   * **Production Client ID**: Client ID retrieved from [DOKU Dashboard](https://dashboard.doku.com/bo/developer/api-keys?utm_source=docs)
   * **Production Secret Key**: Secret Key retrieved from [DOKU Dashboard](https://dashboard.doku.com/bo/developer/api-keys?utm_source=docs)
   * **Expiry Time**: Checkout page expiry time in minutes
   * **Abandoned Checkout:** Checkout link can be extended past expiry time if toggled on
   * **Duration Abandoned Checkout:** Maximum time the checkout link stays active after expiration

{% hint style="info" %}
Visit [#api-keys](https://docs.doku.com/get-started/manage-business/set-up-integration#api-keys "mention") for instructions on how to retrieve integration credentials (Client ID and Secret Key)
{% endhint %}

#### Step 3: Set Up Payment Notification on DOKU Dashboard

{% hint style="warning" %}
If you skip this step, your payment status on WooCommerce Dashboard will not be synced with DOKU Dashboard
{% endhint %}

<figure><img src="https://1457116080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWIsxU2UGMS7iidoMSuyz%2Fuploads%2FxNpQoqmmrxNjZPBLmKIe%2FDoku%20Notif%20url.jpeg?alt=media&#x26;token=f3c78eb8-a6f2-4148-b8f9-47df39de9713" alt="" width="563"><figcaption></figcaption></figure>

1. Copy the **Notification URL** from the WooCommerce settings (DOKU-General Configuration)
2. Log in to your **DOKU Dashboard**
   * For testing transactions, visit [DOKU Sandbox](https://sandbox.doku.com/bo/login?utm_source=docs)
   * For processing real transactions, visit [DOKU Dashboard](https://dashboard.doku.com/bo/dashboard?utm_source=docs)
3. Navigate to **Settings** > **Payments Settings**, then go to each payment method settings page

<figure><img src="https://1457116080-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWIsxU2UGMS7iidoMSuyz%2Fuploads%2FMOvZ9MyD4iTsFVJQVlcm%2FDashboard%20Payment%20Settings.jpeg?alt=media&#x26;token=d131b0f4-bc12-40d9-b019-7350f33bf861" alt="" width="563"><figcaption></figcaption></figure>

4. Set up the payment notification URL for each payment method that you have activated using the notification URL that you have copied earlier from the WooCommerce settings. Visit [#set-up-payment-notification](https://docs.doku.com/get-started/manage-business/set-up-integration/webhook-payment-notification#set-up-payment-notification "mention") for detailed instructions

Once payment notification has been configured, you can start accepting payments with DOKU.

***

## Activate Payment Methods

You can activate more payment methods for your WooCommerce store by following the steps below:

1. Log in to [DOKU Dashboard](https://dashboard.doku.com/bo/login?utm_source=docs), and then access the side navigation bar
2. Select **Settings** from the menu
3. **Settings** page will appear. Under **Account** section, select **Service**
4. On **Service** page, click **ADD SERVICE**
5. Select the payment method you would like to activate
6. Click **ACTIVATE**.

Notes:

* Some payment methods can be activated instantly.
* Others may require approval from our **Risk Screening Team** before they become active.
* Certain payment methods may also require **credential registration** before activation is complete.
* Certain payment methods may be seen as disabled, because it can only be activated with the assistance of our Sales team. You may contact our Sales team by filling the following [form](https://www.doku.com/en-US/contact-sales?utm_source=docs).

***

## Checkout Page Configuration

By configuring your checkout page, you will be able to:

1. **Show or hide, and sort payment methods for your customers**\
   Choose which payment methods (e.g., cards, e-wallets, and virtual accounts) tp appear on your checkout page. You can also reorder them based on your preference or customer behavior to optimize conversions.
2. **Customize the interface**\
   Adjust the look and feel of your checkout page to align with your brand. This includes modifying button colors, fonts, logos, and layout to ensure a seamless and branded customer experience.
3. **Set a default expiry time**\
   Define how long a payment session remains valid before it expires. This is useful for limiting pending transactions and encouraging quicker payments, especially for methods like virtual accounts or retail outlets.

Visit [customize-checkout-page](https://docs.doku.com/accept-payments/integration-tools/doku-checkout/customize-checkout-page "mention") for more detailed information.

***

## Error Log

​Error log, also known as `doku_log`, helps simplify the process of identifying issues related to the payment process when using the DOKU Plugin. If any issues arise while using the plugin, you can contact our support team and provide the `doku_log` file to assist with troubleshooting. The `doku_log` file records all transaction activity by date, regardless of the payment method used.

**How to Enable and Access the doku\_log:**

1. Open the `WooCommerce_dir` directory on your store’s web server.
2. Create a new folder named `doku_log` in your store’s directory. This enables the plugin to automatically log activity to your web server.
3. Navigate to the `doku_log` folder and open the log file corresponding to the date of the issue.
4. You can view or download the log file as needed.

If an issue occurs, please send the relevant `doku_log` file to our support team. This helps us investigate and resolve the issue more efficiently.

***

## FAQ

<details>

<summary>How to retrieve my integration credentials (Client ID and Secret Key) ?</summary>

Please refer to the guide on [#api-keys](https://docs.doku.com/get-started/manage-business/set-up-integration#api-keys "mention") to obtain your integration credentials.

</details>

<details>

<summary>Why is my payment status not updated on WooCommerce?</summary>

Payment notification URL must be set up on DOKU Dashboard for the transaction status to be updated on WooCommerce Dashboard. Please be sure to not skip step number 3 in the Integration Guide section.

</details>
