分离小米支付与taptap支付到库里面

This commit is contained in:
ayflying
2025-07-08 16:30:44 +08:00
parent ed9b0dd248
commit ee9e399a81
5 changed files with 224 additions and 100 deletions

View File

@@ -0,0 +1,29 @@
package xiaomi
import (
"github.com/gogf/gf/v2/frame/g"
"github.com/gogf/gf/v2/os/gctx"
)
// Config 小米支付配置信息
type Config struct {
AppID string `json:"app_id"` // 应用ID
AppSecret string `json:"app_secret"` // 应用密钥
//PrivateKey string // 商户私钥(如需证书)
//MIAPIURL string // 小米支付API基础地址
//IsSandbox bool // 是否沙箱环境
}
// Miipay 小米支付客户端
type MiPay struct {
config *Config
}
func New() *MiPay {
_cfg, _ := g.Cfg().Get(gctx.New(), "pay.xiaomi")
var cfg *Config
_cfg.Scan(&cfg)
return &MiPay{
config: cfg,
}
}