1
0
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:
Mongo
2017-10-28 00:32:08 +08:00
parent d9134ee361
commit 97752d09a6
4 changed files with 123 additions and 0 deletions

View File

@@ -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)
}