You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
716 B
34 lines
716 B
// @Time : 2020/7/9 16:08
|
|
// @Author : 黑白配
|
|
// @File : main.go
|
|
// @PackageName:WXPay
|
|
// @Description:微信支付
|
|
|
|
package WXPay
|
|
|
|
import (
|
|
"git.ouxuan.net/3136352472/wxpay/src/V2"
|
|
"git.ouxuan.net/3136352472/wxpay/src/V3"
|
|
"git.ouxuan.net/3136352472/wxpay/src/config"
|
|
"git.ouxuan.net/3136352472/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 = ¶ms
|
|
|
|
return
|
|
}
|