State Machine: PayIn
State Machine: PayIn (real, API-facing)
Create Order
-> process
# Order created and initialized (often very short-lived)
process
-> waiting_asset_select
# Multiple payment assets are available (or asset must be chosen in H2H)
-> pending
# Single asset resolved automatically (address assigned / verified)
-> system_fail
# Internal error during initialization
waiting_asset_select
-> pending
# Asset selected:
# - Hosted: user selects on payment page (automatic)
# - H2H: merchant calls Select Asset endpoint
-> cancel
# Available in both Hosted and H2H flows.
# User may cancel the payment from the terminal / payment page.
-> expired
# Lifetime timer reached before asset selection/payment
-> system_fail
# Internal error
pending
-> in_mempool
# Transaction detected in mempool (primarily BTC; may be skipped on other networks)
-> confirm_check
# Transaction detected on-chain (can come directly, skipping mempool)
-> cancel
# Available in both Hosted and H2H flows.
# The user may cancel the payment from the terminal / payment page
-> expired
# Lifetime timer reached without valid payment
-> system_fail
# Internal error
in_mempool
-> confirm_check
# Mempool -> block inclusion / on-chain visibility
# mempool event is stored, but no finalization happens here
-> system_fail
# Transaction dropped from mempool
# OR replaced (RBF)
# OR disappeared due to mempool eviction
confirm_check
-> paid
# actual within ±accuracy_payment_percent of expected
-> paid_over
# actual above allowed tolerance
-> paid_less
# actual below allowed tolerance
-> system_fail
# Reorg / chain error / internal failure
Last updated