Payment button

A button with the Payment function simplifies working with connected payment systems by providing a payment link.

картинка

Please note that in many messengers, links can only be placed in inline buttons within the text. Don’t forget to select the appropriate button type in the block settings after creating the button.

The Payment function button is available for the following payment systems:

  • Stripe

Within a single block, you can create "Payment" buttons for different payment systems with different payment amounts.

If no payment systems are connected to the project, this type of button will not be available.

картинка

Main fields of the Payment button:

  • Text field: This text will appear on the button with the payment link in the message.

  • Function: Select the button type Payment.

  • Function field: To create a button that provides a payment link, choose the Payment function.

  • Payment system field: The list shows the payment systems connected to the project.

Depending on the chosen payment system, the required fields for generating the link and creating the receipt will vary.

You can view the settings for the Payment function button for different payment systems here:

The required fields for generating the payment link are Amount and Product name/Product description.

  • Amount field: Enter the payment amount here.

  • Product name field: Enter the name of the product that will be displayed on the payment page.

Double quotes cannot be used in the product name.

You can replace them with apostrophes or single quotes.

Depending on the chosen payment system, dropdown menus labeled "Receipt data" and/or "Additional information" will appear in the button settings. Clicking on them will reveal additional fields:

картинка

Variables when using the Payment function button

As soon as the user receives the block with the "Payment" button, the following client variables are automatically created:

  • System client variable __payments – this variable stores the payment amount and the identifier of the generated payment link. It is used to identify the webhook response from the payment system.

The system client variable __payments must not be deleted or modified!

The client variable error_payment_button is created if an error occurs while generating the payment button.

Its value will contain either the error message or the error response returned by the payment system.

The values of the variables become active (up-to-date) when the user moves to the next block.

How to handle the result

Successful payment

After a successful payment, the bot will receive a callback consisting of the first 10 characters of the payment system's secret key, the word _success, and the payment amount separated by a space. For example: ovg58keefc_success 44, where:

  • ovg58keefc: the first 10 characters of the payment system's secret key

  • _success: indicates the result of the request (successful payment)

  • 44: the payment amount

Callbacks (notifications) from the payment system are not visible to the user. They are displayed only in the Clients tab and are visible to the operator.

Example of use: Step 1. In the block with the Payment button, add buttons with the Payment function. Step 2. In the Connection condition field from this block to the Successful payment block, specify the callback. This works the same way if you specify the successful payment callback in the Condition field of the Primary condition check block.

Note! Selection of match type — Exact match or Keyword match.

Useful tip

To send a notification about a successful payment to the client without interrupting their progress through the main funnel, create "Non-state blocks with conditions."

Payment with an error

If a payment error occurs, the bot will receive a callback consisting of the first 10 characters of the payment system’s secret key, the word _fail, and the payment amount separated by a space. For example: ovg58keefc_fail 44, where:

  • ovg58keefc: the first 10 characters of the payment system’s secret key

  • _fail: the result of the request processing — payment failed or encountered an error

  • 44: the payment amount

It depends on the payment system. Not all payment systems send a callback for payment errors.

If the amount specified in the button settings differs from the amount actually paid by the client, the bot will receive a callback consisting of the first 10 characters of the payment system’s secret key, the phrase _different_amounts, and a unique payment ID separated by a space. For example: ovg58keefc_different_amounts 123456, where:

  • ovg58keefc: the first 10 characters of the payment system’s secret key

  • _different_amounts: the result of the request processing (payment amount differs from the amount in the link)

  • 123456: unique payment ID

Last updated