1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-04 12:52:27 +08:00
Files
wechat/miniprogram
ccfish 1138a7db0e feat:追加动态消息接口 (#775)
* 小程序发货信息管理

* fix golang lint

* fix miss

* fix lint

* fix lint

* fix lint

* 修复查询参数last_index=“”时异常

* 小程序消息推送

* fix lint errors

* fix lint

* fix lint

* fix lint,

* 简化写法

* fix 简化写法

* fix name in comments

* Update miniprogram.go

* add events

* change GoodsInfo type

* change statements to 50

* 追加xml支持

* fix cl lint

* 追加动态消息

* 删除多余空格

* 修复命名

* 修复createActivityId返回值类型
2024-04-23 10:03:08 +08:00
..
2023-08-27 19:13:00 +08:00
2021-09-16 12:21:40 +08:00
2023-08-27 11:25:05 +08:00
2021-06-10 10:28:01 +08:00

微信小程序

官方文档

包说明

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