...Connect Telegram-pay

A step-by-step tutorial on how to create a pinned message with a “Pay” button

How to create a pinned pay button as shown below:

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

It’s done in just two steps:

1st step:

Above all else, we need to connect to a payment system For detailed instructions on how to do it, read this article

2nd step:

Pin this message. A description on the functionality of pinning messages you’ll find in this article

An example:

1st step:

prices = [["product", 200], ["tax", 40], ["packaging", 10]] result = tg_send_invoice('632593626:TEST:sandbox_i38014109764', platform_id, 'Phone U-200', 'The best of the best', 'UAH', prices, 'shorturl.at/cwyA3', 'phone_best', 0, 0, 1, 1, 1)

2nd step:

As a result of completing the first step you’ll get an answer from which you’ll need to get the value of message_id with the help of the get() function: res=get(result,'result') m_id=get(res,'message_id')

Then we pin the message: tg_pin_chat_message(#{platform_id}, #{m_id}, 1)

!!!!!!!!!!!!!!!!!!!!

Last updated