# Accept Bayarcash payments in OpenCart

> Install the Bayarcash module in OpenCart 3 or 4, add your keys, choose payment channels and test before going live.
>
> Source: https://docs.bayarcash.com/opencart/

The Bayarcash module lets your OpenCart shop take payments through Bayarcash. It comes as one zip file for OpenCart 3 and another for OpenCart 4. Use the one that matches your store.

To see the module at work before you install it, try the [live demo](https://opencart.bayarcash-demo.com/).

## Before you start

You need the following:

- An approved Bayarcash merchant account with your payment channels enabled.
- Your **Personal Access Token**, **API Secret** and **Portal Key**. See [API keys](/api-keys/) and [Portals](/portals/).
- Malaysian Ringgit (MYR) set up as a currency in your store.

## Install the module

Download the module zip file from the [Bayarcash plugin page](https://plugin.bayarcash.com/). Then:

1. In the OpenCart admin, go to **Extensions** → **Installer** and upload the zip.
2. Go to **Extensions** → **Extensions** and choose the **Payments** type.
3. Find **Bayarcash** in the list. Click **Install**, then **Edit**.

## Add your keys

The settings open on the **API details** tab. To fill it in:

1. Keep or change **Payment Name**. This is the name customers see at checkout.
2. Paste your **Personal Access Token**, **API Secret** and **Portal Key**.
3. Leave **Sandbox Mode** off for real payments. Turn it on only with sandbox keys.
4. Save. OpenCart checks your token when you save.

## Choose channels and turn it on

Next, open the **General** tab:

1. Under **Payment Channels**, select the channels to offer. Hold Ctrl or Cmd to pick several.
2. Set **Status** to on.
3. Save.

Customers then see each channel at checkout, named after your **Payment Name**, for example "Bayarcash - Credit Card".

## Other settings

These tabs are optional:

| Tab | What it does |
|---|---|
| **Order status** | Sets the status for **Canceled Order Status**, **Failed Order Status** and **Paid Order Status**. |
| **Customize checkout** | **Instruction** shows your own text before the customer pays. |
| **Troubleshoot** | **Debug logging** writes details to the OpenCart error log. |

## Tips

- **Test before you go live.** Turn on **Sandbox Mode** with sandbox keys, place one order, then turn it off and use your live keys.
- **Check Sandbox Mode first if live payments fail.** It must be off for real payments.

## Common issues

### Checkout shows 'Bayarcash requires MYR currency to be set-up.'

Add Malaysian Ringgit (MYR) as a currency in your store. Bayarcash processes MYR only. Other currencies work only if Convert To Processing is on.

### I cannot save the settings because of a missing field.

Personal Access Token, API Secret, Portal Key and Payment Name are all required. If you turn on Instruction, Bayarcash Instructions is required too.

### Saving the settings shows the text error_invalid_token or error_pat_required.

These are unfinished error messages. They mean the Personal Access Token is empty or Bayarcash did not accept it. Copy the token again from your merchant dashboard and save.

### Customers see 'Invalid redirect.' or 'Payment method is incorrect!' at checkout.

Ask the customer to go back to checkout and choose the Bayarcash payment method again. If it keeps happening, turn on Debug logging on the Troubleshoot tab and share the OpenCart error log with support.
