Code RouterCode Router
User GuideAPI ReferenceAI ApplicationsHelp & SupportBusiness Cooperation

Payment Settings

Configure top-up methods, amount options, and payment gateways for Code Router.

Payment capabilities are intended for internal settlement, corporate customer accounts, or compliant service charges in legally authorized scenarios. The deployer is responsible for ensuring that all services, charges, upstream authorizations, and operating practices comply with local laws and regulations, upstream terms of service, platform rules, and payment risk-control requirements.

Code Router is a demo deployment. No payment provider has been finalized and no real prices or amounts are configured. Every concrete value below is a placeholder marked (TBD / 待补) — replace it with your own settings before going live.

This page is where you configure the top-up (recharge) function in the Code Router console: which payment methods appear to users, what top-up amounts they can pick, and how any discounts are applied.

Screenshot placeholder: console "Payment Settings" panel. (UI capture TBD)

Supported Payment Gateways

Code Router exposes a generic, gateway-agnostic top-up flow. The specific gateways you enable depend entirely on your own integration and compliance situation — no gateway is bundled or guaranteed as available in this demo (payment provider TBD / 待补).

A typical OpenAI-compatible relay supports two broad gateway shapes:

  • Aggregated collection gateway — required fields usually include an API Address, a Merchant ID, and a Merchant Key. The gateway posts a signed callback that the system verifies before crediting the order automatically.
  • Card/checkout gateway — required fields usually include an API Key, a Webhook Signing Secret, and a product/price identifier.

The exact field names and credentials are determined by whichever provider you choose to integrate. (Provider-specific configuration TBD / 待补)

A payment gateway is not itself a licensed payment institution. Fund clearing, settlement, and compliance depend on the licensed channels behind it. Confirm your obligations with local regulators before collecting any funds.

Top-up Method Settings Template

Under Top-up Methods you define an ordered list of buttons that users see on the recharge page. Each entry is an object. The example below is illustrative only — names, colors, and amounts are placeholders (values TBD / 待补):

[
  {
    "color": "rgba(var(--semi-blue-5), 1)",
    "name": "Method A (TBD)",
    "type": "channel_a"
  },
  {
    "color": "rgba(var(--semi-green-5), 1)",
    "name": "Method B (TBD)",
    "type": "channel_b",
    "min_topup": "TBD"
  }
]

Field Descriptions

  • name: Display text shown on the "Select Payment Method" button.
  • color: Theme or border color for the button/badge. Accepts any CSS color value; reusing existing design tokens (for example rgba(var(--semi-blue-5), 1)) is recommended for visual consistency.
  • type: Channel identifier used for backend routing and order placement. The backend maps each type to a configured gateway; values are passed through as the channel parameter. Detailed routing logic lives in the backend top-up controller (see the source repository).
  • min_topup: Minimum top-up amount (in the page's display currency). If the entered amount is below this value, the page blocks the request and prompts the user; the backend validates it again. The actual minimum is (TBD / 待补).
  • Order: Buttons render left-to-right in array order.

Top-up Amount Configuration

Custom Top-up Amount Options

Define the quick-pick amounts users can click on the recharge page. The values shown here are placeholders only — no real amounts are set in this demo (amounts TBD / 待补):

["TBD", "TBD", "TBD"]

These values appear in the "Select Top-up Quota" area as one-click options.

Top-up Amount Discount Configuration

You can optionally map top-up amounts to a discount rate. The key is the amount and the value is the rate. The example is structural only — no real discount tiers are offered (rates/amounts TBD / 待补):

{
  "TBD": "rate-TBD",
  "TBD": "rate-TBD"
}
  • Key: Top-up amount (string).
  • Value: Discount rate as a decimal between 0 and 1 (for example, 0.95 would mean the user pays 95% of the price). Concrete rates are (TBD / 待补).
  • The system computes the actual charge and the savings from this configuration.
  • Use of discounting must stay within your authorized scope and comply with upstream terms, platform rules, and local law.

Detailed implementation logic lives in the backend top-up controller in the source repository.

Feedback

Found an issue with this page or the top-up flow? Open an issue in the Code Router repository.

How is this guide?

Last updated on