# Tamara Payment Extension

## <mark style="color:red;">**Installation**</mark> <mark style="color:red;">Extension</mark>

### <mark style="color:red;">**Preliminary Works**</mark>

The following information is requested from the provider for the brand-specific and production (live) environment.

* **API\_URL**
* **API\_TOKEN**
* **NOTIFICATION\_TOKEN**

A hash\_key of at least 32 characters in length and a secret\_key of at least 41 characters in length should be generated. The keys produced during the installation must be stored. Here is an example command to generate a random key:

```
openssl rand -base64 41
```

{% hint style="info" %}
Before using the Tamara Payment integration, the **auto\_capture** feature must be enabled. Please contact Tamara for more information.
{% endhint %}

### <mark style="color:red;">**Environment Variables**</mark>

The extension installed to the relevant project in ACC must have the following environment variables. Environment variables can be entered before or after the deployment phase. As changes are made to the environment variables, the deployment process must be performed again.

| Variable            | Description                                                                               |
| ------------------- | ----------------------------------------------------------------------------------------- |
| SECRET\_KEY         | Code received during the preliminary works phase                                          |
| ADMIN\_USERNAME     | A username can be entered (example: ‘akinon’)                                             |
| ADMIN\_PASSWORD     | A newly created and extension-specific strong password                                    |
| ADMIN\_EMAIL        | The e-mail address of the installer can be entered                                        |
| HASH\_KEY           | Code received during the preliminary works phase                                          |
| WEBHOOK\_URL        | https\://**{SHOP\_URL}**/orders/hooks/payment                                             |
| API\_URL            | API URL received during the preliminary works phase (without a trailing slash at the end) |
| API\_TOKEN          | API TOKEN received during the preliminary works phase                                     |
| NOTIFICATION\_TOKEN | NOTIFICATION TOKEN received during the preliminary works phase                            |

## <mark style="color:red;">**Omnitron Settings**</mark>

The installed extension must also be defined to the project via Omnitron. This can be done on the **Payment Options & Add/Edit POS Integration** pages. After the settings are completed, it will be accessible under a new tab on the payment screen as it is a redirection type payment integration.

### <mark style="color:red;">**Payment Options**</mark>

One payment option must be defined in Omnitron to be specific for the extension installed. Explanations on how the settings should be made at this stage are in the table below.

| Field               | Description            |
| ------------------- | ---------------------- |
| Payment Option      | Redirect to bank       |
| Payment Option Name | Redirection            |
| Payment Option Slug | tamara                 |
| Config\*            | {"pos\_slug":"tamara"} |

{% hint style="info" %}
Fields other than pos\_slug should be determined according to the requirements.
{% endhint %}

### <mark style="color:red;">**POS Integration**</mark>

One POS integration must be defined in Omnitron to be specific for the extension installed. Explanations on how the settings should be made at this stage are in the table below.

| Field        | Description                                    |
| ------------ | ---------------------------------------------- |
| Name         | Tamara                                         |
| Slug         | tamara                                         |
| Gateway      | extension                                      |
| Resource URL | EXTENSION URL                                  |
| Username     | ADMIN\_USERNAME value in environment variables |
| Password     | ADMIN\_PASSWORD value in environment variables |
| Payment Type | AUTH                                           |

## <mark style="color:red;">**Webhook**</mark>

Webhook registration should occur after the extension is created.

[Webhook Registration & Order Authorisation](https://docs.tamara.co/docs/transaction-authorisation#notification-handling)

Webhook setup steps:

* Go to the following page: <https://partners-sandbox.tamara.co/#/webhooks/list>.
* Click on "Add webhook".
* On the new page, in the "Select type" section, choose **Order**.
* Under "Events", select **Approved**, **Declined**, and **Expired**.
* In the URL section, add the following URL using https: **https\://{EXTENSION\_URL}/webhook** then click "Create webhook" and save.

## <mark style="color:red;">**Cautions**</mark>

Before using the Tamara Payment integration, the **auto\_capture** feature must be enabled. Please contact Tamara for more information.
