# Paypal

* [How to Set Up Paypal ](#how-to-set-up-paypal)
* [How to Create a Payment Link ](#how-to-create-a-payment-link)
* [How to process the result](#how-to-process-the-result)

## How to Set Up Paypal&#x20;

To work with paypal, you need to get two keys: client\_id and secret&#x20;

Go to the page[ https://developer.paypal.com/developer/applications/ ](< https://developer.paypal.com/developer/applications/ >)

And choose from the list or create a new application:

![](/files/lmMUvAHVVZOaCAv8EFg6)

At the top, change the switch to Live mode and select the application you want. Opens a page with the settings where you can find the data you want:

![](/files/4sx3v2D9BDYElBywT1xi)

Copy data and paste it into the corresponding fields in the Salebot - Payment Systems - Paypal settings:

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

![](/files/NyErioFscKMihx0VdYdp)

That’s the end of the connection.

## How to Create a Payment Link&#x20;

To generate a paylink, you need to set the payment\_sum variable value and the paypal\_pay\_url variable appears immediately.&#x20;

payment\_title is not a mandatory variable, it is the name of the product. If you do not specify is filled with the text: "Payment account order\_id" (order\_id - order identifier in the server)&#x20;

payment\_description - product description, optional&#x20;

In addition, before you specify payment\_sum, you can specify in which language the payment page will be. To do this, you need to set the variable locale, the default is Russian (ru-RU). All possible options: **da-DK, he-IL, id-ID, ja-JP, no-NO, pt-BR, ru-RU, sv-SE, th-TH, zh-CN, zh-HK, zh-TW.**&#x20;

And the third additional parameter is company\_name - the name of your company, displayed at the very top of the page (example below, company).

&#x20;                                       &#x20;

You can also specify the currency in which the payment is accepted, for this we specify the variable currency, the default is set ruble (RUB), for the dollar set its value USD (currency = USD). Possible currency variants can be found under the link [https://developer.paypal.com/docs/api/reference/currency-codes/ ](<https://developer.paypal.com/docs/api/reference/currency-codes/ >)

And the third additional parameter is company\_name - the name of your company, displayed at the very top of the page (example below, company )&#x20;

The paypal\_pay\_url variable can be displayed with a link or placed on the "Pay" button.&#x20;

The link has the form: [https://ww.paypal.com/checkoutnow?token=07N53571YM296381N ](<https://ww.paypal.com/checkoutnow?token=07N53571YM296381N >)

Example implementation.&#x20;

Set payment amount 444  and company name

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

{% hint style="info" %}
**Note:** the payment\_sum variable is set to the last variable, after the optional **payment\_title**, **company\_name**, etc.
{% endhint %}

## How to process the result

{% hint style="info" %}
After successful payment in the bot will come kolbeks, by 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 secret symbols and a homepage with status, for example: EHsWHYOoWV\_success.
{% endhint %}

Also, after successful payment, the paypal\_payment\_completed variable is set to True.

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

{% hint style="danger" %}
The type of comparison should be "Full match"
{% endhint %}

{% hint style="warning" %}
To make a repeat payment, you must reset the payment\_sum, the previously generated link, and after you reset the payment\_sum variable to get a new link. You can specify a previous value.
{% endhint %}

{% hint style="warning" %}
The callbacks arrive with a delay, so after the link to the user’s payment, we recommend sending a message that goes like, "After payment, wait for the message about successful payment completion"
{% endhint %}

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

![](/files/VngF7Ycxp4dpVxEPxPQO)

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

Upon completion of payment, the **paypal\_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/paypal.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.
