|
|
3 周之前 | |
|---|---|---|
| .. | ||
| analysis | 11 月之前 | |
| auth | 1 年之前 | |
| business | 1 年之前 | |
| config | 1 年之前 | |
| content | 4 年之前 | |
| context | 1 年之前 | |
| encryptor | 4 年之前 | |
| express | 5 月之前 | |
| message | 1 月之前 | |
| minidrama | 2 年之前 | |
| ocr | 7 月之前 | |
| operation | 11 月之前 | |
| order | 2 年之前 | |
| privacy | 2 年之前 | |
| qrcode | 3 周之前 | |
| redpacketcover | 2 年之前 | |
| riskcontrol | 4 年之前 | |
| security | 1 年之前 | |
| shortlink | 2 年之前 | |
| subscribe | 1 年之前 | |
| tcb | 3 年之前 | |
| urllink | 1 年之前 | |
| urlscheme | 1 年之前 | |
| virtualpayment | 3 周之前 | |
| werun | 5 年之前 | |
| README.md | 2 年之前 | |
| miniprogram.go | 5 月之前 | |
wc := wechat.NewWechat()
memory := cache.NewMemory()
cfg := &miniConfig.Config{
AppID: "xxx",
AppSecret: "xxx",
Cache: memory,
}
miniprogram := wc.GetMiniProgram(cfg)
miniprogram.GetAnalysis().GetAnalysisDailyRetain()
注意:需要传入 Appkey、OfferID 的值相关文档:小程序虚拟支付
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)
}