# OpenCart

Empower your OpenCart online store with the PayLater OpenCart Plugin, a cutting-edge solution designed to enhance the purchasing journey for both merchants and customers. This seamlessly integrated plugin opens up a world of possibilities, allowing merchants to offer a convenient and flexible PayLater option at checkout.

## Download plugin

**Download:** [OpenCart v3.1.1 · latest](https://docs.paylaterapp.com/downloads/opencart/3.1.1/paylater.ocmod.zip) ([release notes](https://docs.paylaterapp.com/release-notes.html#opencart-3-1-1))

Always install the latest version. Older releases are deprecated — see the [release notes](https://docs.paylaterapp.com/release-notes.html) for the full version history.

> **Note: PHP requirement**
>
> The PayLater plugin needs **PHP 8.2 or newer**. Keep PHP up to date with the latest security release for your version.

## Installation

Paylater empowers merchants to offer the popular Buy Now, Pay Later (BNPL) payment option to their customers on their OpenCart websites. This document guides you through the installation and setup process of the PayLater plugin.

### Before you begin

Ensure you have an OpenCart store installed and running.

### Compatibility

| Component | Supported |
| --- | --- |
| OpenCart | **OpenCart 4.0.x** (tested on 4.0.2.3). OpenCart 3.x is not supported. |
| PHP | 8.2 or newer (tested on 8.3) |
| Store currency | QAR. A new OpenCart store has no QAR currency: add it under **System → Localisation → Currencies** and make it the default. PayLater and its widgets are shown only when the store's default currency and the shopper's chosen currency are both QAR, and the settings page warns you if the default is something else. |

### Frontend Widgets:

PLP Product List Page

![PayLater widget on the OpenCart product list page](https://docs.paylaterapp.com/assets/img/plugins/opencart/01.png)

PDP Product Detail Page

![PayLater widget on the OpenCart product detail page](https://docs.paylaterapp.com/assets/img/plugins/opencart/02.png)

![PayLater instalment breakdown on the OpenCart product detail page](https://docs.paylaterapp.com/assets/img/plugins/opencart/03.png)

## Install the extension

Install the extension from the OpenCart admin with the Extension Installer.

> **Note: Replacing an older version**
>
> If an older PayLater version is installed, first uninstall PayLater under **Extensions → Extensions → Payments**, then uninstall and delete it in **Extensions → Installer**. Otherwise the upload is refused with `Extension already installed!`. Note your Client ID, Client Secret and Outlet ID before you uninstall.
>
> Version 3.0 was packaged one folder too deep and was rejected with `Warning: Could not find install.json!`. If you tried it, delete `system/storage/marketplace/paylater.ocmod.zip` on your server before you upload the current version. Otherwise the installer answers `File already exist!`, and the failed file does not appear in the admin, so you cannot delete it there.

- Navigate to **Extensions → Installer**, click **Upload** and choose the PayLater zip, then click **Install** next to PayLater in the list.

![PayLater shown in the OpenCart Extension Installer after uploading](https://docs.paylaterapp.com/assets/img/plugins/opencart/04.png)

*After uploading, PayLater appears in the Extension Installer list*

## Configurations

- Once installed, navigate to **Extensions → Extensions** and choose **Payments** from the type filter.
- Locate PayLater in the list, click **Install** (the green + button), then **Edit**.

![PayLater listed among the available payment gateways in OpenCart](https://docs.paylaterapp.com/assets/img/plugins/opencart/05.png)

![Managing the PayLater payment gateway in OpenCart](https://docs.paylaterapp.com/assets/img/plugins/opencart/06.png)

- Fill in the PayLater settings:

| Setting | What to enter |
| --- | --- |
| Status | Turns the PayLater payment method on or off. |
| Mode | **UAT** with the [test credentials](https://docs.paylaterapp.com/test-environment.html), or **Production** with your live credentials. |
| Client ID / Client Secret | Your OAuth credentials from PayLater. |
| Outlet ID | Your outlet ID from PayLater. |
| UAT Base URL / Production Base URL | Pre-filled with `https://connect.uat.paylaterapp.com/` and `https://connect.paylaterapp.com/`. Leave them as they are unless PayLater tells you otherwise: your Client Secret is sent to these addresses. |
| Payment Method Title | The payment method name shown at checkout. |
| Sort Order | Position of PayLater in the list of payment methods. |
| Webhook URL | Shown read-only. Send it to the PayLater team so they can register it. |
| Webhook Secret | Provided by PayLater after they register your webhook URL. |
| Widget settings | Turn the widget on or off for the product listing and product detail pages, and set its minimum amount (QAR), title and footer text. |

![Entering the PayLater Client ID and Client Secret in the OpenCart configuration](https://docs.paylaterapp.com/assets/img/plugins/opencart/07.png)

![Entering the PayLater Outlet ID in the OpenCart configuration](https://docs.paylaterapp.com/assets/img/plugins/opencart/08.png)

- Click Save Changes to complete the configuration

## Testing

To ensure smooth functionality, it's recommended to test the PayLater payment option:

- Add a product to your cart and proceed to checkout
- During checkout, select PayLater as the payment method.
- You will be redirected to the secure PayLater platform to complete the BNPL payment process.
- Use a test shopper account from the [Test environment](https://docs.paylaterapp.com/test-environment.html).
- Please use 300 QAR as the amount to test

> **Note: Credentials**
>
> Get your `Client ID`, `Client Secret`, and `Outlet ID` from your PayLater account dashboard. For your `Webhook Secret`, share your webhook endpoint with the PayLater team. For sandbox values and test shoppers, see the [Test environment](https://docs.paylaterapp.com/test-environment.html).
