QA/QC: Miniapp IRT deposit & bot notifications

IRT deposit flow (miniapp)

  1. User deposits IRT via PayStar: card (16-digit) or POL/IBAN (transfer to company IBAN).
  2. Payment service: statement sync → payment_traces with:
    • 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.
  3. 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.
  4. Miniapp: Gateway GET /api/v1/transactionsgetFiatDeposits(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> to wallet.events with 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 existing wallet.deposits.IRT consumer 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)

  1. Make a test IRT deposit via Paystar (card or POL/IBAN to company account).
  2. In Paystar: Confirm the transaction appears in the company statement (correct amount, date, and if POL/IBAN the source IBAN or card last4).
  3. Payment logs (e.g. docker service logs gitinext-golang_payment --tail 200 or 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, or matched by_last4; then credited / payment_traces.user_id set.
    • No errors for that trace (e.g. no “skip: no identifier” when you expect a match).
  4. Miniapp: User balance and transaction list show the IRT deposit.
  5. Telegram: User receives “Deposit Confirmed!” with amount and “Reference” (for IRT).

Checklist for production

  • [ ] Confirm payment_traces.user_id is 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.

© 2025 GitiNext - Enterprise Crypto Infrastructure | GitHub | Website