English
Mock Channel: Transactions and Manual Decisions
For every transaction, the mock service does only two things: decide the result through the decision chain, then use a switch to decide whether to send a callback. Manual decisions are what separates it from an ordinary fake API — you can keep an order pending, then decide success or failure.
Five Document Types
| Document | Immediate final state | How it advances |
|---|---|---|
| Payment order | Payment code is immediate; QR / H5 / PC / APP / official account / JSAPI / mini program stay pending | Manual decision on the payment confirmation page, or the auto-advance switch |
| Refund order | Alipay / UnionPay / Douyin / aggregate succeed immediately; WeChat defaults to processing | Manual confirmation in the refund order list, or per-subject overrides |
| Split payment | By amount last-digit rule; unmatched stays processing | Split payment rule table under Integration Config (the only rule table) |
| Transfer order | Immediate | Created in the console; result on creation |
| Pre-authorization | Freeze succeeds, then capture / unfreeze | Operations on the pre-authorization page, or per-subject overrides |
Payment
Pending-family orders are stored without a final state, and the returned payBody is the payment confirmation page address. The page has three buttons:
- Confirm Payment Succeeded: push the success final state and trigger the callback; echoes the callback HTTP status and response body;
- Payment Failed: push the failure final state and also trigger the callback;
- Keep Pending: do nothing, leaving the order for you to observe timeouts, order closing, and similar scenarios.
Payment code (BARCODE) goes through the scene engine with an immediate decision and has no confirmation page. To create a payment code failure, use the phone payment code emulator's "Fail Immediately" mode.
Aggregate Payment (One Code, Multiple Wallets)
When the order channel is provider=AGGREGATE (platform method aggregate_pay_qrcode), the order stays pending as QR and the confirmation page shows four wallet buttons: WeChat, Alipay, UnionPay QuickPass, and Douyin. Whichever wallet you click is the wallet that paid, and the order records the actual wallet.
The actual wallet goes back to the main app in two receipts: the provider field of the synchronous receipt, and data.provider in the callback payload (only for aggregate orders with a selected wallet). The main app uses them to backfill the channel of the order and fund voucher from aggregate to the actual wallet.
An aggregate order pushed to success without a wallet is rejected with error code 40404 — a successful aggregate payment must state which wallet paid; failures and pending states do not require it.
Refund
Refund defaults differ by channel: Alipay, UnionPay, Douyin, and aggregate succeed immediately; WeChat defaults to processing, used to exercise the full "initiate → asynchronous callback → document flips" chain.
To change refund results for a subject, configure a refund override in subject profiles; to change one order temporarily, use manual confirmation in the refund order list.
Split Payment
Split payment is a query-only transaction with no landing page and no callback that can flip it, so rules are the only automatic decision mechanism — hence the only rule table kept site-wide. Amount is judged on the ones digit alone; 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. See Scenario Rules and Runtime Switches.
Transfers and Pre-Authorization
Transfers are created and queried in the console only; the gateway exposes no transfer endpoint, so the main app never calls it. Pre-authorization defaults to a successful freeze.
The default pre-authorization result is a successful freeze. The gateway freeze contract carries no channel merchant number, so freeze requests through the gateway always succeed by default and cannot be overridden by subject profiles; to exercise a freeze failure, create the order in the console or operate on the pre-authorization page.
Callback
| Switch | Behavior |
|---|---|
| Automatic callbacks | When on, every payment/refund final state sends a callback automatically; failures retry by count |
| Callback retry count | 0–10; backoff intervals 5s / 30s / 60s |
| WeChat openid validation | Emulated appid/openid validation for JSAPI/mini program payments; turned off skips the whole block |
Every callback is logged: send time, HTTP status, response body. If a callback does not arrive, first check the callback records in the order detail, then check whether the main app backend access address is reachable — see FAQ and Troubleshooting.
Manual resend
When automatic callbacks are off or retries are exhausted, you can resend a single transaction manually from the order list and the pre-authorization page, to verify idempotency and signature validation on the main app.