houseme f62fd8de8e Merge branch 'v2' of github.com:silenceper/wechat into feature/remove-redis il y a 1 an
..
analysis 430c60a36e fix: 将小程序数据统计UserPortraitItem结构体的access_source_visit_uv改为value (#602) il y a 3 ans
auth d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
business d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
config dea33e0e48 小程序消息推送 (#713) il y a 2 ans
content 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) il y a 4 ans
context 972dec0406 将小程序获取ak的方式也抽象出来 il y a 6 ans
encryptor 00b13cda0d 增加iv校验 (#482) il y a 4 ans
message 1138a7db0e feat:追加动态消息接口 (#775) il y a 2 ans
minidrama 8f10936479 fix: util.DecodeWithError result (#729) il y a 2 ans
order e02af1dc0f 小程序发货信息管理 (#710) il y a 2 ans
privacy d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
qrcode 2e0708845b add-show_splash_ad-for-qrcodeparam (#794) il y a 1 an
redpacketcover 7fcd7a34dd 添加小程序获取红包封面接口 (#760) il y a 2 ans
riskcontrol 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) il y a 4 ans
security d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
shortlink d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
subscribe d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
tcb a8f7a24ff6 feat: improve comment and upgrade golang version 1.16 (#604) il y a 3 ans
urllink d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
urlscheme d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) il y a 2 ans
virtualpayment 8f10936479 fix: util.DecodeWithError result (#729) il y a 2 ans
werun 45caf61899 Silenceper release 2.0 (#408) il y a 5 ans
README.md b08cf8738e feat: remove redis relation il y a 2 ans
miniprogram.go 1138a7db0e feat:追加动态消息接口 (#775) il y a 2 ans

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.NewMemory(),
})
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)
}