Telegram payments

With the help of the Telegram payments component, you can connect any payment system available in Telegram to the bot.

We will show the payments setup using the example of Stripe.

Setup in test mode

1. Add Telegram payments component to the desired screen.

2. Go to Telegram bot @Botfather and give the command /mybots. After that, go to the desired bot, select Payments.

3. Select Stripe payment system by clicking on the corresponding button.

4. To set up payments in test mode, select Stripe, then Connect Stripe Test.

5. In the opened dialogue with the bot to connect Stripe, click Start, then go to the registration site by clicking Authorize.

6. For the test mode, it is not necessary to fill in the registration data, so click on Skip this form button.

7. After that, Stripe test token will come to BotFather.

8. Copy and paste the token into the Telegram provider token settings field in the builder.

9. Fill in all the empty components fields:

  • Specify the good title.
  • Specify the good description.
  • Specify the payment assignment.
  • Select a currency.
  • Specify the price.
  • Select the screen to which the user will be transferred after a successful payment.
  • Specify the name of the variable in which the user's data will be written.
  • You can upload an image of the goods or specify a link to the image. The image can be in jpg or png format. The component will be loaded and will come to the user regardless of the presence of the image.

10. Save the bot. The first product has been added. Try to make several test payments.

To get a real token, go to @Botfather and after /mybots command, select your bot. In Payments tab, select the Connect Stripe Live. After that, follow the prompts to get the token. Copy and paste it into Payments in Telegram component.

Payment with Telegram Stars

In addition to the usual currencies, you can use the Telegram internal currency. It is called Telegram Stars. You can pay for goods and services in the bot with it.

Buy Telegram Stars

You can buy Telegram Stars for the first time by making a purchase in the official Durger King Telegram bot.

Go to the bot, select Order Food in the lower left corner, then select the pie that costs one star. After that, select the desired number of stars and pay for them following the prompts in the bot. Telegram will refund you the cost of the pie, and the number of stars that you originally paid for will remain on your balance.

iOS users with cards of those countries that are accepted for payment in App Store can buy stars through internal App Store payments.

After purchasing the stars, a new section Your stars will appear in the Telegram Settings section. This section will display the number of stars remaining on your balance, the history of transactions and the opportunity to buy new stars.

Set up the payment component for Telegram Stars

1. Go to the bot editor and add the Payments in Telegram component.

2. Fill in all fields of the component, as in the usual setup, but with some differences:

  • when adding a component, the Telegram Stars currency is selected by default, which means that the Currency field should be left unchanged,
  • a payment token is not required for Telegram Stars,
  • for Telegram Stars the minimum payment amount is one unit. When you work with other currencies, at least 60 units should be set in the Price field for the component to work.

The payment history is displayed in Telegram payments section.

Done.

After the user makes a purchase in the bot with Telegram Stars, a new Balance section will appear in the settings of this bot in Telegram. You can see this section only in the beta version of Telegram.

To view the balance in the Telegram beta version, go to the bot, click on the bot name, then click on the pencil and select the Balance section. After that, you will see the history of the bot operations and its Telegram Stars balance.

To the beginning ↑