# Masterpass Installment Integration

## <mark style="color:red;">**Installation**</mark> <mark style="color:red;">Integration</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**

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
```

### <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                                                                                            |
| TASK\_INTERVAL\_MINUTES | Update interval in minutes. Default: 10                                                                                                           |
| API\_URL                | API URL received during the preliminary works phase (without a trailing slash at the end) <https://mp-backend.masterpassturkiye.com/merchant/api> |

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

The installed extension must also be defined to the project via Omnitron.

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

The config section of the payment option added to Omnitron should be configured as follows:

```
{
    #...
    "installment_slug": "masterpass"
}
```

### <mark style="color:red;">**Dynamic Settings - INSTALLMENT\_PROVIDERS**</mark>

```
{
    "masterpass": {
        "auth": {
            "base_url": "<EXTENSION_URL>/v1",
            "password": "<ADMIN_PASSWORD value in environment variables>",
            "username": "<ADMIN_USERNAME value in environment variables>"
        },
        "conf": {},
        "klass": "omnishop.payments.installment_services.providers.installment_extension.InstallmentExtensionClient"
    }
}
```
