Skip to content

Mock Channel: Scenario Rules and Runtime Switches ​

Updated: 11/10/26, 10:51:10 AM

The mock core model is default success, exceptions through overrides. Understand the decision chain priority and you will not hit "I changed a rule but nothing happened".

Decision Priority ​

Each transaction is decided in this order, stopping at the first match (high → low):

  1. Order manual override — single-order operations on the payment confirmation page, order list, or phone payment code;
  2. Merchant-level override — per-subject overrides configured for that merchant in subject profiles;
  3. ISV-level override — per-subject overrides configured for that ISV in subject profiles;
  4. Transaction type default — the fixed defaults in the table below.

Single-order operations always win; subject-level overrides win at "change the result of a whole class of transactions" without clicking order by order. Global bypass (all success / all failure) was removed in 0.3.0: it is orthogonal to the "default success + overrides" model, and leaving it switched on silently fails whole batches.

Default Results per Transaction Type ​

TransactionDefault without overridesHow to create another result
PaymentImmediate successClick "Payment Failed / Keep Pending" on the confirmation page, or configure a payment override in subject profiles
Refund · Alipay / UnionPay / Douyin / aggregateImmediate successConfigure a refund override in subject profiles
Refund · WeChatProcessingManual confirmation in the refund order list, or a refund override in subject profiles
Split paymentBy amount last-digit rule; unmatched stays processingSplit payment rule table
Pre-authorizationFreeze succeedsFail on the pre-authorization page after creating the order, or configure a pre-authorization override in subject profiles

Payment code has no "fail by amount last digit" convention: to fail, use "Fail Immediately" in the phone payment code emulator; pending-family orders are decided manually on the confirmation page.

Split Payment Rules ​

Split payment rules are the only rule table kept site-wide, with a single dimension: the ones digit of the amount. Within the same type, list order wins first match. The two defaults: last digit 1 succeeds, last digit 2 fails, anything else falls back to processing.

Rule changes take effect immediately and do not affect documents already created. Historical rule rows for payment, refund, and pre-authorization in existing databases are cleaned up automatically on startup.

Runtime Switches ​

SwitchDefaultDescription
Automatic callbacksOnEvery final state sends a callback automatically; failures retry by count (backoff 5s / 30s / 60s)
Pending order advanceManualCan be set to "Auto Success", where the scheduler pushes pending orders to success after N seconds
Callback retry countConfigurable 0–10Retry limit for failed automatic callbacks
WeChat openid validationOnEmulated appid/openid validation for JSAPI / mini program payments; turned off skips the whole block, for debugging comparison only

Payment code channel prefix recognition (WeChat 10–15, Alipay 25–30, UnionPay starting with 62) is a constant in code with no configuration entry. To create an "unrecognized channel" scenario, use a code value outside these ranges (for example, starting with 77).

Common Scenario Recipes ​

ScenarioConfiguration
Payment successDefault
Payment failureClick "Payment Failed" on the confirmation page, or configure a payment override in subject profiles
Order stays pending (test timeout / close)Click "Keep Pending" on the confirmation page and leave auto-advance off
Refund succeeds asynchronouslyWeChat refund: defaults to processing → manual confirmation in the refund order list
Refund failureConfigure a refund override in subject profiles
Split payment failureChange the amount last digit to 2 (or add a last-digit rule)
Split payment processingAmount last digit matches neither 1 nor 2
Freeze failureCreate a pre-authorization order in the console, then fail it on the pre-authorization page
Callback lost / re-pushTurn off automatic callbacks and resend, or set retry count to 0 and send manually

Page locations are in Console Tour; document state meanings are in Transactions and Manual Decisions.