- analysis 数据分析相关 API
wc := wechat.NewWechat()
memory := cache.NewMemory()
cfg := &miniConfig.Config{
AppID: "xxx",
AppSecret: "xxx",
Cache: memory,
}
miniprogram := wc.GetMiniProgram(cfg)
miniprogram.GetAnalysis().GetAnalysisDailyRetain()
相关文档:小程序虚拟支付
wc := wechat.NewWechat()
miniprogram := wc.GetMiniProgram(&miniConfig.Config{
AppID: "xxx",
AppSecret: "xxx",
AppKey: "xxx",
OfferID: "xxx",
Cache: cache.NewRedis(&redis.Options{
Addr: "",
}),
})
virtualPayment := miniprogram.GetVirtualPayment()
virtualPayment.SetSessionKey("xxx")
// 查询用户余额
var (
res *virtualPayment.QueryUserBalanceResponse
err error
)
if res, err = virtualPayment.QueryUserBalance(context.TODO(), &virtualPayment.QueryUserBalanceRequest{
OpenID: "xxx",
Env: virtualPayment.EnvProduction,
UserIP: "xxx",
}); err != nil {
panic(err)
}