Danil Sidorov
RU EN DE
Telegram

TON payments through a Telegram bot

The bot issues an invoice with a Tonkeeper link and confirms the payment by itself once the transfer lands on-chain

Чат-боты / Платежи

Live interactive demo stand

An exact copy of the project interface and business logic with demo data. All actions run in real time.

Оплата засчитывается сама, без приватных ключей на сервере

StackPython, чат-бот, asyncio, PostgreSQL, asyncpg, API наблюдателя

Safe perimeter (NDA): production logic on test data

What to test in the stand:
  1. Сформируйте счёт на оплату с уникальным ID в симуляторе бота
  2. Перейдите во вкладку кошелька и проведите тестовый платёж в 1 клик
  3. Посмотрите, как фоновый наблюдатель сопоставляет перевод и закрывает инвойс
https://messenger.demo.example/ton-pay
Live Stand
🕒
💎
TON Payment Gatewayбот

Turnkey implementation

Need a similar system for your business processes?

I will develop the architecture, fault-tolerant backend, and fast interface. Protected by NDA, clean transferable code, and transparent milestones.

  1. Free timeline and budget estimate within one day
  2. Contract and invoice
  3. Warranty and post-launch support

On weekdays usually within a couple of hours

I will reply personally, no aggressive sales pitch

Task

TON payments had to be accepted right in Telegram without checking transfers by hand. The wallet keys must not live on the server, and every payment has to find its own invoice without doubt.

Solution

A python-telegram-bot bot runs the dialog and writes invoices to PostgreSQL. A background job in the same process reads transfers through toncenter every 20 seconds, continues from the last processed transaction and matches a transfer to an invoice by its comment. All database queries are parameterised.

What was done

  • Built invoices for any amount with a unique comment from the bot menu
  • Gave a Tonkeeper button with the address, amount and comment filled in
  • Built a watcher that reads the merchant wallet and matches transfers to invoices
  • Settle a payment only when the comment matches and the amount covers the invoice
  • Expire unpaid invoices on time and tell the buyer
  • Store amounts as whole nanotons, with no floating point
  • Needed no private keys: the service only uses the public address

Result

The buyer pays in a couple of taps and gets a confirmation in the chat right away, and the merchant no longer checks transfers. The code is open on GitHub, and the bot can be tried on the TON testnet first.

Technologies

Pythonpython-telegram-botasyncioPostgreSQLasyncpgtoncenter API

Sources

The links confirm the numbers in this case

Tell me about your task

Telegram