ccfish 5927c26152 追加接口【微信物流服务 /微信物流服务(商家查看) /查询组件】 (#843) 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 5927c26152 追加接口【微信物流服务 /微信物流服务(商家查看) /查询组件】 (#843) 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)
}