-
Notifications
You must be signed in to change notification settings - Fork 149
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0a40cf6
commit 4963ce5
Showing
42 changed files
with
4,316 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ActApplyInfo | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**StoreInfo** | [**StoreInfo**](StoreInfo.md) | 门店信息 | | ||
**GoodsOriginalPrice** | **int64** | 品牌加价购活动商品的原价,该价格会在加价购小程序插件中展示(单位:分) | | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ActArea | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**Province** | **string** | 省名称 | [可选] | ||
**City** | **string** | 市名称 | [可选] | ||
**District** | **string** | 区名称 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# ActInfo | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**ActivityName** | **string** | 活动名称 | [可选] | ||
**ApplyStartTime** | **string** | 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间) | [可选] | ||
**ApplyEndTime** | **string** | 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间) | [可选] | ||
**ActivityStartTime** | **string** | 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间) | [可选] | ||
**ActivityEndTime** | **string** | 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间) | [可选] | ||
**ActivityDescription** | **string** | 活动描述 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# ActRule | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**StoreSubsidy** | **int64** | 购买单件商品,补贴给门店的金额(单位:分) | [可选] | ||
**ServiceProviderSubsidy** | **int64** | 购买单件商品,补贴给服务商的佣金(单位:分) | [可选] | ||
**StoreSubsidyQuota** | **int64** | 活动门店补贴商品数上限 | [可选] | ||
**UserSubsidyQuota** | **int64** | 单用户享受加价购优惠次数上限 | [可选] | ||
**Areas** | [**[]ActArea**](ActArea.md) | 活动区域列表 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,187 @@ | ||
# retailstore/ActivityApi | ||
|
||
所有URI均基于微信支付 API 地址: *https://api.mch.weixin.qq.com* | ||
|
||
方法名 | HTTP 请求 | 描述 | ||
------------- | ------------- | ------------- | ||
[**ApplyActivity**](#applyactivity) | **Post** /v3/marketing/goods-subsidy-activity/activity/{activity_id}/apply | 门店报名品牌加价购活动 | ||
[**ListActsByArea**](#listactsbyarea) | **Get** /v3/marketing/goods-subsidy-activity/activities | 按区域查询品牌加价购活动 | ||
|
||
|
||
|
||
## ApplyActivity | ||
|
||
> ApplyActivityResponse ApplyActivity(ApplyActivityRequest) | ||
门店报名品牌加价购活动 | ||
|
||
|
||
|
||
### 调用示例 | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/wechatpay-apiv3/wechatpay-go/core" | ||
"github.com/wechatpay-apiv3/wechatpay-go/services/retailstore" | ||
"github.com/wechatpay-apiv3/wechatpay-go/utils" | ||
) | ||
|
||
func main() { | ||
var ( | ||
mchID string = "190000****" // 商户号 | ||
mchCertificateSerialNumber string = "3775************************************" // 商户证书序列号 | ||
mchAPIv3Key string = "2ab9****************************" // 商户APIv3密钥 | ||
) | ||
|
||
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名 | ||
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem") | ||
if err != nil { | ||
log.Printf("load merchant private key error:%s", err) | ||
return | ||
} | ||
|
||
ctx := context.Background() | ||
// 使用商户私钥等初始化 client,并使它具有自动定时获取微信支付平台证书的能力 | ||
opts := []core.ClientOption{ | ||
option.WithWechatPayAutoAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchAPIv3Key), | ||
} | ||
client, err := core.NewClient(ctx, opts...) | ||
if err != nil { | ||
log.Printf("new wechat pay client err:%s", err) | ||
return | ||
} | ||
|
||
svc := retailstore.ActivityApiService{Client: client} | ||
resp, result, err := svc.ApplyActivity(ctx, | ||
retailstore.ApplyActivityRequest{ | ||
ActivityId: core.String("123"), | ||
CallerMerchantId: core.String("1894101023"), | ||
ApplyInfos: []retailstore.ActApplyInfo{retailstore.ActApplyInfo{ | ||
StoreInfo: &retailstore.StoreInfo{ | ||
StoreId: core.String("100"), | ||
AccountingMerchantId: core.String("2831255701"), | ||
MerchantId: core.String("6281399112"), | ||
}, | ||
GoodsOriginalPrice: core.Int64(100), | ||
}}, | ||
}, | ||
) | ||
|
||
if err != nil { | ||
// 处理错误 | ||
log.Printf("call ApplyActivity err:%s", err) | ||
} else { | ||
// 处理返回结果 | ||
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp) | ||
} | ||
} | ||
``` | ||
|
||
### 参数列表 | ||
参数名 | 参数类型 | 参数描述 | ||
------------- | ------------- | ------------- | ||
**ctx** | **context.Context** | Golang 上下文,可用于日志、请求取消、请求跟踪等功能| | ||
**req** | [**ApplyActivityRequest**](ApplyActivityRequest.md) | API `retailstore` 所定义的本接口需要的所有参数,包括`Path`/`Query`/`Body` 3类参数| | ||
|
||
### 返回结果 | ||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**resp** | \*[**ApplyActivityResponse**](ApplyActivityResponse.md) | 结构化的接口返回结果 | ||
**result** | **\*core.APIResult** | 本次 API 访问的请求与应答信息 | ||
**err** | **error** | 本次 API 访问中发生的错误,当且仅当 API 失败时存在 | ||
|
||
[\[返回顶部\]](#retailstoreactivityapi) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
||
## ListActsByArea | ||
|
||
> ListActsByAreaResponse ListActsByArea(ListActsByAreaRequest) | ||
按区域查询品牌加价购活动 | ||
|
||
|
||
|
||
### 调用示例 | ||
|
||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
"log" | ||
|
||
"github.com/wechatpay-apiv3/wechatpay-go/core" | ||
"github.com/wechatpay-apiv3/wechatpay-go/services/retailstore" | ||
"github.com/wechatpay-apiv3/wechatpay-go/utils" | ||
) | ||
|
||
func main() { | ||
var ( | ||
mchID string = "190000****" // 商户号 | ||
mchCertificateSerialNumber string = "3775************************************" // 商户证书序列号 | ||
mchAPIv3Key string = "2ab9****************************" // 商户APIv3密钥 | ||
) | ||
|
||
// 使用 utils 提供的函数从本地文件中加载商户私钥,商户私钥会用来生成请求的签名 | ||
mchPrivateKey, err := utils.LoadPrivateKeyWithPath("/path/to/merchant/apiclient_key.pem") | ||
if err != nil { | ||
log.Printf("load merchant private key error:%s", err) | ||
return | ||
} | ||
|
||
ctx := context.Background() | ||
// 使用商户私钥等初始化 client,并使它具有自动定时获取微信支付平台证书的能力 | ||
opts := []core.ClientOption{ | ||
option.WithWechatPayAutoAuthCipher(mchID, mchCertificateSerialNumber, mchPrivateKey, mchAPIv3Key), | ||
} | ||
client, err := core.NewClient(ctx, opts...) | ||
if err != nil { | ||
log.Printf("new wechat pay client err:%s", err) | ||
return | ||
} | ||
|
||
svc := retailstore.ActivityApiService{Client: client} | ||
resp, result, err := svc.ListActsByArea(ctx, | ||
retailstore.ListActsByAreaRequest{ | ||
CityId: core.String("123"), | ||
Offset: core.Int64(0), | ||
Limit: core.Int64(20), | ||
}, | ||
) | ||
|
||
if err != nil { | ||
// 处理错误 | ||
log.Printf("call ListActsByArea err:%s", err) | ||
} else { | ||
// 处理返回结果 | ||
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp) | ||
} | ||
} | ||
``` | ||
|
||
### 参数列表 | ||
参数名 | 参数类型 | 参数描述 | ||
------------- | ------------- | ------------- | ||
**ctx** | **context.Context** | Golang 上下文,可用于日志、请求取消、请求跟踪等功能| | ||
**req** | [**ListActsByAreaRequest**](ListActsByAreaRequest.md) | API `retailstore` 所定义的本接口需要的所有参数,包括`Path`/`Query`/`Body` 3类参数| | ||
|
||
### 返回结果 | ||
Name | Type | Description | ||
------------- | ------------- | ------------- | ||
**resp** | \*[**ListActsByAreaResponse**](ListActsByAreaResponse.md) | 结构化的接口返回结果 | ||
**result** | **\*core.APIResult** | 本次 API 访问的请求与应答信息 | ||
**err** | **error** | 本次 API 访问中发生的错误,当且仅当 API 失败时存在 | ||
|
||
[\[返回顶部\]](#retailstoreactivityapi) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回服务README\]](README.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# AddRepresentativeRequest | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**ActivityId** | **string** | 零售小店活动ID | | ||
**RepresentativeInfoList** | [**[]RepresentativeInfo**](RepresentativeInfo.md) | 业务代理信息列表 | | ||
**OutRequestNo** | **string** | 商户新增业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。 | | ||
**AddTime** | **string** | 添加时间 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# AddRepresentativesRequest | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**RepresentativeInfoList** | [**[]RepresentativeInfo**](RepresentativeInfo.md) | 业务代理信息列表 | | ||
**OutRequestNo** | **string** | 商户新增业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。 | | ||
**AddTime** | **string** | 添加时间 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# ApplyActivityBody | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**CallerMerchantId** | **string** | 调用报名活动API的商户的商户号 | | ||
**ApplyInfos** | [**[]ActApplyInfo**](ActApplyInfo.md) | 门店报名信息 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ApplyActivityRequest | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**ActivityId** | **string** | 活动ID | | ||
**CallerMerchantId** | **string** | 调用报名活动API的商户的商户号 | | ||
**ApplyInfos** | [**[]ActApplyInfo**](ActApplyInfo.md) | 门店报名信息 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# ApplyActivityResponse | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**ReturnMessage** | **string** | 返回结果文案 | [可选] | ||
**FailedApplyInfos** | [**[]ActApplyInfo**](ActApplyInfo.md) | 失败的报名记录 | [可选] | ||
**SucceedApplyInfos** | [**[]ActApplyInfo**](ActApplyInfo.md) | 成功的报名记录 | [可选] | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# CreateMaterialsBody | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**OutRequestNo** | **string** | 商户添加业务代理信息凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。 | | ||
**MaterialNum** | **int64** | 生成物料码数量 | | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# CreateMaterialsRequest | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**BrandId** | **string** | 品牌ID | | ||
**OutRequestNo** | **string** | 商户添加业务代理信息凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。 | | ||
**MaterialNum** | **int64** | 生成物料码数量 | | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# DeleteRepresentativeBody | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**RepresentativeInfoList** | [**[]RepresentativeInfo**](RepresentativeInfo.md) | 业务代理信息列表 | | ||
**OutRequestNo** | **string** | 商户删除业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。 | | ||
**DeleteTime** | **string** | 删除时间 | | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# DeleteRepresentativeRequest | ||
|
||
## 属性列表 | ||
|
||
名称 | 类型 | 描述 | 补充说明 | ||
------------ | ------------- | ------------- | ------------- | ||
**ActivityId** | **string** | 零售小店活动ID | | ||
**RepresentativeInfoList** | [**[]RepresentativeInfo**](RepresentativeInfo.md) | 业务代理信息列表 | | ||
**OutRequestNo** | **string** | 商户删除业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。 | | ||
**DeleteTime** | **string** | 删除时间 | | ||
|
||
[\[返回类型列表\]](README.md#类型列表) | ||
[\[返回接口列表\]](README.md#接口列表) | ||
[\[返回服务README\]](README.md) | ||
|
||
|
Oops, something went wrong.