# Wayforpay

* [How to connect ](#how-to-connect)
* [How to process the result ](#how-to-process-the-result)

{% hint style="info" %}

* Quick registration and confirmation of the merchant WITHOUT dancing with diamonds&#x20;
* Registration of merchant for a person without a website&#x20;
* Equal percentage for physical and legal persons - 2.5&#x20;
* Availability of GooglePay and ApplePay
  {% endhint %}

## How to connect&#x20;

To connect the wayforpay system you need 3 values:&#x20;

1. merchant login&#x20;
2. merchant secret key&#x20;
3. merchant’s domain name.

Go to your personal account -> [https://m.wayforpay.com/mportal/merchant/list ](<https://m.wayforpay.com/mportal/merchant/list >)store settings

Copy the data and go to the settings in Salebot.&#x20;

Open the section of payment systems, choose wayforpay. You need to enter the received data.

![](/files/ukApO3yYkjssdDt2HCyb)

To generate a link to a payment, you need to set the value of the payment\_sum variable (such as 150 or 100.55 (via a dot!)), immediately after wayforpay\_pay\_url variable appears. This variable can be displayed with a link or placed on the button with the text "Pay".&#x20;

The link has the form: <https://secure.wayforpay.com/invoice/id1bbb2ad0375> &#x20;

{% hint style="warning" %}
The default set is UAH (hryvnia), if you need another currency you need to set the value of the currency variable
{% endhint %}

Also, before setting the payment\_sum value, you can specify the following optional variables to configure the payment.&#x20;

**currency** - currency order by default UAH (possible values USD, EUR, RUB)&#x20;

**session\_timeout** - link lifetime in seconds, default is 3600 (1 hour)&#x20;

**product\_name** - product name&#x20;

**language** - the language of the page payment, by default UA (possible values RU, EN)

**buyer\_name** - the name of the buyer&#x20;

**buyer\_email** - buyer’s mail&#x20;

**buyer\_first\_name** - the name of the buyer&#x20;

**buyer\_last\_name** - buyer’s name

This view has a page for payment link.

&#x20;                                          ![](/files/fPNo9cbZYobkBsEDd6zW)

Create a link to a payment of 1 UAH and a lifetime of 2 hours

&#x20;                                             ![](/files/atl2yrVaLzKf5mqDhFr8)

{% hint style="info" %}
Please note:

* First specify optional product\_name parameters, etc.
* And last, assign the value of the payment\_sum variable
  {% endhint %}

Note, first we set the variables for the settings, then payment\_sum. You can define variables earlier in a chain, not in a single block, this is an example.

Next, at the right place, print the wayforpay\_pay\_url variable that contains the link

![](/files/KaNEoQtdgSA94J5ys9YU)

## How to process the result&#x20;

After successful payment in the bot will come kolbeks, on which you can understand that there was a successful payment. These colbecks in the system you see as messages from the user, so that they can not be sent by the user, they consist of the first 10 characters of the secret key and a notation \_success, for example: **flk3409ref\_success**

&#x20;                                         ![](/files/hc9aNIk7Z1z3tvQZv8wu)

{% hint style="info" %}
These callbacks ARE NOT SEEN to the user, they are displayed only to the operator
{% endhint %}

The type of comparison should be "Full match"&#x20;

Also, after successful payment, the variable **wayforpay\_payment\_completed** is set to true&#x20;

For example, you can make a successful payment processing block with a condition and print the corresponding message to the user:

&#x20;                                      ![](/files/BRPfmxoqD9UfTJkUPdiN)

Once the payment is complete, the **wayforpay\_callback\_data** variable will be added to the client, containing the payment system response data for the completed transaction. You can extract the necessary data from the dictionary using the get method.


---

# 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/integrations/payment/wayforpay.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.
