Files
new-api/setting/operation_setting/payment_setting_old.go
T
CaIon 14a9acd368 feat(custom): CNY native billing, daily check-in button, subscription plans page, usage docs and promo banner
Based on QuantumNous/new-api v1.0.0-rc.36 (shallow history squashed).

- CNY quota display mode: RMB-denominated top-up and crediting across Epay/Waffo channels
- New CheckinButton in both authenticated and public headers (Turnstile supported)
- New /subscribe page with public plan snapshot, Alipay/balance payment, auto group upgrade/reset
- New /docs 12-section beginner guide with anchor navigation
- New home PromoBanner linking to /docs; i18n synced (en/zh/zh-TW/fr/ja/ru/vi)
- README: document custom features, live demo https://ai.88531.cn
2026-09-23 16:28:52 +08:00

60 lines
1.2 KiB
Go

/**
此文件为旧版支付设置文件,如需增加新的参数、变量等,请在 payment_setting.go 中添加
This file is the old version of the payment settings file. If you need to add new parameters, variables, etc., please add them in payment_setting.go
*/
package operation_setting
import (
"github.com/QuantumNous/new-api/common"
)
var PayAddress = ""
var CustomCallbackAddress = ""
var EpayId = ""
var EpayKey = ""
var Price = 7.3
var MinTopUp = 1
var USDExchangeRate = 7.3
var PayMethods = []map[string]string{
{
"name": "支付宝",
"icon": "SiAlipay",
"type": "alipay",
},
{
"name": "微信",
"icon": "SiWechat",
"type": "wxpay",
},
{
"name": "自定义1",
"icon": "LuCreditCard",
"type": "custom1",
"min_topup": "50",
},
}
func UpdatePayMethodsByJsonString(jsonString string) error {
PayMethods = make([]map[string]string, 0)
return common.Unmarshal([]byte(jsonString), &PayMethods)
}
func PayMethods2JsonString() string {
jsonBytes, err := common.Marshal(PayMethods)
if err != nil {
return "[]"
}
return string(jsonBytes)
}
func ContainsPayMethod(method string) bool {
for _, payMethod := range PayMethods {
if payMethod["type"] == method {
return true
}
}
return false
}