6 Star 26 Fork 13

黑白配 / wxpay

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
main.go 684 Bytes
一键复制 编辑 原始数据 按行查看 历史
黑白配 提交于 2020-07-10 15:27 . feat 增加配置
// @Time : 2020/7/9 16:08
// @Author : 黑白配
// @File : main.go
// @PackageName:WXPay
// @Description:微信支付
package WXPay
import (
"github.com/wleven/wxpay/src/V2"
"github.com/wleven/wxpay/src/V3"
"github.com/wleven/wxpay/src/config"
"github.com/wleven/wxpay/src/entity"
)
type WXPayApi struct {
V2 *V2.WxPay // V2接口
V3 *V3.API // V3接口
Config *entity.PayConfig // 配置
}
func Init(params entity.PayConfig) (api WXPayApi) {
api.V2 = V2.Init(params)
api.V3 = V3.Init(&config.V3{
MchID: params.MchID,
ClientKeyPath: params.APIClientPath.Key,
SerialNo: params.SerialNo,
})
api.Config = &params
return
}
Go
1
https://gitee.com/wleven/wxpay.git
git@gitee.com:wleven/wxpay.git
wleven
wxpay
wxpay
master

搜索帮助