mirror of
https://github.com/silenceper/wechat.git
synced 2026-02-04 12:52:27 +08:00
add jsapi payment demo version
This commit is contained in:
@@ -13,6 +13,7 @@ import (
|
||||
"github.com/silenceper/wechat/server"
|
||||
"github.com/silenceper/wechat/template"
|
||||
"github.com/silenceper/wechat/user"
|
||||
"github.com/silenceper/wechat/pay"
|
||||
)
|
||||
|
||||
// Wechat struct
|
||||
@@ -26,6 +27,9 @@ type Config struct {
|
||||
AppSecret string
|
||||
Token string
|
||||
EncodingAESKey string
|
||||
PayMchID string
|
||||
PayNotifyURL string //支付的通知接口
|
||||
PayKey string //商家后台设置的支付 key
|
||||
Cache cache.Cache
|
||||
}
|
||||
|
||||
@@ -87,3 +91,8 @@ func (wc *Wechat) GetUser() *user.User {
|
||||
func (wc *Wechat) GetTemplate() *template.Template {
|
||||
return template.NewTemplate(wc.Context)
|
||||
}
|
||||
|
||||
// GetPay 返回支付消息的实例
|
||||
func (wc *Wechat) GetPay() *pay.Pay {
|
||||
return pay.NewPay(wc.Context)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user