QA/QC: Miniapp IRT deposit & bot notifications
IRT deposit flow (miniapp)
- User deposits IRT via PayStar: card (16-digit) or POL/IBAN (transfer to company IBAN).
- Payment service: statement sync →
payment_traceswith:- Card method: full 16-digit card from statement → store SHA-256 hash (
card_hash_partial) +card_last4. - POL/IBAN method: source IBAN from statement (ExtraInfo or SourceAccount) → store
source_iban.
- Card method: full 16-digit card from statement → store SHA-256 hash (
- Deposit worker matches in order: 1) source_iban (FindUserByVerifiedIBAN), 2) full card hash (FindVerifiedCardByCardHash), 3) card last4 (FindVerifiedCardByLast4). Then credits balance and sets
payment_traces.user_id= telegram_id. - Miniapp: Gateway
GET /api/v1/transactions→getFiatDeposits(telegram_id)→ IRT deposits listed. Balance from ledger.
Status: Both card and IBAN/POL methods are supported. Matching uses whole card (hash) or IBAN when available; last4 is fallback only.
Bot notifications
Crypto deposits (ETH, BSC, TON, TRON, BTC, USDT)
- Watcher (per chain) confirms deposit → writes ledger → publishes to wallet.events with routing key
wallet.deposit.<CHAIN>(e.g.wallet.deposit.ETH). - Telegrambot binds queues
wallet.deposits.<CHAIN>towallet.eventswith that routing key and consumes; sends “Deposit Confirmed!” to user. - Status: Working (BSC queue fix applied; all chains bound).
IRT (fiat) deposits
- Before fix: Payment service published only to payment.events (
deposit.deposit.credited). Telegrambot does not consume that; it only consumes wallet.events. - After fix: Payment service also publishes to wallet.events with routing key
wallet.deposit.IRT(same payload shape: telegram_id, amount, token, hash/reference). Telegrambot’s existingwallet.deposits.IRTconsumer receives it and sends “Deposit Confirmed!” (with “Reference” instead of “Transaction” for IRT).
Withdrawal notifications
- Withdrawal service calls
telegramNotifier.SendWithdrawalNotification(HTTP to telegrambot or internal API) for pending/processing/confirmed. Not RabbitMQ. - Status: Working if telegrambot is reachable and notifier configured.
Other bot messaging
- Verification approved/rejected: admin publishes to admin.events; bot consumes admin.verifications.
- Voucher results: voucher.results queue.
- Payment callbacks: payment.callbacks (callback.*).
Paystar deposit verification (after payment deploy)
- Make a test IRT deposit via Paystar (card or POL/IBAN to company account).
- In Paystar: Confirm the transaction appears in the company statement (correct amount, date, and if POL/IBAN the source IBAN or card last4).
- Payment logs (e.g.
docker service logs gitinext-golang_payment --tail 200or Portainer):- Statement sync: lines like
fetched batch,processed trace(or similar from statement_sync). - Deposit worker: match method used — e.g.
matched by_iban,matched by_card_hash, ormatched by_last4; thencredited/payment_traces.user_idset. - No errors for that trace (e.g. no “skip: no identifier” when you expect a match).
- Statement sync: lines like
- Miniapp: User balance and transaction list show the IRT deposit.
- Telegram: User receives “Deposit Confirmed!” with amount and “Reference” (for IRT).
Checklist for production
- [ ] Confirm
payment_traces.user_idis telegram_id (BIGINT) after match (account card_verifications.user_id or mapping). - [ ] RABBITMQ_URL set in payment and telegrambot so IRT deposit notification is published and consumed.
- [ ] Deploy payment + telegrambot after IRT notification fix; test one IRT deposit and check Telegram message.
- [ ] Miniapp: test deposit IRT → balance and transaction list update; test withdrawal IRT → notification.
- [ ] After payment update: run one Paystar deposit; confirm in Paystar, payment logs (match + credit), miniapp, and bot.