# Installation instructions

Magento 2 Payment Widget:

{% file src="/files/hVTi7Aq35RhgGiz4im72" %}

{% stepper %}
{% step %}

### Creating the required folder structure

```
mkdir -p app/code/Alliance/AlliancePay
```

{% endstep %}

{% step %}

### Download/copy the module files to the created folder

```
The path must be: app/code/Alliance/AlliancePay/registration.php
```

{% endstep %}

{% step %}

### Provide correct file permissions (optional)

```
find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} +
find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} +
```

{% endstep %}

{% step %}

### Install module dependencies

```
composer install
```

{% endstep %}

{% step %}

### Enable the module

```
php bin/magento module:enable Alliance_AlliancePay
```

{% endstep %}

{% step %}

### Update the system

```
php bin/magento setup:upgrade
```

{% endstep %}

{% step %}

### Start compilation

```
php bin/magento setup:di:compile
```

{% endstep %}

{% step %}

### Deploy static files

```
php bin/magento setup:static-content:deploy -f
```

{% endstep %}

{% step %}

### Clear the cache

```
php bin/magento cache:flush
```

{% endstep %}
{% endstepper %}

### Technical requirements

* PHP version - 8.2
* Magento 2 version - 2.4
* For decryption and communication with Ecom, the payment module uses the following library - [GitHub - kelvinmo/simplejwt: A simple JSON web token library written in PHP.](https://github.com/kelvinmo/simplejwt) , which is built into the module itself
* The server must have **PHP** extensions, `gmp`, `hash`, `openssl`, `sodium` enabled \[for the `simplejwt` library to work]
* To get the required country code in `ISO3166` format, you need to install the[ league/iso3166](https://packagist.org/packages/league/iso3166) library version 4.3.3


---

# 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.merchant.alb.ua/en/payment-widgets-for-cms/magento-2/installation-instructions.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.
