# Allpay

### Connecting Allpay payment system

To work with the allpay payment system, go to the project on mavibot.pro and in the "Acquiring" section you find Allpay payment system.

<figure><img src="/files/8clmkM2dRJrGcJLLRXM6" alt=""><figcaption><p>Pic. 1. "Acquiring" section for connecting the payment service to Mavibot</p></figcaption></figure>

After clicking connect, a form for connecting the payment system opens.

<figure><img src="/files/unJ7B78FeHXE0XHKyOXg" alt=""><figcaption><p>Pic. 2. Entering the username and password from the service</p></figcaption></figure>

In this form, enter the **Username** and **password** for working with API of the payment system.

After that, click **Save settings**, after which we will see that the button for connecting Allpay payment system is displayed as "Connected":

{% hint style="success" %}
This means that the payment system is connected and you can go to work with it.
{% endhint %}

<figure><img src="/files/K0lh00Ze0ggsS8zvoV2V" alt=""><figcaption><p>Pic. 3. Displaying the button of the connected payment system</p></figcaption></figure>

### Configuring work with Allpay payment system

You need to send the customer's email address to Allpay. You can put it in the **allpay\_email** variable in the block

There are 2 ways to create a payment link:

1. To generate a payment link, you need to set **payment\_sum** variable value *(for example, 150 or 100.55 <mark style="color:red;">**(separated by a dot!))**</mark>,* and **allpay\_pay\_url** variable will appear immediately after that.

This variable can be displayed with a link or placed on a button with the text "Pay". There are additional parameters for this method, but they need to be declared in variables before **payment\_sum.** The **allpay\_currency** variable can be used to specify the currency, the default value is **'RUB'.** The **allpay\_lang** variable for specifying the language of the payment page, default is **‘ENG'.**

2. You can also create a link using the **allpay\_generate\_payment\_url** functio&#x6E;**(amount, email, currency, long).**

| Parameters (for second way):                                                               |
| ------------------------------------------------------------------------------------------ |
| amount - contains the payment amount                                                       |
| email - contains the customer's email address                                              |
| currency - optional parameter for specifying the currency (by default is ‘RUB’),           |
| lang -  optional parameter that specifies the payment page language (by default is ‘ENG’). |

The link will be the response to the execution of the function, put it in a variable

### EXAMPLES:

For the first way:

<figure><img src="/files/Qku6DrcwoFHuFEuneV3t" alt=""><figcaption></figcaption></figure>

> allpay\_email = '\*\*\*\*\*\*<1@mail.ru>'
>
> payment\_sum = 100

As a result, the following variable can be passed in the block by link:

<figure><img src="/files/Nxwkz80B6jFLYmq7Ldcy" alt=""><figcaption></figcaption></figure>

**Example** for the second way:

<figure><img src="/files/39YYhE4bKGfsPYUaNH4M" alt=""><figcaption></figcaption></figure>

> payment\_url = allpay\_generate\_payment\_url(100, '\*\*\*\*\*\*\*\*<1@mail.ru>')

As a result, variables will be created:

<figure><img src="/files/qSpRdhd4Rf19PRB4WdC9" alt="" width="266"><figcaption></figcaption></figure>

{% hint style="success" %}
After a successful payment, **allpay\_payment\_completed** variable will set to True, and you will also receive a callback about the successful payment.
{% endhint %}

{% hint style="info" %}
The first 8 characters of the password are used at the beginning of the text to work with the API.
{% endhint %}


---

# 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.mavibot.ai/payment/allpay.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.
