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:
@@ -21,7 +21,7 @@ miniprogram.GetAnalysis().GetAnalysisDailyRetain()
|
|||||||
```
|
```
|
||||||
|
|
||||||
### 小程序虚拟支付
|
### 小程序虚拟支付
|
||||||
#### `注意:需要传入 Appkey 的值`
|
#### `注意:需要传入 Appkey、OfferID 的值`
|
||||||
相关文档:[小程序虚拟支付](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)
|
相关文档:[小程序虚拟支付](https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/industry/virtual-payment.html)
|
||||||
```go
|
```go
|
||||||
wc := wechat.NewWechat()
|
wc := wechat.NewWechat()
|
||||||
@@ -29,6 +29,7 @@ miniprogram := wc.GetMiniProgram(&miniConfig.Config{
|
|||||||
AppID: "xxx",
|
AppID: "xxx",
|
||||||
AppSecret: "xxx",
|
AppSecret: "xxx",
|
||||||
AppKey: "xxx",
|
AppKey: "xxx",
|
||||||
|
OfferID: "xxx",
|
||||||
Cache: cache.NewRedis(&redis.Options{
|
Cache: cache.NewRedis(&redis.Options{
|
||||||
Addr: "",
|
Addr: "",
|
||||||
}),
|
}),
|
||||||
|
|||||||
@@ -10,5 +10,6 @@ type Config struct {
|
|||||||
AppID string `json:"app_id"` // appid
|
AppID string `json:"app_id"` // appid
|
||||||
AppSecret string `json:"app_secret"` // appSecret
|
AppSecret string `json:"app_secret"` // appSecret
|
||||||
AppKey string `json:"app_key"` // appKey
|
AppKey string `json:"app_key"` // appKey
|
||||||
|
OfferID string `json:"offer_id"` // offerId
|
||||||
Cache cache.Cache
|
Cache cache.Cache
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user