feat(payments): Telegram Stars payment rail #226

Merged
developer merged 4 commits from feature/payment-intake-tg-stars into development 2026-07-09 20:44:06 +00:00
Owner

Third money-intake rail: Telegram Stars (XTR), alongside Robokassa (direct) and VK Votes. Merges into development; PR into master stays test-only.

Only the bot reaches Telegram, so the rail funnels through the reverse mTLS bot-link:

  • gateway mints the invoice on a CreateInvoice command (bot createInvoiceLink, XTR; link → WebApp.openInvoice);
  • bot gates each pre_checkout_query via a new ValidatePreCheckout unary — order exists, still creditable, not already paid (reusable-link double-pay guard); decline reason localised to the account language;
  • completed successful_payment → durable pure-Go SQLite outboxForwardPayment unary → same Fund (source=telegram, idempotent on telegram_payment_charge_id, honours an expired order); re-driven on restart + every 30 s.

Wired by TELEGRAM_STARS_OUTBOX_DIR (default /data) but inert until a chip pack carries an XTR price — seeding a Stars price in the admin is the go-live.

Tests: backend integration (order→forward→credit once, duplicate, pre_checkout gate: pending/already_paid/gone/price_changed), bot outbox unit (idempotent + restart re-drive), executor createInvoice. Local: all Go modules build+vet+test, UI check+unit, full payments integration suite, gofmt.

Post-merge (owner): seed two contour Stars packs — 50 chips = 40★, 100 chips = 80★ (SQL to follow) — then the live contour Stars test. Schema-free (no migration, no contour wipe).

Third money-intake rail: **Telegram Stars (XTR)**, alongside Robokassa (direct) and VK Votes. Merges into `development`; PR into master stays test-only. Only the bot reaches Telegram, so the rail funnels through the reverse mTLS bot-link: - gateway mints the invoice on a `CreateInvoice` command (bot `createInvoiceLink`, XTR; link → `WebApp.openInvoice`); - bot gates each `pre_checkout_query` via a new `ValidatePreCheckout` unary — order exists, still creditable, **not already paid** (reusable-link double-pay guard); decline reason localised to the account language; - completed `successful_payment` → durable pure-Go **SQLite outbox** → `ForwardPayment` unary → same `Fund` (source=telegram, idempotent on `telegram_payment_charge_id`, honours an expired order); re-driven on restart + every 30 s. Wired by `TELEGRAM_STARS_OUTBOX_DIR` (default `/data`) but **inert until a chip pack carries an XTR price** — seeding a Stars price in the admin is the go-live. **Tests:** backend integration (order→forward→credit once, duplicate, pre_checkout gate: pending/already_paid/gone/price_changed), bot outbox unit (idempotent + restart re-drive), executor createInvoice. Local: all Go modules build+vet+test, UI check+unit, full payments integration suite, gofmt. **Post-merge (owner):** seed two contour Stars packs — 50 chips = 40★, 100 chips = 80★ (SQL to follow) — then the live contour Stars test. Schema-free (no migration, no contour wipe).
developer added 1 commit 2026-07-09 19:35:55 +00:00
feat(payments): Telegram Stars payment rail
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 22s
CI / integration (pull_request) Successful in 20s
CI / ui (pull_request) Successful in 1m10s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m57s
6e03ce0131
Accept real money via Telegram Stars (XTR) — the third intake rail
alongside Robokassa (direct) and VK Votes.

Only the bot reaches Telegram, so the rail funnels through the reverse
mTLS bot-link:
- the gateway mints the invoice on a CreateInvoice command (the bot
  calls createInvoiceLink, XTR; the link goes to WebApp.openInvoice);
- the bot gates each pre_checkout_query via a ValidatePreCheckout unary
  (the order must exist, be still creditable and not already paid — the
  reusable-invoice double-pay guard; the decline reason is localised to
  the order account's language);
- a completed successful_payment is queued in a durable pure-Go SQLite
  outbox and forwarded via a ForwardPayment unary, credited once
  (idempotent on telegram_payment_charge_id, honours an expired order),
  re-driven on restart and every 30s.

The rail is wired by TELEGRAM_STARS_OUTBOX_DIR (default /data) but stays
inert until a chip pack carries an XTR price, so seeding a Stars price in
the admin is the go-live.

Tests: backend integration (order->forward->credit once, duplicate,
pre_checkout gate) + bot outbox unit (idempotent, restart re-drive) +
executor createInvoice. Docs: PAYMENTS(+ru) §9, ARCHITECTURE, the
platform/telegram README, PLAN.
developer added 1 commit 2026-07-09 19:55:55 +00:00
chore(deploy): re-roll the test contour to pick up the TEST_AWG_CONF DNS fix
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 10s
CI / integration (pull_request) Successful in 19s
CI / ui (pull_request) Successful in 1m9s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m55s
219fc7c827
The contour VPN sidecar's netns resolv.conf was pinned to 1.1.1.1 by a DNS=
directive in TEST_AWG_CONF, so internal names (gateway, otelcol) did not resolve
and the bot-link had been down since ~2026-06-29. The directive is removed; this
empty commit re-rolls the contour so the vpn recreates with Docker's 127.0.0.11
resolver and the bot-link (and the Stars rail over it) comes up.
developer added 1 commit 2026-07-09 20:26:30 +00:00
fix(ui): scope the wallet buy-button busy dim to the tapped button
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 19s
CI / ui (pull_request) Failing after 11s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Failing after 0s
CI / deploy (pull_request) Has been skipped
55dbb1005e
Tapping one pack's Buy dimmed every buy button at once (the shared busy
flag drove disabled + the :disabled opacity on all of them), so it looked
like both packs reacted to one tap. Track the in-flight product id
(busyId): the concurrency guard stays global, but the pressed/dimmed look
is now scoped to the tapped button. Payments were never affected.
developer added 1 commit 2026-07-09 20:37:32 +00:00
chore(ui): raise the app bundle budget 123->125 for the payment intake rails
CI / changes (pull_request) Successful in 2s
CI / unit (pull_request) Successful in 11s
CI / integration (pull_request) Successful in 24s
CI / ui (pull_request) Successful in 1m9s
CI / conformance (pull_request) Successful in 11s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m50s
e10f3beed5
The wallet order flow plus the Telegram Stars openInvoice / VK order-box launch
and the per-button in-flight state ride the always-loaded Wallet screen, which
crossed the 123 KB gzip ceiling. Bump to 125 (matching the established
feature-driven budget history in the comment) with ~2 KB of headroom.
owner approved these changes 2026-07-09 20:43:28 +00:00
developer merged commit ee9924c313 into development 2026-07-09 20:44:06 +00:00
developer deleted branch feature/payment-intake-tg-stars 2026-07-09 20:44:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: developer/scrabble-game#226