Telegram Pay
General information
If you have a Telegram Bot, you can easily start accepting payments using the Bot Payments API.
You can familiarize yourself with the features of this payment method on the website.
Integration
Test mode:
The easiest way to add a payment option to your Telegram bot is by using the Tranzzo test bot. You can do this yourself without contacting our team. Follow these steps:
- Proceed to @BotFather.
- Enter the
/mybots
command. - Select the bot you want to accept payments through.
- Go to "Payments" > "Tranzzo" and select the "Connect Tranzzo Test" option.
- Click the "Connect TRANZZO" button.
- You are all set.
After completing the previous steps, the "Tranzzo Test" should be displayed as a connected payment method within the @BotFather. To enable full functionality, make sure to implement the following Telegram API methods:
[sendInvoice](https://core.telegram.org/bots/api#sendinvoice)
[answerPreCheckoutQuery](https://core.telegram.org/bots/api#answerprecheckoutquery)
[SuccessfulPayment](https://core.telegram.org/bots/api#successfulpayment)
It is essential that your bot implements the answerPreCheckoutQuery
method, as without it, payments cannot be accepted.
Most libraries offer built-in integrations for easier implementation:
Language | Library |
---|---|
PHP | php-telegram-bot |
Python | python-telegram-bot |
.NET | Telegram.Bot |
Java | TelegramBots |
Scala | bot4s |
Golang | telegram-bot-api |
Production mode:
If you have successfully tested payment with Tranzzo Test provider than you are ready to switch to production. To do this, you need to:
- Ensure that you are registered registered on the merchant portal.
- Notify Tranzzo Support that you intend to enable Telegram Pay.
If you would like to use custom description, you can set it in provider_data
parameter in the sendInvoice
method.