1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-23 13:42:25 +08:00

feat: improve code for virtual payment

This commit is contained in:
houseme
2023-08-24 22:50:40 +08:00
parent 4e7fec4a3c
commit 9132bd8f3f
2 changed files with 3 additions and 1 deletions

View File

@@ -21,7 +21,7 @@ miniprogram.GetAnalysis().GetAnalysisDailyRetain()
```
### 小程序虚拟支付
#### `注意:需要传入 Appkey 的值`
#### `注意:需要传入 Appkey、OfferID 的值`
相关文档:[小程序虚拟支付](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)
```go
wc := wechat.NewWechat()
@@ -29,6 +29,7 @@ miniprogram := wc.GetMiniProgram(&miniConfig.Config{
AppID: "xxx",
AppSecret: "xxx",
AppKey: "xxx",
OfferID: "xxx",
Cache: cache.NewRedis(&redis.Options{
Addr: "",
}),

View File

@@ -10,5 +10,6 @@ type Config struct {
AppID string `json:"app_id"` // appid
AppSecret string `json:"app_secret"` // appSecret
AppKey string `json:"app_key"` // appKey
OfferID string `json:"offer_id"` // offerId
Cache cache.Cache
}