Skip to content

Top-up Settings ​

Admin → Top-up Settings. Visible only to Root.

Configurable fields ​

FieldMeaningEffect
enabledMaster switchOff hides the public top-up entry
allow_customAllow custom amountOff forces users to pick a preset
exchange_rate¥1 = X quotaDrives custom-amount conversion; must be > 0
presetsPreset amountsEach entry is {amount, bonus_quota}

Enable + allow custom + a few presets:

amountbonus_quota
10100000
50500000
1001000000
5005000000

exchange_rate = 100000 (¥1 = 100k quota, matches default QuotaPerUnit=500000).

How to change ​

Admin → Top-up Settings → edit fields → Save.

Validation:

  • Each preset amount > 0, bonus_quota >= 0
  • No duplicate amounts
  • exchange_rate > 0

User-facing impact ​

FieldWhat users see
enabled = falseTop-up entry gone
allow_custom = falseOnly preset chips visible; input field hidden
presetsNumber and order of chips
exchange_rateCustom-amount quota credit

How to test ​

  1. After enabling, log in as a test account and visit the top-up page
  2. Click a preset → credited quota = bonus_quota
  3. Enter a custom amount → credited quota = amount × exchange_rate

Notes ​

  • Exchange rate changes only affect new orders; existing orders keep their snapshotted rate
  • Preset changes only affect new orders
  • Preset amounts must be unique (constraint)

FAQ ​

  • All settings saved but user still can't see top-up: verify enabled=true and at least one payment channel enabled
  • Changed exchange rate but no effect: takes effect for new orders only
  • Can preset amounts be decimals?: yes — amount supports two decimals (e.g. 9.99 ¥)
  • GET /api/setting/topup — read settings (Root)
  • PUT /api/setting/topup — update settings (Root, full replacement)