QuantumNous / QuantumNous/new-api

功能请求:为 Waffo Pancake 支付网关增加独立启用开关

Open
#5,643 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Go
Stars
48.5k
Forks
11.6k
Avg merge
1d 17h
Merged PRs (30d)
58

Description

提交前必读(请勿删除本节)

  • 文档:https://docs.newapi.ai/
  • 使用问题先看或先问:https://deepwiki.com/QuantumNous/new-api
  • 开启透传后的转发相关反馈不接受 issue;透传模式会直接转发请求,请自行确认上游行为。
  • 不接受 coding plan、逆向渠道等技术支持类 issue。
  • 警告:删除本模板、删除小节标题或随意清空内容的 issue,可能会被直接关闭;重复恶意提交者可能会被 block。

您当前的 newapi 版本

main-0b7ae4e

提交确认

  • 非重复 issue: 我已搜索现有 Issues,确认目前没有类似 issue。
  • 提交前必读: 我已完整阅读上方“提交前必读”,并已查看文档 https://docs.newapi.ai/、项目 README 且向 AI 提问,确认这不是使用、配置或接入类问题,且现有版本无法满足需求。
  • 模板完整: 我未删除此模板中的任何引导内容或小节标题,并会按要求完整填写。
  • 维护成本: 我理解项目维护者精力有限,不遵循模板要求的 issue 可能会被无视或直接关闭。

功能描述

希望为 Waffo Pancake 支付网关增加一个显式的启用/禁用开关,例如:

  • WaffoPancakeEnabled
  • 或后台支付设置中的「启用 Waffo Pancake」开关

当前 Waffo Pancake 是否可用是通过配置完整性隐式判断的:只要 WaffoPancakeMerchantIDWaffoPancakePrivateKeyWaffoPancakeProductID 等关键字段存在,就会被视为可用。

这导致管理员想临时关闭该支付网关时,只能清空某个关键配置字段,例如产品 ID 或私钥。这样虽然可以达到关闭效果,但有几个问题:

  1. 关闭意图不直观
    后台看起来像是配置被删掉/没配完整,而不是“已禁用”。

  2. 恢复成本更高
    临时关闭后,如果清空的是产品 ID、私钥、店铺等字段,恢复时需要重新填写或从备份里找回。

  3. 容易误操作
    管理员可能只是想暂停一个支付渠道,但实际操作会修改关键凭据/产品配置。

  4. 不利于多支付渠道管理
    对支付渠道来说,「配置保留」和「是否启用」最好分离。这样可以在不删除配置的情况下切换支付方式。

建议行为:

  • 后台增加 Waffo Pancake 独立启用开关。
  • 保存商户 ID、私钥、店铺 ID、产品 ID、返回地址等配置时,不自动代表启用。
  • 当开关关闭时:
    • 用户充值页不展示 Waffo Pancake 入口;
    • 创建充值订单时不允许使用该网关;
    • webhook 可以继续安全返回禁用/不可用状态,或者仅处理已存在的待支付订单,具体行为可由项目维护者决定。
  • 当开关开启时:
    • 再校验 Merchant ID / Private Key / Product ID 等必要字段是否完整。

应用场景

运营中有时需要临时关闭某个支付网关,例如:

  • 支付平台维护;
  • 商户资料审核中;
  • 风控/费率/结算策略调整;
  • 想先保留配置但暂时不开放给用户;
  • 只想切换到其它充值方式,而不是删除 Waffo Pancake 配置。

如果有独立启用开关,管理员可以直接关闭网关,同时保留所有已有配置,后续恢复时只需要重新打开开关即可,体验会更清晰,也更安全。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the Waffo Pancake configuration and the payment settings, recharge-page, order-creation, and webhook entry points. Trace how configuration completeness currently enables the gateway and determine the existing behavior for disabled or incomplete gateways. Done means an independent enable switch preserves saved configuration, hides the gateway and blocks new orders when disabled, and revalidates required fields when enabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
backend, payments
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.