markwang 8ebff5c29c feat: 微信小程序-运维中心 (#838) пре 11 месеци
..
analysis ee85790123 微信小程序-数据分析-获取小程序性能数据 (#837) пре 11 месеци
auth 2dfd2ff608 feat: 微信小程序-登录及用户信息 (#830) пре 1 година
business 92bf6c7699 use context when getting access token (#815) пре 1 година
config 3fbe8634d9 officeaccount 和 miniprogram 添加UseStableAK 配置项 (#788) пре 1 година
content 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) пре 4 година
context 92bf6c7699 use context when getting access token (#815) пре 1 година
encryptor 00b13cda0d 增加iv校验 (#482) пре 4 година
express 86ef690ecd feat: 添加 微信物流服务 /微信物流服务(商家查看) /消息组件 (#842) пре 11 месеци
message 8a810837a4 feat: 微信小程序-动态消息及订阅消息 (#835) пре 1 година
minidrama 8f10936479 fix: util.DecodeWithError result (#729) пре 2 година
operation 8ebff5c29c feat: 微信小程序-运维中心 (#838) пре 11 месеци
order e02af1dc0f 小程序发货信息管理 (#710) пре 2 година
privacy d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) пре 2 година
qrcode 2e0708845b add-show_splash_ad-for-qrcodeparam (#794) пре 1 година
redpacketcover 7fcd7a34dd 添加小程序获取红包封面接口 (#760) пре 2 година
riskcontrol 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) пре 4 година
security c51d41ee8a security 模块增加 context 调用函数 (#836) пре 1 година
shortlink d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) пре 2 година
subscribe 8a810837a4 feat: 微信小程序-动态消息及订阅消息 (#835) пре 1 година
tcb a8f7a24ff6 feat: improve comment and upgrade golang version 1.16 (#604) пре 3 година
urllink dd43b7baa3 feat: 微信小程序-小程序链接 (#833) пре 1 година
urlscheme dd43b7baa3 feat: 微信小程序-小程序链接 (#833) пре 1 година
virtualpayment 8f10936479 fix: util.DecodeWithError result (#729) пре 2 година
werun 45caf61899 Silenceper release 2.0 (#408) пре 5 година
README.md cc201fcece feat: create Mini Program entertainment mini-drama related interface (#711) пре 2 година
miniprogram.go 8ebff5c29c feat: 微信小程序-运维中心 (#838) пре 11 месеци

README.md

微信小程序

官方文档

包说明

  • analysis 数据分析相关 API

快速入门

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