# Adobe Commerce (Magento)

[Adobe Commerce](https://business.adobe.com/products/magento/magento-commerce.html) (Magento) is an e-Commerce platform built on open source technology which provides online merchants with a flexible shopping cart system, as well as control over the look, content and functionality of their online stores. Magento offers powerful marketing, search engine optimization, and catalog-management tools. Magento's ability to scale allows shops with only a few products and simple needs to easily expand to tens of thousands of products and complex custom behavior without changing platforms.

***

## Requirements

Before integrating your Magento store with DOKU, please ensure that the following requirements have been met:

1. Create a store with [Magento](https://business.adobe.com/products/magento/magento-commerce.html)
2. Create a [DOKU Business Account](https://docs.doku.com/get-started/create-account#create-your-first-business-account)
3. Magento version 2.3 or higher. This plugin is tested with Magento v2.3.4, v.2.3.6, v.2.4.0, v.2.4.1
4. PHP version 7.4.0 or higher
5. MySQL version 8.0 or higher

***

## Integration Guide

#### Step 1: Install DOKU Plugin for Magento

1. Download [DOKU Plugin for Magento](https://github.com/PTNUSASATUINTIARTHA-DOKU/doku-magento-plugin)
2. Copy `Jokul` folder into your `MAGENTO_DIR/app/code` directory on your store's webserver.
3. Run `php bin/magento module:status`. You should see `Jokul_Magento2` on list of disabled modules.
4. Run `php bin/magento module:enable Jokul_Magento2`
5. Run `php bin/magento setup:upgrade`
6. Run `php bin/magento module:status` again to ensure `Jokul_Magento2` is enabled already.
7. Flush Magento cache by running `php bin/magento cache:flush`
8. Compile Magento with newly added module by running `php bin/magento setup:di:compile`
9. Flush Magento cache again `php bin/magento cache:flush`​

#### Step 2: Plugin Setup

1. Log in to your Magento Admin Panel
2. Navigate to **Stores** > **Configuration**
3. Go to **Sales** > **Payment Methods**
4. Locate **DOKU** section
5. Click the dropdown arrow icon to view the details
6. Configure the following required fields:

   * **Environment**:&#x20;
     * For testing transactions, select **Sandbox**
       * **Sandbox Client ID**: Client ID retrieved from [DOKU Sandbox](https://sandbox.doku.com/bo/developer/api-keys)
       * **Sandbox Secret Key**: Secret Key retrieved from [DOKU Sandbox](https://sandbox.doku.com/bo/developer/api-keys)
     * For processing real transactions, select **Production**
       * **Production Client ID**: Client ID retrieved from [DOKU Dashboard](https://dashboard.doku.com/bo/developer/api-keys)
       * **Production Secret Key**: Secret Key retrieved from [DOKU Dashboard](https://dashboard.doku.com/bo/developer/api-keys)

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>Visit <a data-mention href="../../../../get-started/manage-business/set-up-integration#api-keys">#api-keys</a> for instructions on how to retrieve integration credentials (Client ID and Secret Key)</p></div>

   * **Expiry Time**: Expiration time in minutes
   * **Notification URL**: Payment notification URL for all payment methods
   * **QRIS Notification URL**: Payment notification URL for QRIS payment method
   * **Email Sender Address**: You can fill this column with your email address. This will later be used as info to send notifications to your customers
   * **Email Sender Name**: You can fill this column with your name. This will be used to email send notifications to your customers
   * **CC Email Adress**: You can fill this column other email adress. This will be used to email send notifications to your customers
   * **Email Notifications**: You can send an email containing a guide on how to complete the payment using specific payment methods
7. Click **Save Config**

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

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

1. Copy the **Notification URL** from the Magento Admin Panel
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. 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 instructions

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

***

## 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 `MAGENTO_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 Magento Admin Panel?</summary>

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

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.doku.com/accept-payments/integration-tools/e-commerce-and-plugins/adobe-commerce-magento.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
