Skip to content

Mock Channel: Setup ​

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

The mock side ships with built-in profiles and default rules; what you need to do is on the main app side. Configure in the order below and you can place orders.

Prerequisites ​

ItemRequirement
Main appStarted in dev mode (daxpay.platform.deployment.mode=DEV); PROD does not wire the mock module
Channel sub-appdax-pay-channel-one is running (20100)
Mock serviceRunning, default 10400; curl http://127.0.0.1:10400/health responds
DatabaseDemo data set (data-demo.sql) — the mock channel master data and demo merchant are in it; the clean data set data.sql has no mock channel, so switch data sets or add the master data rows yourself

Start the mock service:

bash
# Repository root, dev profile, port 10400
mvnd spring-boot:run

Run the console dev server separately (10500, /mock prefix proxied to 10400) only when changing the frontend; daily integration uses the static assets bundled in the backend. After changing console pages you must run cd ui && pnpm build again, otherwise the changes exist only in the dev server.

Step 1: Create a Mock Channel Merchant ​

On the Admin Panel "Channel Merchants" page, create a merchant: pick the "Mock Pay" product, set the channel merchant number to the built-in seed MOCKM99999 (or any number of your own), and leave all credential fields empty — mock onboarding requires no credentials, keys, or certificates.

Step 2: Include the Mock Channel in Routing ​

On the Admin Panel "Channel Routing" page, configure a strategy for the app and include the channel merchant from the previous step as a candidate:

  • Basic mode (by channel): bind the channel merchant under any of the WeChat / Alipay / UnionPay / Douyin channels. The mock product strategy declares coverage of all platform payment methods, so orders from any method of the four channels can route here;
  • Scene mode (by payment method): pick the channel merchant and capability on the matching payment method row. Candidate validation on save depends on capability master data; without the row, that method never appears as a candidate.

Step 3: Configure the Callback Address ​

The backend access address under Admin Panel "Platform Configuration → Endpoint Configuration" must be a main app address reachable from the mock service. Mock builds callback URLs from it; for local integration that is http://127.0.0.1:9999. If it is missing or unreachable, payments succeed but callbacks never come back.

Step 4: Confirm the Gateway Address and Keys ​

  • The base address from the channel sub-app to the mock service defaults to http://127.0.0.1:10400, configured by mock.gateway.base-url; change it when mock is not on the same machine;
  • Gateway signature validation uses only one global key pair; the default local chain needs no extra exchange. ISV mode requires pasting both the merchant private key and the platform public key from the console "System → Integration Materials" page into Admin Panel "Mock ISV".

Step 5: Verify the First Order ​

  1. Place an order from an app already bound to the mock route (any QR-based payment method);
  2. Open the payment confirmation page from the returned payBody;
  3. Click "Confirm Payment Succeeded"; the page echoes the callback delivery status;
  4. Back in the main app order list, the order should be successful and the fund voucher channel should be mock.

Once the first order works, the whole chain main app → channel sub-app → mock → callback is complete. To create failures, timeouts, or missing callbacks, see Scenario Rules and Runtime Switches and Transactions and Manual Decisions.

Failure Symptoms ​

SymptomCause
Order fails with "product strategy does not exist"The main app runs in PROD mode and the mock orchestration module is not wired at all
Order fails with "mock channel merchant not registered" (10013)Mock-side profile missing: the SQLite database was rebuilt without seed data, or the channel merchant number differs from the mock side
Mock channel missing from routing candidatesCapability master data missing (clean data set), or the routing strategy was not saved successfully
Confirmation page does not open / phone scan returns 404The confirmation page address is generated from the mock service; the phone and mock are not on the same network
Payment succeeds but the order does not moveCallback address missing or unreachable; check the callback records in the order detail
Rules do not take effectThe decision chain priority is overridden by a higher layer; see Scenario Rules and Runtime Switches