Soroban Payment Router Status
This document records the current Soroban payment router implementation and the work that remains before it can be treated as production-ready.Implemented Components
Database Foundation
The database schema includes the following Soroban-related records:- Payment fields:
payment_flow,blockchain_status,soroban_contract_id,platform_fee_amount,merchant_settlement_amount, andpayment_authorization_hash. soroban_contract_deploymentsfor deployed contract metadata.stellar_transactionsfor normalized on-chain transaction records.soroban_eventsfor contract event records.stellar_sync_cursorsfor durable event-ingestion cursors.
0027_repair_payment_quote_columns.sql. It restores quoted_settlement_amount and settlement_quote_rate for databases whose earlier migration history skipped those columns.
Smart Contract
The unifiedPayoes contract is located at contracts/src.
The contract:
- Supports legacy direct
paywith payer and authorization-signer authorization. - Supports escrow
register_payment, walletdeposit, and workerrecord_settlement/record_refund. - Rejects expired payments, invalid fee amounts, paused execution, and duplicate payment IDs.
- Transfers the merchant settlement amount and the platform fee atomically on direct pay.
- Persists payment records and emits settlement/refund events.
Testnet Deployment
The current Testnet contract ID is:Checkout Flow
New payments usepayment_flow = escrow and a single Soroban contract path:
direct and soroban (pay()) checkout flows are deprecated for new payments.
The browser never receives the Payoes authorization signer secret.
Required Environment Variables
STELLAR_*_OPERATOR_SECRET.
The operator secret must only be available to the server runtime or a secrets manager. It must not be committed, exposed to browser code, or stored in application tables.
Current Limitations
- Soroban confirmation currently relies on the RPC transaction status. It does not yet persist or validate the
PaymentSettledevent. - The event ingestion worker has not been implemented.
stellar_transactionsandsoroban_eventsare not populated by the current checkout confirmation flow.blockchain_status,soroban_contract_id, andmerchant_settlement_amountare not updated after successful checkout confirmation.- Platform fee configuration has no dashboard or public API control yet. New payments default to a zero platform fee.
- Soroban checkout requires a configured escrow contract for all new payments.
- Cross-asset deposits are held on the contract and settled by the operator worker.
- Mainnet deployment, contract audit, key management policy, monitoring, and alerting remain required.
Next Implementation Steps
- Implement a Soroban event ingestion service that reads
PaymentSettledevents with a durable RPC cursor. - Persist verified transactions to
stellar_transactionsand events tosoroban_eventsidempotently. - Match the event payment hash to a pending Payoes payment and validate payer, merchant, asset, gross amount, and fee.
- Update payment blockchain fields and deliver webhooks only after event verification.
- Add a protected cron endpoint and reconciliation job for event ingestion.
- Add platform-fee configuration and checkout fee presentation.
- Add dashboard transaction details, unmatched-event review, and contract deployment visibility.
- Complete Testnet end-to-end coverage before any Mainnet deployment.