Documentation
¶
Index ¶
- type ActApplyInfo
- type ActArea
- type ActInfo
- type ActRule
- type ActivityApiService
- func (a *ActivityApiService) ApplyActivity(ctx context.Context, req ApplyActivityRequest) (resp *ApplyActivityResponse, result *core.APIResult, err error)
- func (a *ActivityApiService) ListActsByArea(ctx context.Context, req ListActsByAreaRequest) (resp *ListActsByAreaResponse, result *core.APIResult, err error)
- type AddRepresentativeRequest
- type AddRepresentativesRequest
- type AddRepresentativesResponse
- type AddStoresBody
- type AddStoresRequest
- type AddStoresResponse
- type ApplyActivityBody
- type ApplyActivityRequest
- type ApplyActivityResponse
- type CreateMaterialsBody
- type CreateMaterialsRequest
- type DeleteRepresentativeBody
- type DeleteRepresentativeRequest
- type DeleteRepresentativeResponse
- type DeleteStoresBody
- type DeleteStoresRequest
- type DeleteStoresResponse
- type FmcgAct
- type GetStoreRequest
- type GoodsInfo
- type ListActsByAreaRequest
- type ListActsByAreaResponse
- type ListRepresentativeRequest
- type ListRepresentativeResponse
- type ListStoreRequest
- type ListStoreResponse
- type LockQualificationRequest
- type LockQualificationResponse
- type MaterialInfo
- type Materials
- type OrderInfo
- type QualificationApiService
- func (a *QualificationApiService) LockQualification(ctx context.Context, req LockQualificationRequest) (resp *LockQualificationResponse, result *core.APIResult, err error)
- func (a *QualificationApiService) UnlockQualification(ctx context.Context, req UnlockQualificationRequest) (resp *UnlockQualificationResponse, result *core.APIResult, err error)
- type RepresentativeInfo
- type RetailStoreActApiService
- func (a *RetailStoreActApiService) AddRepresentative(ctx context.Context, req AddRepresentativeRequest) (resp *AddRepresentativesResponse, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) AddStores(ctx context.Context, req AddStoresRequest) (resp *AddStoresResponse, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) CreateMaterials(ctx context.Context, req CreateMaterialsRequest) (resp *Materials, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) DeleteRepresentative(ctx context.Context, req DeleteRepresentativeRequest) (resp *DeleteRepresentativeResponse, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) DeleteStores(ctx context.Context, req DeleteStoresRequest) (resp *DeleteStoresResponse, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) GetStore(ctx context.Context, req GetStoreRequest) (resp *RetailStoreInfo, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) ListRepresentative(ctx context.Context, req ListRepresentativeRequest) (resp *ListRepresentativeResponse, result *core.APIResult, err error)
- func (a *RetailStoreActApiService) ListStore(ctx context.Context, req ListStoreRequest) (resp *ListStoreResponse, result *core.APIResult, err error)
- type RetailStoreInfo
- type StoreInfo
- type UnlockQualificationRequest
- type UnlockQualificationResponse
Examples ¶
- ActivityApiService.ApplyActivity
- ActivityApiService.ListActsByArea
- QualificationApiService.LockQualification
- QualificationApiService.UnlockQualification
- RetailStoreActApiService.AddRepresentative
- RetailStoreActApiService.AddStores
- RetailStoreActApiService.CreateMaterials
- RetailStoreActApiService.DeleteRepresentative
- RetailStoreActApiService.DeleteStores
- RetailStoreActApiService.GetStore
- RetailStoreActApiService.ListRepresentative
- RetailStoreActApiService.ListStore
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ActApplyInfo ¶
type ActApplyInfo struct {
// 门店信息
StoreInfo *StoreInfo `json:"store_info"`
// 品牌加价购活动商品的原价,该价格会在加价购小程序插件中展示(单位:分)
GoodsOriginalPrice *int64 `json:"goods_original_price"`
}
ActApplyInfo
func (ActApplyInfo) Clone ¶
func (o ActApplyInfo) Clone() *ActApplyInfo
func (ActApplyInfo) MarshalJSON ¶
func (o ActApplyInfo) MarshalJSON() ([]byte, error)
func (ActApplyInfo) String ¶
func (o ActApplyInfo) String() string
type ActArea ¶
type ActArea struct {
// 省名称
Province *string `json:"province,omitempty"`
// 市名称
City *string `json:"city,omitempty"`
// 区名称
District *string `json:"district,omitempty"`
}
ActArea
func (ActArea) MarshalJSON ¶
type ActInfo ¶
type ActInfo struct {
// 活动名称
ActivityName *string `json:"activity_name,omitempty"`
// 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)
ApplyStartTime *string `json:"apply_start_time,omitempty"`
// 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)
ApplyEndTime *string `json:"apply_end_time,omitempty"`
// 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)
ActivityStartTime *string `json:"activity_start_time,omitempty"`
// 遵循rfc3339标准格式,格式为YYYY-MM-DDTHH:mm:ss+TIMEZONE,YYYY-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC 8小时,即北京时间)
ActivityEndTime *string `json:"activity_end_time,omitempty"`
// 活动描述
ActivityDescription *string `json:"activity_description,omitempty"`
}
ActInfo
func (ActInfo) MarshalJSON ¶
type ActRule ¶
type ActRule struct {
// 购买单件商品,补贴给门店的金额(单位:分)
StoreSubsidy *int64 `json:"store_subsidy,omitempty"`
// 购买单件商品,补贴给服务商的佣金(单位:分)
ServiceProviderSubsidy *int64 `json:"service_provider_subsidy,omitempty"`
// 活动门店补贴商品数上限
StoreSubsidyQuota *int64 `json:"store_subsidy_quota,omitempty"`
// 单用户享受加价购优惠次数上限
UserSubsidyQuota *int64 `json:"user_subsidy_quota,omitempty"`
// 活动区域列表
Areas []ActArea `json:"areas,omitempty"`
}
ActRule
func (ActRule) MarshalJSON ¶
type ActivityApiService ¶
func (*ActivityApiService) ApplyActivity ¶
func (a *ActivityApiService) ApplyActivity(ctx context.Context, req ApplyActivityRequest) (resp *ApplyActivityResponse, result *core.APIResult, err error)
ApplyActivity 门店报名品牌加价购活动
接口介绍:该接口为服务商替门店报名品牌加价购活动专用接口。 使用对象:指定服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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)
}
}
func (*ActivityApiService) ListActsByArea ¶
func (a *ActivityApiService) ListActsByArea(ctx context.Context, req ListActsByAreaRequest) (resp *ListActsByAreaResponse, result *core.APIResult, err error)
ListActsByArea 按区域查询品牌加价购活动
接口介绍:该接口为服务商查询门店报名的品牌加价购活动的专用接口。 使用对象:指定服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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)
}
}
type AddRepresentativeRequest ¶
type AddRepresentativeRequest struct {
// 零售小店活动ID
ActivityId *string `json:"activity_id"`
// 业务代理信息列表
RepresentativeInfoList []RepresentativeInfo `json:"representative_info_list"`
// 商户新增业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 添加时间
AddTime *string `json:"add_time,omitempty"`
}
AddRepresentativeRequest
func (AddRepresentativeRequest) Clone ¶
func (o AddRepresentativeRequest) Clone() *AddRepresentativeRequest
func (AddRepresentativeRequest) MarshalJSON ¶
func (o AddRepresentativeRequest) MarshalJSON() ([]byte, error)
func (AddRepresentativeRequest) String ¶
func (o AddRepresentativeRequest) String() string
type AddRepresentativesRequest ¶
type AddRepresentativesRequest struct {
// 业务代理信息列表
RepresentativeInfoList []RepresentativeInfo `json:"representative_info_list"`
// 商户新增业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 添加时间
AddTime *string `json:"add_time,omitempty"`
}
AddRepresentativesRequest
func (AddRepresentativesRequest) Clone ¶
func (o AddRepresentativesRequest) Clone() *AddRepresentativesRequest
func (AddRepresentativesRequest) MarshalJSON ¶
func (o AddRepresentativesRequest) MarshalJSON() ([]byte, error)
func (AddRepresentativesRequest) String ¶
func (o AddRepresentativesRequest) String() string
type AddRepresentativesResponse ¶
type AddRepresentativesResponse struct {
// 零售小店活动ID
ActivityId *string `json:"activity_id"`
// 添加失败业务代理信息列表
FailedRepresentativeInfoList []RepresentativeInfo `json:"failed_representative_info_list,omitempty"`
// 添加时间
AddTime *string `json:"add_time"`
}
AddRepresentativesResponse
func (AddRepresentativesResponse) Clone ¶
func (o AddRepresentativesResponse) Clone() *AddRepresentativesResponse
func (AddRepresentativesResponse) MarshalJSON ¶
func (o AddRepresentativesResponse) MarshalJSON() ([]byte, error)
func (AddRepresentativesResponse) String ¶
func (o AddRepresentativesResponse) String() string
type AddStoresBody ¶
type AddStoresBody struct {
// 商户新增小店活动门店凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 添加时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
AddTime *string `json:"add_time"`
// 待新增的小店活动门店列表
Stores []RetailStoreInfo `json:"stores"`
}
AddStoresBody
func (AddStoresBody) Clone ¶
func (o AddStoresBody) Clone() *AddStoresBody
func (AddStoresBody) MarshalJSON ¶
func (o AddStoresBody) MarshalJSON() ([]byte, error)
func (AddStoresBody) String ¶
func (o AddStoresBody) String() string
type AddStoresRequest ¶
type AddStoresRequest struct {
// 品牌ID
BrandId *string `json:"brand_id"`
// 商户新增小店活动门店凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 添加时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
AddTime *string `json:"add_time"`
// 待新增的小店活动门店列表
Stores []RetailStoreInfo `json:"stores"`
}
AddStoresRequest
func (AddStoresRequest) Clone ¶
func (o AddStoresRequest) Clone() *AddStoresRequest
func (AddStoresRequest) MarshalJSON ¶
func (o AddStoresRequest) MarshalJSON() ([]byte, error)
func (AddStoresRequest) String ¶
func (o AddStoresRequest) String() string
type AddStoresResponse ¶
type AddStoresResponse struct {
// 添加时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
AddTime *string `json:"add_time,omitempty"`
// 添加失败的小店活动门店列表
FailedStores []RetailStoreInfo `json:"failed_stores,omitempty"`
}
AddStoresResponse
func (AddStoresResponse) Clone ¶
func (o AddStoresResponse) Clone() *AddStoresResponse
func (AddStoresResponse) MarshalJSON ¶
func (o AddStoresResponse) MarshalJSON() ([]byte, error)
func (AddStoresResponse) String ¶
func (o AddStoresResponse) String() string
type ApplyActivityBody ¶
type ApplyActivityBody struct {
// 调用报名活动API的商户的商户号
CallerMerchantId *string `json:"caller_merchant_id"`
// 门店报名信息
ApplyInfos []ActApplyInfo `json:"apply_infos,omitempty"`
}
ApplyActivityBody
func (ApplyActivityBody) Clone ¶
func (o ApplyActivityBody) Clone() *ApplyActivityBody
func (ApplyActivityBody) MarshalJSON ¶
func (o ApplyActivityBody) MarshalJSON() ([]byte, error)
func (ApplyActivityBody) String ¶
func (o ApplyActivityBody) String() string
type ApplyActivityRequest ¶
type ApplyActivityRequest struct {
// 活动ID
ActivityId *string `json:"activity_id"`
// 调用报名活动API的商户的商户号
CallerMerchantId *string `json:"caller_merchant_id"`
// 门店报名信息
ApplyInfos []ActApplyInfo `json:"apply_infos,omitempty"`
}
ApplyActivityRequest
func (ApplyActivityRequest) Clone ¶
func (o ApplyActivityRequest) Clone() *ApplyActivityRequest
func (ApplyActivityRequest) MarshalJSON ¶
func (o ApplyActivityRequest) MarshalJSON() ([]byte, error)
func (ApplyActivityRequest) String ¶
func (o ApplyActivityRequest) String() string
type ApplyActivityResponse ¶
type ApplyActivityResponse struct {
// 返回结果文案
ReturnMessage *string `json:"return_message,omitempty"`
// 失败的报名记录
FailedApplyInfos []ActApplyInfo `json:"failed_apply_infos,omitempty"`
// 成功的报名记录
SucceedApplyInfos []ActApplyInfo `json:"succeed_apply_infos,omitempty"`
}
ApplyActivityResponse
func (ApplyActivityResponse) Clone ¶
func (o ApplyActivityResponse) Clone() *ApplyActivityResponse
func (ApplyActivityResponse) MarshalJSON ¶
func (o ApplyActivityResponse) MarshalJSON() ([]byte, error)
func (ApplyActivityResponse) String ¶
func (o ApplyActivityResponse) String() string
type CreateMaterialsBody ¶
type CreateMaterialsBody struct {
// 商户添加业务代理信息凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 生成物料码数量
MaterialNum *int64 `json:"material_num"`
}
CreateMaterialsBody
func (CreateMaterialsBody) Clone ¶
func (o CreateMaterialsBody) Clone() *CreateMaterialsBody
func (CreateMaterialsBody) MarshalJSON ¶
func (o CreateMaterialsBody) MarshalJSON() ([]byte, error)
func (CreateMaterialsBody) String ¶
func (o CreateMaterialsBody) String() string
type CreateMaterialsRequest ¶
type CreateMaterialsRequest struct {
// 品牌ID
BrandId *string `json:"brand_id"`
// 商户添加业务代理信息凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 生成物料码数量
MaterialNum *int64 `json:"material_num"`
}
CreateMaterialsRequest
func (CreateMaterialsRequest) Clone ¶
func (o CreateMaterialsRequest) Clone() *CreateMaterialsRequest
func (CreateMaterialsRequest) MarshalJSON ¶
func (o CreateMaterialsRequest) MarshalJSON() ([]byte, error)
func (CreateMaterialsRequest) String ¶
func (o CreateMaterialsRequest) String() string
type DeleteRepresentativeBody ¶
type DeleteRepresentativeBody struct {
// 业务代理信息列表
RepresentativeInfoList []RepresentativeInfo `json:"representative_info_list"`
// 商户删除业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 删除时间
DeleteTime *string `json:"delete_time"`
}
DeleteRepresentativeBody
func (DeleteRepresentativeBody) Clone ¶
func (o DeleteRepresentativeBody) Clone() *DeleteRepresentativeBody
func (DeleteRepresentativeBody) MarshalJSON ¶
func (o DeleteRepresentativeBody) MarshalJSON() ([]byte, error)
func (DeleteRepresentativeBody) String ¶
func (o DeleteRepresentativeBody) String() string
type DeleteRepresentativeRequest ¶
type DeleteRepresentativeRequest struct {
// 零售小店活动ID
ActivityId *string `json:"activity_id"`
// 业务代理信息列表
RepresentativeInfoList []RepresentativeInfo `json:"representative_info_list"`
// 商户删除业务代理请求的唯一标识,商户需保证唯一。可包含英文字母,数字,\\|,\\_,\\*,\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 删除时间
DeleteTime *string `json:"delete_time"`
}
DeleteRepresentativeRequest
func (DeleteRepresentativeRequest) Clone ¶
func (o DeleteRepresentativeRequest) Clone() *DeleteRepresentativeRequest
func (DeleteRepresentativeRequest) MarshalJSON ¶
func (o DeleteRepresentativeRequest) MarshalJSON() ([]byte, error)
func (DeleteRepresentativeRequest) String ¶
func (o DeleteRepresentativeRequest) String() string
type DeleteRepresentativeResponse ¶
type DeleteRepresentativeResponse struct {
// 零售小店活动ID
ActivityId *string `json:"activity_id"`
// 删除失败业务代理信息列表
FailedRepresentativeInfoList []RepresentativeInfo `json:"failed_representative_info_list,omitempty"`
// 删除时间
DeleteTime *string `json:"delete_time"`
}
DeleteRepresentativeResponse
func (DeleteRepresentativeResponse) Clone ¶
func (o DeleteRepresentativeResponse) Clone() *DeleteRepresentativeResponse
func (DeleteRepresentativeResponse) MarshalJSON ¶
func (o DeleteRepresentativeResponse) MarshalJSON() ([]byte, error)
func (DeleteRepresentativeResponse) String ¶
func (o DeleteRepresentativeResponse) String() string
type DeleteStoresBody ¶
type DeleteStoresBody struct {
// 商户删除小店活动门店凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 删除时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
DeleteTime *string `json:"delete_time"`
// 待删除的小店活动门店列表
Stores []RetailStoreInfo `json:"stores"`
}
DeleteStoresBody
func (DeleteStoresBody) Clone ¶
func (o DeleteStoresBody) Clone() *DeleteStoresBody
func (DeleteStoresBody) MarshalJSON ¶
func (o DeleteStoresBody) MarshalJSON() ([]byte, error)
func (DeleteStoresBody) String ¶
func (o DeleteStoresBody) String() string
type DeleteStoresRequest ¶
type DeleteStoresRequest struct {
// 品牌ID
BrandId *string `json:"brand_id"`
// 商户删除小店活动门店凭据号,商户侧需保持唯一性。可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
OutRequestNo *string `json:"out_request_no"`
// 删除时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
DeleteTime *string `json:"delete_time"`
// 待删除的小店活动门店列表
Stores []RetailStoreInfo `json:"stores"`
}
DeleteStoresRequest
func (DeleteStoresRequest) Clone ¶
func (o DeleteStoresRequest) Clone() *DeleteStoresRequest
func (DeleteStoresRequest) MarshalJSON ¶
func (o DeleteStoresRequest) MarshalJSON() ([]byte, error)
func (DeleteStoresRequest) String ¶
func (o DeleteStoresRequest) String() string
type DeleteStoresResponse ¶
type DeleteStoresResponse struct {
// 删除时间,遵循rfc3339标准格式,格式为yyyy-MM-DDTHH:mm:ss+TIMEZONE,yyyy-MM-DD表示年月日,T出现在字符串中,表示time元素的开头,HH:mm:ss表示时分秒,TIMEZONE表示时区(+08:00表示东八区时间,领先UTC8小时,即北京时间)。例如:2015-05-20T13:29:35+08:00表示,北京时间2015年5月20日 13点29分35秒。
DeleteTime *string `json:"delete_time,omitempty"`
// 删除失败的小店活动门店列表
FailedStores []RetailStoreInfo `json:"failed_stores,omitempty"`
}
DeleteStoresResponse
func (DeleteStoresResponse) Clone ¶
func (o DeleteStoresResponse) Clone() *DeleteStoresResponse
func (DeleteStoresResponse) MarshalJSON ¶
func (o DeleteStoresResponse) MarshalJSON() ([]byte, error)
func (DeleteStoresResponse) String ¶
func (o DeleteStoresResponse) String() string
type FmcgAct ¶
type FmcgAct struct {
// 活动ID
ActivityId *string `json:"activity_id,omitempty"`
// 品牌ID
BrandId *string `json:"brand_id,omitempty"`
// 活动创建方商户号
CreatorMerchantId *string `json:"creator_merchant_id,omitempty"`
// 活动信息
ActivityInfo *ActInfo `json:"activity_info,omitempty"`
// 活动商品列表
GoodsInformation *GoodsInfo `json:"goods_information,omitempty"`
// 活动规则
RuleInformation *ActRule `json:"rule_information,omitempty"`
}
FmcgAct
func (FmcgAct) MarshalJSON ¶
type GetStoreRequest ¶
type GetStoreRequest struct {
// 品牌ID
BrandId *string `json:"brand_id"`
// 门店编码,可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
StoreCode *string `json:"store_code"`
}
GetStoreRequest
func (GetStoreRequest) Clone ¶
func (o GetStoreRequest) Clone() *GetStoreRequest
func (GetStoreRequest) MarshalJSON ¶
func (o GetStoreRequest) MarshalJSON() ([]byte, error)
func (GetStoreRequest) String ¶
func (o GetStoreRequest) String() string
type GoodsInfo ¶
type GoodsInfo struct {
// 商品ID
GoodsId *string `json:"goods_id,omitempty"`
// 商品名称
GoodsName *string `json:"goods_name,omitempty"`
// 商品图片URL
GoodsPictureUrl *string `json:"goods_picture_url,omitempty"`
}
GoodsInfo
func (GoodsInfo) MarshalJSON ¶
type ListActsByAreaRequest ¶
type ListActsByAreaRequest struct {
// 活动所属城市的ID
CityId *string `json:"city_id"`
// 非负整数,该次请求资源的起始位置,从0开始计数
Offset *int64 `json:"offset"`
// 非0非负的整数
Limit *int64 `json:"limit"`
}
ListActsByAreaRequest
func (ListActsByAreaRequest) Clone ¶
func (o ListActsByAreaRequest) Clone() *ListActsByAreaRequest
func (ListActsByAreaRequest) MarshalJSON ¶
func (o ListActsByAreaRequest) MarshalJSON() ([]byte, error)
func (ListActsByAreaRequest) String ¶
func (o ListActsByAreaRequest) String() string
type ListActsByAreaResponse ¶
type ListActsByAreaResponse struct {
// 活动总数
TotalCount *int64 `json:"total_count,omitempty"`
// 活动集合
Data []FmcgAct `json:"data,omitempty"`
// 非负整数,该次请求资源的起始位置,从0开始计数
Offset *int64 `json:"offset"`
// 非0非负的整数
Limit *int64 `json:"limit"`
}
ListActsByAreaResponse
func (ListActsByAreaResponse) Clone ¶
func (o ListActsByAreaResponse) Clone() *ListActsByAreaResponse
func (ListActsByAreaResponse) MarshalJSON ¶
func (o ListActsByAreaResponse) MarshalJSON() ([]byte, error)
func (ListActsByAreaResponse) String ¶
func (o ListActsByAreaResponse) String() string
type ListRepresentativeRequest ¶
type ListRepresentativeRequest struct {
// 零售小店活动ID
ActivityId *string `json:"activity_id"`
// 页码从0开始,默认第0页
Offset *int64 `json:"offset"`
// 分页大小,默认查询10个业代
Limit *int64 `json:"limit"`
}
ListRepresentativeRequest
func (ListRepresentativeRequest) Clone ¶
func (o ListRepresentativeRequest) Clone() *ListRepresentativeRequest
func (ListRepresentativeRequest) MarshalJSON ¶
func (o ListRepresentativeRequest) MarshalJSON() ([]byte, error)
func (ListRepresentativeRequest) String ¶
func (o ListRepresentativeRequest) String() string
type ListRepresentativeResponse ¶
type ListRepresentativeResponse struct {
// 小店活动业代总数
TotalCount *int64 `json:"total_count,omitempty"`
// 小店活动业代集合
Data []RepresentativeInfo `json:"data,omitempty"`
// 页码从0开始,默认第0页
Offset *int64 `json:"offset"`
// 分页大小
Limit *int64 `json:"limit"`
}
ListRepresentativeResponse
func (ListRepresentativeResponse) Clone ¶
func (o ListRepresentativeResponse) Clone() *ListRepresentativeResponse
func (ListRepresentativeResponse) MarshalJSON ¶
func (o ListRepresentativeResponse) MarshalJSON() ([]byte, error)
func (ListRepresentativeResponse) String ¶
func (o ListRepresentativeResponse) String() string
type ListStoreRequest ¶
type ListStoreRequest struct {
// 品牌ID
BrandId *string `json:"brand_id"`
// 页码从0开始,默认第0页
Offset *int64 `json:"offset"`
// 分页大小,默认查询10家门店
Limit *int64 `json:"limit"`
}
ListStoreRequest
func (ListStoreRequest) Clone ¶
func (o ListStoreRequest) Clone() *ListStoreRequest
func (ListStoreRequest) MarshalJSON ¶
func (o ListStoreRequest) MarshalJSON() ([]byte, error)
func (ListStoreRequest) String ¶
func (o ListStoreRequest) String() string
type ListStoreResponse ¶
type ListStoreResponse struct {
// 小店活动门店总数
TotalCount *int64 `json:"total_count,omitempty"`
// 小店活动门店集合
Data []RetailStoreInfo `json:"data,omitempty"`
// 页码从0开始,默认第0页
Offset *int64 `json:"offset,omitempty"`
// 分页大小
Limit *int64 `json:"limit,omitempty"`
}
ListStoreResponse
func (ListStoreResponse) Clone ¶
func (o ListStoreResponse) Clone() *ListStoreResponse
func (ListStoreResponse) MarshalJSON ¶
func (o ListStoreResponse) MarshalJSON() ([]byte, error)
func (ListStoreResponse) String ¶
func (o ListStoreResponse) String() string
type LockQualificationRequest ¶
type LockQualificationRequest struct {
// 订单信息
OrderInformation *OrderInfo `json:"order_information"`
// 待锁定的加价购资格ID列表
QualificationIds []string `json:"qualification_ids,omitempty"`
}
LockQualificationRequest
func (LockQualificationRequest) Clone ¶
func (o LockQualificationRequest) Clone() *LockQualificationRequest
func (LockQualificationRequest) MarshalJSON ¶
func (o LockQualificationRequest) MarshalJSON() ([]byte, error)
func (LockQualificationRequest) String ¶
func (o LockQualificationRequest) String() string
type LockQualificationResponse ¶
type LockQualificationResponse struct {
// 返回结果文案
ReturnMessage *string `json:"return_message,omitempty"`
// 锁定成功的资格ID列表
SucceedQualificationIds []string `json:"succeed_qualification_ids,omitempty"`
// 锁定失败的资格ID列表
FailedQualificationIds []string `json:"failed_qualification_ids,omitempty"`
}
LockQualificationResponse
func (LockQualificationResponse) Clone ¶
func (o LockQualificationResponse) Clone() *LockQualificationResponse
func (LockQualificationResponse) MarshalJSON ¶
func (o LockQualificationResponse) MarshalJSON() ([]byte, error)
func (LockQualificationResponse) String ¶
func (o LockQualificationResponse) String() string
type MaterialInfo ¶
type MaterialInfo struct {
// 物料码ID
MaterialId *string `json:"material_id,omitempty"`
// 物料码链接, 用于生成活动物料二维码
MaterialUrl *string `json:"material_url,omitempty"`
}
MaterialInfo
func (MaterialInfo) Clone ¶
func (o MaterialInfo) Clone() *MaterialInfo
func (MaterialInfo) MarshalJSON ¶
func (o MaterialInfo) MarshalJSON() ([]byte, error)
func (MaterialInfo) String ¶
func (o MaterialInfo) String() string
type Materials ¶
type Materials struct {
// 成功的物料码列表
MaterialList []MaterialInfo `json:"material_list,omitempty"`
}
Materials
func (Materials) MarshalJSON ¶
type OrderInfo ¶
type OrderInfo struct {
// 支付订单的微信用户OpenID
PayerOpenid *string `json:"payer_openid"`
// 商户订单号
OutTradeNo *string `json:"out_trade_no"`
// 订单总金额(单位:分)
TotalFee *int64 `json:"total_fee"`
// 门店ID
StoreId *string `json:"store_id"`
// 门店商户号
StoreMerchantId *string `json:"store_merchant_id"`
}
OrderInfo
func (OrderInfo) MarshalJSON ¶
type QualificationApiService ¶
func (*QualificationApiService) LockQualification ¶
func (a *QualificationApiService) LockQualification(ctx context.Context, req LockQualificationRequest) (resp *LockQualificationResponse, result *core.APIResult, err error)
LockQualification 锁定品牌加价购活动资格
接口介绍:指定服务商仅能通过该接口锁定品牌加价购活动资格。品牌加价购活动资格被成功锁定后不能被其它订单使用,且成功锁定品牌加价购活动资格是微信支付系统对门店和服务商发放补贴资金的前置条件,否则微信支付系统不对门店和服务商发放补贴资金。品牌加价购活动资格被锁定后,如未被解锁,则不能被其它订单使用。 使用对象:指定服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.QualificationApiService{Client: client}
resp, result, err := svc.LockQualification(ctx,
retailstore.LockQualificationRequest{
OrderInformation: &retailstore.OrderInfo{
PayerOpenid: core.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"),
OutTradeNo: core.String("1217752501201407033233368018"),
TotalFee: core.Int64(100),
StoreId: core.String("123"),
StoreMerchantId: core.String("1230000109"),
},
QualificationIds: []string{"8495134018"},
},
)
if err != nil {
// 处理错误
log.Printf("call LockQualification err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*QualificationApiService) UnlockQualification ¶
func (a *QualificationApiService) UnlockQualification(ctx context.Context, req UnlockQualificationRequest) (resp *UnlockQualificationResponse, result *core.APIResult, err error)
UnlockQualification 解锁品牌加价购活动资格
接口介绍:指定服务商仅能通过该接口解锁品牌加价购活动资格。商户调用微信支付下单接口失败或者在其它交易流程被阻断的场景下,如果此时品牌加价购活动资格已被当前订单锁定,需调用该接口解锁被锁定的品牌加价购活动资格,否则,如果被锁定的品牌加价购活动资格未被成功解锁,该品牌加价购活动资格无法被使用。 使用对象:指定服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.QualificationApiService{Client: client}
resp, result, err := svc.UnlockQualification(ctx,
retailstore.UnlockQualificationRequest{
OrderInformation: &retailstore.OrderInfo{
PayerOpenid: core.String("oUpF8uMuAJO_M2pxb1Q9zNjWeS6o"),
OutTradeNo: core.String("1217752501201407033233368018"),
TotalFee: core.Int64(100),
StoreId: core.String("123"),
StoreMerchantId: core.String("1230000109"),
},
QualificationIds: []string{"8495134018"},
},
)
if err != nil {
// 处理错误
log.Printf("call UnlockQualification err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
type RepresentativeInfo ¶
type RepresentativeInfo struct {
// [获取openid请查看文档](https://pay.weixin.qq.com/wiki/doc/apiv3_partner/terms_definition/chapter1_1_3.shtml)
Openid *string `json:"openid"`
}
RepresentativeInfo
func (RepresentativeInfo) Clone ¶
func (o RepresentativeInfo) Clone() *RepresentativeInfo
func (RepresentativeInfo) MarshalJSON ¶
func (o RepresentativeInfo) MarshalJSON() ([]byte, error)
func (RepresentativeInfo) String ¶
func (o RepresentativeInfo) String() string
type RetailStoreActApiService ¶
func (*RetailStoreActApiService) AddRepresentative ¶
func (a *RetailStoreActApiService) AddRepresentative(ctx context.Context, req AddRepresentativeRequest) (resp *AddRepresentativesResponse, result *core.APIResult, err error)
AddRepresentative 添加零售小店活动业务代理
该接口为服务商或商户给零售小店活动添加业务代理的专用接口。 使用对象:活动创建方商户号、活动归属品牌的品牌主商户号或品牌经营商户号。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.AddRepresentative(ctx,
retailstore.AddRepresentativeRequest{
ActivityId: core.String("3118550000000004"),
RepresentativeInfoList: []retailstore.RepresentativeInfo{retailstore.RepresentativeInfo{
Openid: core.String("oK7fFt8zzEZ909XH-LE2#"),
}},
OutRequestNo: core.String("1002600620019090123143254436"),
AddTime: core.String("2015-05-20T13:29:35+08:00"),
},
)
if err != nil {
// 处理错误
log.Printf("call AddRepresentative err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) AddStores ¶
func (a *RetailStoreActApiService) AddStores(ctx context.Context, req AddStoresRequest) (resp *AddStoresResponse, result *core.APIResult, err error)
AddStores 添加小店活动门店
该接口为服务商或商户给零售小店活动添加门店专用接口。 使用对象:品牌的品牌主商户号或品牌服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.AddStores(ctx,
retailstore.AddStoresRequest{
BrandId: core.String("1001"),
OutRequestNo: core.String("1002600620019090123143254436"),
AddTime: core.String("2015-05-20T13:29:35+08:00"),
Stores: []retailstore.RetailStoreInfo{retailstore.RetailStoreInfo{
StoreCode: core.String("abc_001"),
StoreName: core.String("幸福小店"),
}},
},
)
if err != nil {
// 处理错误
log.Printf("call AddStores err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) CreateMaterials ¶
func (a *RetailStoreActApiService) CreateMaterials(ctx context.Context, req CreateMaterialsRequest) (resp *Materials, result *core.APIResult, err error)
CreateMaterials 生成小店活动物料码
该接口为服务商或商户给零售小店活动申请物料码专用接口。 使用对象:品牌的品牌主商户号或品牌服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.CreateMaterials(ctx,
retailstore.CreateMaterialsRequest{
BrandId: core.String("1001"),
OutRequestNo: core.String("1002600620019090123143254436"),
MaterialNum: core.Int64(100),
},
)
if err != nil {
// 处理错误
log.Printf("call CreateMaterials err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) DeleteRepresentative ¶
func (a *RetailStoreActApiService) DeleteRepresentative(ctx context.Context, req DeleteRepresentativeRequest) (resp *DeleteRepresentativeResponse, result *core.APIResult, err error)
DeleteRepresentative 删除零售小店活动业务代理
该接口为服务商或商户给零售小店活动删除业务代理的专用接口。 使用对象:活动创建方商户号、活动归属品牌的品牌主商户号或品牌经营商户号。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.DeleteRepresentative(ctx,
retailstore.DeleteRepresentativeRequest{
ActivityId: core.String("3118550000000004"),
RepresentativeInfoList: []retailstore.RepresentativeInfo{retailstore.RepresentativeInfo{
Openid: core.String("oK7fFt8zzEZ909XH-LE2#"),
}},
OutRequestNo: core.String("1002600620019090123143254436"),
DeleteTime: core.String("2015-05-20T13:29:35.120+08:00"),
},
)
if err != nil {
// 处理错误
log.Printf("call DeleteRepresentative err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) DeleteStores ¶
func (a *RetailStoreActApiService) DeleteStores(ctx context.Context, req DeleteStoresRequest) (resp *DeleteStoresResponse, result *core.APIResult, err error)
DeleteStores 删除小店活动门店
该接口为服务商或商户给零售小店活动删除门店专用接口。 使用对象:品牌的品牌主商户号或品牌服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.DeleteStores(ctx,
retailstore.DeleteStoresRequest{
BrandId: core.String("1001"),
OutRequestNo: core.String("1002600620019090123143254436"),
DeleteTime: core.String("2015-05-20T13:29:35+08:00"),
Stores: []retailstore.RetailStoreInfo{retailstore.RetailStoreInfo{
StoreCode: core.String("abc_001"),
StoreName: core.String("幸福小店"),
}},
},
)
if err != nil {
// 处理错误
log.Printf("call DeleteStores err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) GetStore ¶
func (a *RetailStoreActApiService) GetStore(ctx context.Context, req GetStoreRequest) (resp *RetailStoreInfo, result *core.APIResult, err error)
GetStore 查询小店活动门店详情
该接口为服务商或商户给零售小店活动查询门店详情专用接口。 使用对象:品牌的品牌主商户号或品牌服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.GetStore(ctx,
retailstore.GetStoreRequest{
BrandId: core.String("1001"),
StoreCode: core.String("abc_001"),
},
)
if err != nil {
// 处理错误
log.Printf("call GetStore err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) ListRepresentative ¶
func (a *RetailStoreActApiService) ListRepresentative(ctx context.Context, req ListRepresentativeRequest) (resp *ListRepresentativeResponse, result *core.APIResult, err error)
ListRepresentative 查询零售小店活动业务代理
该接口为服务商或商户给零售小店活动查询业务代理的专用接口。 使用对象:活动创建方商户号、活动归属品牌的品牌主商户号或品牌经营商户号。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.ListRepresentative(ctx,
retailstore.ListRepresentativeRequest{
ActivityId: core.String("3118550000000004"),
Offset: core.Int64(0),
Limit: core.Int64(10),
},
)
if err != nil {
// 处理错误
log.Printf("call ListRepresentative err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
func (*RetailStoreActApiService) ListStore ¶
func (a *RetailStoreActApiService) ListStore(ctx context.Context, req ListStoreRequest) (resp *ListStoreResponse, result *core.APIResult, err error)
ListStore 查询小店活动门店列表
该接口为服务商或商户给零售小店活动查询门店列表专用接口。 使用对象:品牌的品牌主商户号或品牌服务商。
Example ¶
package main
import (
"context"
"log"
"git.nanodreamtech.com/sg/wechatpay-go/core"
"git.nanodreamtech.com/sg/wechatpay-go/core/option"
"git.nanodreamtech.com/sg/wechatpay-go/services/retailstore"
"git.nanodreamtech.com/sg/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.RetailStoreActApiService{Client: client}
resp, result, err := svc.ListStore(ctx,
retailstore.ListStoreRequest{
BrandId: core.String("1001"),
Offset: core.Int64(0),
Limit: core.Int64(10),
},
)
if err != nil {
// 处理错误
log.Printf("call ListStore err:%s", err)
} else {
// 处理返回结果
log.Printf("status=%d resp=%s", result.Response.StatusCode, resp)
}
}
type RetailStoreInfo ¶
type RetailStoreInfo struct {
// 门店编码,可包含英文字母,数字,\\\\|,\\\\_,\\\\*,\\\\-等内容,不允许出现其他不合法符号。
StoreCode *string `json:"store_code,omitempty"`
// 门店名称
StoreName *string `json:"store_name,omitempty"`
}
RetailStoreInfo
func (RetailStoreInfo) Clone ¶
func (o RetailStoreInfo) Clone() *RetailStoreInfo
func (RetailStoreInfo) MarshalJSON ¶
func (o RetailStoreInfo) MarshalJSON() ([]byte, error)
func (RetailStoreInfo) String ¶
func (o RetailStoreInfo) String() string
type StoreInfo ¶
type StoreInfo struct {
// 门店ID
StoreId *string `json:"store_id"`
// 门店指定的品牌补贴收款商户号
AccountingMerchantId *string `json:"accounting_merchant_id"`
// 报名门店的商户号,即门店收款商户号
MerchantId *string `json:"merchant_id"`
}
StoreInfo
func (StoreInfo) MarshalJSON ¶
type UnlockQualificationRequest ¶
type UnlockQualificationRequest struct {
// 订单信息
OrderInformation *OrderInfo `json:"order_information"`
// 待锁定的加价购资格ID列表
QualificationIds []string `json:"qualification_ids,omitempty"`
}
UnlockQualificationRequest
func (UnlockQualificationRequest) Clone ¶
func (o UnlockQualificationRequest) Clone() *UnlockQualificationRequest
func (UnlockQualificationRequest) MarshalJSON ¶
func (o UnlockQualificationRequest) MarshalJSON() ([]byte, error)
func (UnlockQualificationRequest) String ¶
func (o UnlockQualificationRequest) String() string
type UnlockQualificationResponse ¶
type UnlockQualificationResponse struct {
// 返回结果文案
ReturnMessage *string `json:"return_message,omitempty"`
// 解锁成功的资格列表
SucceedQualificationIds []string `json:"succeed_qualification_ids,omitempty"`
// 解锁失败的资格ID列表
FailedQualificationIds []string `json:"failed_qualification_ids,omitempty"`
}
UnlockQualificationResponse
func (UnlockQualificationResponse) Clone ¶
func (o UnlockQualificationResponse) Clone() *UnlockQualificationResponse
func (UnlockQualificationResponse) MarshalJSON ¶
func (o UnlockQualificationResponse) MarshalJSON() ([]byte, error)
func (UnlockQualificationResponse) String ¶
func (o UnlockQualificationResponse) String() string