yin jiashuai 54f08cbd73 update:小程序ocr识别 refs#864 (#865) 7 meses atrás
..
analysis ee85790123 微信小程序-数据分析-获取小程序性能数据 (#837) 11 meses atrás
auth 2dfd2ff608 feat: 微信小程序-登录及用户信息 (#830) 1 ano atrás
business 92bf6c7699 use context when getting access token (#815) 1 ano atrás
config 3fbe8634d9 officeaccount 和 miniprogram 添加UseStableAK 配置项 (#788) 1 ano atrás
content 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) 4 anos atrás
context 92bf6c7699 use context when getting access token (#815) 1 ano atrás
encryptor 00b13cda0d 增加iv校验 (#482) 4 anos atrás
express 5927c26152 追加接口【微信物流服务 /微信物流服务(商家查看) /查询组件】 (#843) 11 meses atrás
message 6f6e95cfdb 将`SubscribeMsgSentList`结构中的`ErrorCode`类型从`int`更新为`string` (#859) 8 meses atrás
minidrama 8f10936479 fix: util.DecodeWithError result (#729) 2 anos atrás
ocr 54f08cbd73 update:小程序ocr识别 refs#864 (#865) 7 meses atrás
operation 8ebff5c29c feat: 微信小程序-运维中心 (#838) 11 meses atrás
order e02af1dc0f 小程序发货信息管理 (#710) 2 anos atrás
privacy d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) 2 anos atrás
qrcode 2e0708845b add-show_splash_ad-for-qrcodeparam (#794) 1 ano atrás
redpacketcover 7fcd7a34dd 添加小程序获取红包封面接口 (#760) 2 anos atrás
riskcontrol 56350c3655 add: [小程序] 增加 安全风控、内容安全1.0 & 2.0、code换取手机号 (#554) 4 anos atrás
security c51d41ee8a security 模块增加 context 调用函数 (#836) 1 ano atrás
shortlink d28ca4f334 feat: optimized-error-handling&remove unused constant (#772) 2 anos atrás
subscribe 8a810837a4 feat: 微信小程序-动态消息及订阅消息 (#835) 1 ano atrás
tcb a8f7a24ff6 feat: improve comment and upgrade golang version 1.16 (#604) 3 anos atrás
urllink dd43b7baa3 feat: 微信小程序-小程序链接 (#833) 1 ano atrás
urlscheme dd43b7baa3 feat: 微信小程序-小程序链接 (#833) 1 ano atrás
virtualpayment 8f10936479 fix: util.DecodeWithError result (#729) 2 anos atrás
werun 45caf61899 Silenceper release 2.0 (#408) 5 anos atrás
README.md cc201fcece feat: create Mini Program entertainment mini-drama related interface (#711) 2 anos atrás
miniprogram.go 54f08cbd73 update:小程序ocr识别 refs#864 (#865) 7 meses atrás

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