Developing Mobile Applications for Crypto Payment Gateways
A crypto payment gateway is infrastructure between merchant and blockchain. Merchant integrates gateway via API; customer pays in crypto; gateway confirms and signals payment to merchant. A gateway's mobile app typically comprises two separate products: merchant dashboard (management, analytics, withdrawals) and checkout SDK for customers (checkout flow).
Merchant Dashboard: Key Screens
Mobile app for merchants — simplified dashboard with key metrics:
- Incoming payments in real time
- Balance in crypto and USD equivalent (via CoinGecko or custom price feed)
- Transaction history with filters (status, currency, amount, date)
- Settings: accepted coins, auto-withdrawal addresses, webhooks
- Withdrawal
Merchant data — not from blockchain directly but from gateway database via REST API. Backend monitors blockchain.
Monitoring Incoming Transactions
Gateway backend listens to blockchain and updates payment statuses. Mobile app receives updates via WebSocket or Server-Sent Events.
// Android — SSE stream of merchant payments
fun observeMerchantPayments(merchantId: String): Flow<PaymentEvent> = callbackFlow {
val client = OkHttpClient()
val request = Request.Builder()
.url("$baseUrl/merchants/$merchantId/events")
.addHeader("Authorization", "Bearer $token")
.build()
val sse = client.newCall(request).execute()
val reader = sse.body!!.source()
while (!reader.exhausted()) {
val line = reader.readUtf8Line() ?: break
if (line.startsWith("data: ")) {
val event = json.decodeFromString<PaymentEvent>(line.removePrefix("data: "))
trySend(event)
}
}
awaitClose { sse.cancel() }
}
On PAYMENT_CONFIRMED event — push notification to merchant: "Payment received: 150 USDT from 0x...".
Checkout SDK: Customer Flow
For customers (if gateway provides SDK) — mobile checkout is:
- Show screen with fiat amount and crypto equivalent (live quote)
- Select crypto from supported
- QR code with payment address and amount (URI format for specific network)
- Timer: rate locked for N minutes
- Await transaction confirmation
- Success / error / timeout screen
// iOS — generating payment URI for checkout
func buildPaymentUri(network: PaymentNetwork, address: String, amount: Decimal, tokenContract: String?) -> String {
switch network {
case .ethereum:
if let contract = tokenContract {
// ERC-20 (USDC/USDT)
let rawAmount = (amount * pow(10, 6)).description // USDC 6 decimals
return "ethereum:\(contract)@1/transfer?address=\(address)&uint256=\(rawAmount)"
}
return "ethereum:\(address)?value=\((amount * 1e18).description)"
case .bitcoin:
return "bitcoin:\(address)?amount=\(amount)"
case .tron:
return "tron:\(address)?amount=\(amount)&token=\(tokenContract ?? "")"
}
}
Underpayment and Overpayment
User may send less or more than required. Strategies:
Underpayment: await additional payment within period (usually 24 hours), else refund or partial credit.
Overpayment: auto-refund difference or credit to user's account in merchant system.
Logic on server side, but mobile UI must correctly display all statuses.
Multi-network Support
Professional gateway accepts USDT on Ethereum, USDT on TRON, USDC on Polygon, BTC, SOL. Each network has its nuances:
| Network | Confirmation | Fee | Standard |
|---|---|---|---|
| Ethereum | 15–30 sec (1 block) | $0.5–5 | ERC-20 |
| Tron | 3 sec | $0–1 | TRC-20 |
| Polygon | 2 sec | $0.001–0.01 | ERC-20 |
| BSC | 3 sec | $0.1–0.5 | BEP-20 |
| Bitcoin | 10–60 min | $1–10 | Native |
Merchant selects supported networks in settings. Customer sees optimal (speed/fee) or all available.
Automatic Sweep
Incoming funds must consolidate from deposit addresses to hot wallet. Sweep agent runs periodically or on trigger. In merchant's mobile app — status only: "Auto-sweep configured, funds transfer to master wallet in X minutes".
Development Timeline
| Component | Timeline |
|---|---|
| Merchant dashboard: balance, history | 1 week |
| Real-time payment stream (SSE/WS) | 1 week |
| Checkout SDK: QR + timer + statuses | 1 week |
| 3+ network support | 1 week |
| Settings: coins, webhooks, withdrawal | 1 week |
| Push notifications | 3 days |
Gateway mobile app (without backend): 5–8 weeks. Gateway server infrastructure — separate project, 2–3 months and up.







