Help us shape the future of Go! Take the 2026 Go Developer Survey

message

package
v2.1.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 20, 2026 License: Apache-2.0 Imports: 12 Imported by: 5

Documentation

Index

Constants

View Source
const (
	// MsgTypeText 文本消息
	MsgTypeText MsgType = "text"
	// MsgTypeImage 图片消息
	MsgTypeImage = "image"
	// MsgTypeLink 图文链接
	MsgTypeLink = "link"
	// MsgTypeMiniProgramPage 小程序卡片
	MsgTypeMiniProgramPage = "miniprogrampage"
	// MsgTypeEvent 事件
	MsgTypeEvent MsgType = "event"
	// DataTypeXML XML 格式数据
	DataTypeXML = "xml"
	// DataTypeJSON JSON 格式数据
	DataTypeJSON = "json"
)
View Source
const (
	// EventTypeTradeManageRemindAccessAPI 提醒接入发货信息管理服务 API
	// 小程序完成账期授权时/小程序产生第一笔交易时/已产生交易但从未发货的小程序,每天一次
	EventTypeTradeManageRemindAccessAPI EventType = "trade_manage_remind_access_api"
	// EventTypeTradeManageRemindShipping 提醒需要上传发货信息
	// 曾经发过货的小程序,订单超过 48 小时未发货时
	EventTypeTradeManageRemindShipping EventType = "trade_manage_remind_shipping"
	// EventTypeTradeManageOrderSettlement 订单将要结算或已经结算
	// 订单完成发货时/订单结算时
	EventTypeTradeManageOrderSettlement EventType = "trade_manage_order_settlement"
	// EventTypeAddExpressPath 运单轨迹更新事件
	EventTypeAddExpressPath EventType = "add_express_path"
	// EventTypeSecvodUpload 短剧媒资上传完成事件
	EventTypeSecvodUpload EventType = "secvod_upload_event"
	// EventTypeSecvodAudit 短剧媒资审核状态事件
	EventTypeSecvodAudit EventType = "secvod_audit_event"
	// EventTypeWxaMediaCheck 媒体内容安全异步审查结果通知
	EventTypeWxaMediaCheck EventType = "wxa_media_check"
	// EventTypeXpayGoodsDeliverNotify 道具发货推送事件
	EventTypeXpayGoodsDeliverNotify EventType = "xpay_goods_deliver_notify"
	// EventTypeXpayCoinPayNotify 代币支付推送事件
	EventTypeXpayCoinPayNotify EventType = "xpay_coin_pay_notify"
	// EventTypeXpayRefundNotify 退款推送事件
	EventTypeXpayRefundNotify EventType = "xpay_refund_notify"
	// EventTypeXpaySubscribeIosRefundQueryNotify iOS Apple 支付退款问询事件
	EventTypeXpaySubscribeIosRefundQueryNotify EventType = "xpay_subscribe_ios_refund_query_notify"
	// EventTypeXpayComplaintNotify 用户投诉推送事件
	EventTypeXpayComplaintNotify EventType = "xpay_complaint_notify"
	// EventSubscribePopup 用户操作订阅通知弹窗事件推送,用户在图文等场景内订阅通知的操作
	EventSubscribePopup EventType = "subscribe_msg_popup_event"
	// EventSubscribeMsgChange 用户管理订阅通知,用户在服务通知管理页面做通知管理时的操作
	EventSubscribeMsgChange EventType = "subscribe_msg_change_event"
	// EventSubscribeMsgSent 发送订阅通知,调用 bizsend 接口发送通知
	EventSubscribeMsgSent EventType = "subscribe_msg_sent_event"
	// ConfirmReceiveMethodAuto 自动确认收货
	ConfirmReceiveMethodAuto ConfirmReceiveMethod = 1
	// ConfirmReceiveMethodManual 手动确认收货
	ConfirmReceiveMethodManual ConfirmReceiveMethod = 2
)

Variables

View Source
var ErrInvalidReply = errors.New("无效的回复信息")

ErrInvalidReply 无效的回复

View Source
var ErrUnsupportedReply = errors.New("不支持的回复消息")

ErrUnsupportedReply 不支持的回复类型

Functions

This section is empty.

Types

type CoinInfo added in v2.1.6

type CoinInfo struct {
	Quantity    int    `json:"Quantity" xml:"Quantity"`       // 数量
	OrigPrice   int64  `json:"OrigPrice" xml:"OrigPrice"`     // 物品原始价格(单位:分)
	ActualPrice int64  `json:"ActualPrice" xml:"ActualPrice"` // 物品实际支付价格(单位:分)
	Attach      string `json:"Attach" xml:"Attach"`           // 透传信息
}

CoinInfo 代币参数信息

type CommonPushData added in v2.1.6

type CommonPushData struct {
	XMLName      xml.Name  `json:"-" xml:"xml"`
	MsgType      MsgType   `json:"MsgType" xml:"MsgType"`           // 消息类型,为固定值 "event"
	Event        EventType `json:"Event" xml:"Event"`               // 事件类型
	ToUserName   string    `json:"ToUserName" xml:"ToUserName"`     // 小程序的原始 ID
	FromUserName string    `json:"FromUserName" xml:"FromUserName"` // 发送方账号(一个 OpenID,此时发送方是系统账号)
	CreateTime   int64     `json:"CreateTime" xml:"CreateTime"`     // 消息创建时间(整型),时间戳
}

CommonPushData 推送数据通用部分

type CommonToken

type CommonToken struct {
	XMLName      xml.Name `xml:"xml"`
	ToUserName   string   `xml:"ToUserName"`
	FromUserName string   `xml:"FromUserName"`
	CreateTime   int64    `xml:"CreateTime"`
	MsgType      MsgType  `xml:"MsgType"`
}

CommonToken 消息中通用的结构

type ConfirmReceiveMethod added in v2.1.6

type ConfirmReceiveMethod int8

ConfirmReceiveMethod 确认收货方式

type CreateActivityIDRequest added in v2.1.9

type CreateActivityIDRequest struct {
	UnionID string
	OpenID  string
}

CreateActivityIDRequest 创建activity_id请求

type CreateActivityIDResponse added in v2.1.7

type CreateActivityIDResponse struct {
	util.CommonError

	ActivityID     string `json:"activity_id"`
	ExpirationTime int64  `json:"expiration_time"`
}

CreateActivityIDResponse 创建activity_id 返回

type CustomerMessage

type CustomerMessage struct {
	ToUser          string                `json:"touser"`                    // 接受者 OpenID
	Msgtype         MsgType               `json:"msgtype"`                   // 客服消息类型
	Text            *MediaText            `json:"text,omitempty"`            // 可选
	Image           *MediaResource        `json:"image,omitempty"`           // 可选
	Link            *MediaLink            `json:"link,omitempty"`            // 可选
	Miniprogrampage *MediaMiniprogrampage `json:"miniprogrampage,omitempty"` // 可选
}

CustomerMessage 客服消息

func NewCustomerImgMessage

func NewCustomerImgMessage(toUser, mediaID string) *CustomerMessage

NewCustomerImgMessage 图片消息的构造方法

func NewCustomerLinkMessage

func NewCustomerLinkMessage(toUser, title, description, url, thumbURL string) *CustomerMessage

NewCustomerLinkMessage 图文链接消息的构造方法

func NewCustomerMiniprogrampageMessage

func NewCustomerMiniprogrampageMessage(toUser, title, pagepath, thumbMediaID string) *CustomerMessage

NewCustomerMiniprogrampageMessage 小程序卡片消息的构造方法

func NewCustomerTextMessage

func NewCustomerTextMessage(toUser, text string) *CustomerMessage

NewCustomerTextMessage 文本消息结构体构造方法

type DataReceived added in v2.1.6

type DataReceived struct {
	Encrypt string `json:"Encrypt" xml:"Encrypt"` // 加密的消息体
}

DataReceived 接收到的数据

type DramaAuditDetail added in v2.1.6

type DramaAuditDetail struct {
	Status     int   `json:"status" xml:"status"`           // 审核状态,0 为无效值;1 为审核中;2 为最终失败;3 为审核通过;4 为驳回重填
	CreateTime int64 `json:"create_time" xml:"create_time"` // 提审时间戳
	AuditTime  int64 `json:"audit_time" xml:"audit_time"`   // 审核时间戳
}

DramaAuditDetail 剧目审核结果

type EventType

type EventType string

EventType 事件类型

type GoodsInfo added in v2.1.6

type GoodsInfo struct {
	ProductID   string `json:"ProductId" xml:"ProductId"`     // 道具 ID
	Quantity    int    `json:"Quantity" xml:"Quantity"`       // 数量
	OrigPrice   int64  `json:"OrigPrice" xml:"OrigPrice"`     // 物品原始价格(单位:分)
	ActualPrice int64  `json:"ActualPrice" xml:"ActualPrice"` // 物品实际支付价格(单位:分)
	Attach      string `json:"Attach" xml:"Attach"`           // 透传信息
}

GoodsInfo 道具参数信息

type InfoType

type InfoType string

InfoType 第三方平台授权事件类型

const (
	// InfoTypeAcceptSubscribeMessage 接受订阅通知
	InfoTypeAcceptSubscribeMessage InfoType = "accept"
	// InfoTypeRejectSubscribeMessage 拒绝订阅通知
	InfoTypeRejectSubscribeMessage InfoType = "reject"
)

type IosRefundQueryResponse added in v2.1.14

type IosRefundQueryResponse struct {
	ResultCode int32  `json:"result_code" xml:"result_code"` // 结果码,0-放过,建议退款;1-拦截,拒绝退款
	ResultInfo string `json:"result_info" xml:"result_info"` // 结果描述
	Evidence   string `json:"evidence" xml:"evidence"`       // 决策凭据,必填,用于退款审计
}

IosRefundQueryResponse iOS Apple 支付退款问询应答

type Manager

type Manager struct {
	*context.Context
}

Manager 消息管理者,可以发送消息

func NewCustomerMessageManager

func NewCustomerMessageManager(context *context.Context) *Manager

NewCustomerMessageManager 实例化消息管理者

func (*Manager) Send

func (manager *Manager) Send(msg *CustomerMessage) error

Send 发送客服消息

type MediaCheckAsyncData added in v2.1.6

type MediaCheckAsyncData struct {
	CommonPushData
	Appid   string                `json:"appid" xml:"appid"`
	TraceID string                `json:"trace_id" xml:"trace_id"`
	Version int                   `json:"version" xml:"version"`
	Detail  []*MediaCheckDetail   `json:"detail" xml:"detail"`
	Errcode int                   `json:"errcode" xml:"errcode"`
	Errmsg  string                `json:"errmsg" xml:"errmsg"`
	Result  MediaCheckAsyncResult `json:"result" xml:"result"`
}

MediaCheckAsyncData 媒体内容安全异步审查结果通知

type MediaCheckAsyncResult added in v2.1.6

type MediaCheckAsyncResult struct {
	Suggest security.CheckSuggest `json:"suggest" xml:"suggest"`
	Label   security.CheckLabel   `json:"label" xml:"label"`
}

MediaCheckAsyncResult 检测结果

type MediaCheckDetail added in v2.1.6

type MediaCheckDetail struct {
	Strategy string                `json:"strategy" xml:"strategy"`
	Errcode  int                   `json:"errcode" xml:"errcode"`
	Suggest  security.CheckSuggest `json:"suggest" xml:"suggest"`
	Label    int                   `json:"label" xml:"label"`
	Prob     int                   `json:"prob" xml:"prob"`
}

MediaCheckDetail 检测结果详情

type MediaLink struct {
	Title       string `json:"title"`
	Description string `json:"description"`
	URL         string `json:"url"`
	ThumbURL    string `json:"thumb_url"`
}

MediaLink 发送图文链接

type MediaMiniprogrampage

type MediaMiniprogrampage struct {
	Title        string `json:"title"`
	Appid        string `json:"appid"`
	Pagepath     string `json:"pagepath"`
	ThumbMediaID string `json:"thumb_media_id"`
}

MediaMiniprogrampage 小程序卡片

type MediaResource

type MediaResource struct {
	MediaID string `json:"media_id"`
}

MediaResource 消息使用的临时素材 id

type MediaText

type MediaText struct {
	Content string `json:"content"`
}

MediaText 文本消息的文字

type MiniProgramMixMessage

type MiniProgramMixMessage struct {
	CommonToken

	MsgID int64 `xml:"MsgId"`

	// 文本消息
	Content string `xml:"Content"`

	// 图片消息
	PicURL  string `xml:"PicUrl"`
	MediaID string `xml:"MediaId"`

	// 小程序卡片消息
	Title        string `xml:"Title"`
	AppID        string `xml:"AppId"`
	PagePath     string `xml:"PagePath"`
	ThumbURL     string `xml:"ThumbUrl"`
	ThumbMediaID string `xml:"ThumbMediaId"`

	// 进入会话事件
	Event       string `xml:"Event"`
	SessionFrom string `xml:"SessionFrom"`
}

MiniProgramMixMessage 小程序回调的消息结构

type MsgType

type MsgType string

MsgType 基本消息类型

type ParticipatorInfo added in v2.1.9

type ParticipatorInfo struct {
	State       int    `json:"state"`
	GroupOpenID string `json:"group_openid"`
}

ParticipatorInfo 更新后的聊天室成员状态

type PushData added in v2.1.6

type PushData interface{}

PushData 推送的数据 (已转对应的结构体)

type PushDataAddExpressPath added in v2.1.6

type PushDataAddExpressPath struct {
	CommonPushData
	DeliveryID string                          `json:"DeliveryID" xml:"DeliveryID"` // 快递公司 ID
	WayBillID  string                          `json:"WaybillId" xml:"WaybillId"`   // 运单 ID
	OrderID    string                          `json:"OrderId" xml:"OrderId"`       // 订单 ID
	Version    int                             `json:"Version" xml:"Version"`       // 轨迹版本号(整型)
	Count      int                             `json:"Count" xml:"Count"`           // 轨迹节点数(整型)
	Actions    []*PushDataAddExpressPathAction `json:"Actions" xml:"Actions"`       // 轨迹节点列表
}

PushDataAddExpressPath 运单轨迹更新信息

type PushDataAddExpressPathAction added in v2.1.6

type PushDataAddExpressPathAction struct {
	ActionTime int64  `json:"ActionTime" xml:"ActionTime"` // 轨迹节点 Unix 时间戳
	ActionType int    `json:"ActionType" xml:"ActionType"` // 轨迹节点类型
	ActionMsg  string `json:"ActionMsg" xml:"ActionMsg"`   // 轨迹节点详情
}

PushDataAddExpressPathAction 轨迹节点

type PushDataOrderSettlement added in v2.1.6

type PushDataOrderSettlement struct {
	CommonPushData
	TransactionID           string               `json:"transaction_id" xml:"transaction_id"`                       // 支付订单号
	MerchantID              string               `json:"merchant_id" xml:"merchant_id"`                             // 商户号
	SubMerchantID           string               `json:"sub_merchant_id" xml:"sub_merchant_id"`                     // 子商户号
	MerchantTradeNo         string               `json:"merchant_trade_no" xml:"merchant_trade_no"`                 // 商户订单号
	PayTime                 int64                `json:"pay_time" xml:"pay_time"`                                   // 支付成功时间,秒级时间戳
	ShippedTime             int64                `json:"shipped_time" xml:"shipped_time"`                           // 发货时间,秒级时间戳
	EstimatedSettlementTime int64                `json:"estimated_settlement_time" xml:"estimated_settlement_time"` // 预计结算时间,秒级时间戳。发货时推送才有该字段
	ConfirmReceiveMethod    ConfirmReceiveMethod `json:"confirm_receive_method" xml:"confirm_receive_method"`       // 确认收货方式:1. 自动确认收货;2. 手动确认收货。结算时推送才有该字段
	ConfirmReceiveTime      int64                `json:"confirm_receive_time" xml:"confirm_receive_time"`           // 确认收货时间,秒级时间戳。结算时推送才有该字段
	SettlementTime          int64                `json:"settlement_time" xml:"settlement_time"`                     // 订单结算时间,秒级时间戳。结算时推送才有该字段
}

PushDataOrderSettlement 订单将要结算或已经结算通知

type PushDataRemindAccessAPI added in v2.1.6

type PushDataRemindAccessAPI struct {
	CommonPushData
	Msg string `json:"msg" xml:"msg"` // 消息文本内容
}

PushDataRemindAccessAPI 提醒接入发货信息管理服务 API 信息

type PushDataRemindShipping added in v2.1.6

type PushDataRemindShipping struct {
	CommonPushData
	TransactionID   string `json:"transaction_id" xml:"transaction_id"`       // 微信支付订单号
	MerchantID      string `json:"merchant_id" xml:"merchant_id"`             // 商户号
	SubMerchantID   string `json:"sub_merchant_id" xml:"sub_merchant_id"`     // 子商户号
	MerchantTradeNo string `json:"merchant_trade_no" xml:"merchant_trade_no"` // 商户订单号
	PayTime         int64  `json:"pay_time" xml:"pay_time"`                   // 支付成功时间,秒级时间戳
	Msg             string `json:"msg" xml:"msg"`                             // 消息文本内容
}

PushDataRemindShipping 提醒需要上传发货信息

type PushDataSecVodAudit added in v2.1.6

type PushDataSecVodAudit struct {
	CommonPushData
	AuditEvent SecVodAuditEvent `json:"audit_event" xml:"audit_event"` // 审核状态事件
}

PushDataSecVodAudit 短剧媒资审核状态

type PushDataSecVodUpload added in v2.1.6

type PushDataSecVodUpload struct {
	CommonPushData
	UploadEvent SecVodUploadEvent `json:"upload_event" xml:"upload_event"` // 上传完成事件
}

PushDataSecVodUpload 短剧媒资上传完成

type PushDataSubscribeMsgChange added in v2.1.6

type PushDataSubscribeMsgChange struct {
	CommonPushData
	SubscribeMsgChangeEvent SubscribeMsgChangeEvent `xml:"SubscribeMsgChangeEvent"`
	// contains filtered or unexported fields
}

PushDataSubscribeMsgChange 用户管理订阅通知事件推送

func (*PushDataSubscribeMsgChange) GetSubscribeMsgChangeEvents added in v2.1.6

func (s *PushDataSubscribeMsgChange) GetSubscribeMsgChangeEvents() []SubscribeMsgChangeList

GetSubscribeMsgChangeEvents 获取订阅消息事件数据

func (*PushDataSubscribeMsgChange) SetSubscribeMsgChangeEvents added in v2.1.6

func (s *PushDataSubscribeMsgChange) SetSubscribeMsgChangeEvents(list []SubscribeMsgChangeList)

SetSubscribeMsgChangeEvents 设置订阅消息事件

type PushDataSubscribeMsgSent added in v2.1.6

type PushDataSubscribeMsgSent struct {
	CommonPushData
	SubscribeMsgSentEvent SubscribeMsgSentEvent `xml:"SubscribeMsgSentEvent"`
	// contains filtered or unexported fields
}

PushDataSubscribeMsgSent 用户发送订阅通知事件推送

func (*PushDataSubscribeMsgSent) GetSubscribeMsgSentEvents added in v2.1.6

func (s *PushDataSubscribeMsgSent) GetSubscribeMsgSentEvents() []SubscribeMsgSentList

GetSubscribeMsgSentEvents 获取订阅消息事件数据

func (*PushDataSubscribeMsgSent) SetSubscribeMsgSentEvents added in v2.1.6

func (s *PushDataSubscribeMsgSent) SetSubscribeMsgSentEvents(list []SubscribeMsgSentList)

SetSubscribeMsgSentEvents 设置订阅消息事件

type PushDataSubscribePopup added in v2.1.6

type PushDataSubscribePopup struct {
	CommonPushData

	SubscribeMsgPopupEvent SubscribeMsgPopupEvent `xml:"SubscribeMsgPopupEvent"`
	// contains filtered or unexported fields
}

PushDataSubscribePopup 用户操作订阅通知弹窗事件推送

func (*PushDataSubscribePopup) GetSubscribeMsgPopupEvents added in v2.1.6

func (s *PushDataSubscribePopup) GetSubscribeMsgPopupEvents() []SubscribeMsgPopupEventList

GetSubscribeMsgPopupEvents 获取订阅消息事件数据

func (*PushDataSubscribePopup) SetSubscribeMsgPopupEvents added in v2.1.6

func (s *PushDataSubscribePopup) SetSubscribeMsgPopupEvents(list []SubscribeMsgPopupEventList)

SetSubscribeMsgPopupEvents 设置订阅消息事件

type PushDataXpayCoinPayNotify added in v2.1.6

type PushDataXpayCoinPayNotify struct {
	CommonPushData
	OpenID        string        `json:"OpenId" xml:"OpenId"`               // 用户 openid
	OutTradeNo    string        `json:"OutTradeNo" xml:"OutTradeNo"`       // 业务订单号
	Env           int           `json:"Env" xml:"Env"`                     // ,环境配置 0:现网环境(也叫正式环境)1:沙箱环境
	WeChatPayInfo WeChatPayInfo `json:"WeChatPayInfo" xml:"WeChatPayInfo"` // 微信支付信息 非微信支付渠道可能没有
	CoinInfo      CoinInfo      `json:"CoinInfo" xml:"CoinInfo"`           // 代币参数信息
}

PushDataXpayCoinPayNotify 代币支付推送

type PushDataXpayComplaintNotify added in v2.1.14

type PushDataXpayComplaintNotify struct {
	CommonPushData
	OpenID          string `json:"OpenId" xml:"OpenId"`                   // 用户 openid
	WxOrderID       string `json:"WxOrderId" xml:"WxOrderId"`             // 微信单号
	MchOrderID      string `json:"MchOrderId" xml:"MchOrderId"`           // 商户单号
	TransactionID   string `json:"TransactionId" xml:"TransactionId"`     // 微信支付交易单号
	ComplaintID     string `json:"ComplaintId" xml:"ComplaintId"`         // 投诉单号
	ComplaintDetail string `json:"ComplaintDetail" xml:"ComplaintDetail"` // 投诉详情
	ComplaintTime   int64  `json:"ComplaintTime" xml:"ComplaintTime"`     // 投诉时间,秒级时间戳
	RetryTimes      int    `json:"RetryTimes" xml:"RetryTimes"`           // 重试次数,从 0 开始
	RequestID       string `json:"RequestId" xml:"RequestId"`             // 请求编号
}

PushDataXpayComplaintNotify 用户投诉推送

type PushDataXpayGoodsDeliverNotify added in v2.1.6

type PushDataXpayGoodsDeliverNotify struct {
	CommonPushData
	OpenID        string        `json:"OpenId" xml:"OpenId"`               // 用户 openid
	OutTradeNo    string        `json:"OutTradeNo" xml:"OutTradeNo"`       // 业务订单号
	Env           int           `json:"Env" xml:"Env"`                     // ,环境配置 0:现网环境(也叫正式环境)1:沙箱环境
	WeChatPayInfo WeChatPayInfo `json:"WeChatPayInfo" xml:"WeChatPayInfo"` // 微信支付信息 非微信支付渠道可能没有
	GoodsInfo     GoodsInfo     `json:"GoodsInfo" xml:"GoodsInfo"`         // 道具参数信息
	TeamInfo      XpayTeamInfo  `json:"TeamInfo" xml:"TeamInfo"`           // 拼团信息
}

PushDataXpayGoodsDeliverNotify 道具发货推送

type PushDataXpayRefundNotify added in v2.1.14

type PushDataXpayRefundNotify struct {
	CommonPushData
	OpenID                   string       `json:"OpenId" xml:"OpenId"`                                     // 用户 openid
	WxRefundID               string       `json:"WxRefundId" xml:"WxRefundId"`                             // 微信退款单号
	MchRefundID              string       `json:"MchRefundId" xml:"MchRefundId"`                           // 商户退款单号
	WxOrderID                string       `json:"WxOrderId" xml:"WxOrderId"`                               // 退款单对应支付单的微信单号
	MchOrderID               string       `json:"MchOrderId" xml:"MchOrderId"`                             // 退款单对应支付单的商户单号
	RefundFee                int          `json:"RefundFee" xml:"RefundFee"`                               // 退款金额,单位分
	RetCode                  int          `json:"RetCode" xml:"RetCode"`                                   // 退款结果,0 为成功
	RetMsg                   string       `json:"RetMsg" xml:"RetMsg"`                                     // 退款结果详情
	RefundStartTimestamp     int64        `json:"RefundStartTimestamp" xml:"RefundStartTimestamp"`         // 开始退款时间,秒级时间戳
	RefundSuccTimestamp      int64        `json:"RefundSuccTimestamp" xml:"RefundSuccTimestamp"`           // 结束退款时间,秒级时间戳
	WxpayRefundTransactionID string       `json:"WxpayRefundTransactionId" xml:"WxpayRefundTransactionId"` // 退款单的微信支付单号
	RetryTimes               int          `json:"RetryTimes" xml:"RetryTimes"`                             // 重试次数,从 0 开始
	TeamInfo                 XpayTeamInfo `json:"TeamInfo" xml:"TeamInfo"`                                 // 拼团信息
}

PushDataXpayRefundNotify 退款推送

type PushDataXpaySubscribeIosRefundQueryNotify added in v2.1.14

type PushDataXpaySubscribeIosRefundQueryNotify struct {
	CommonPushData
	RefundTime          string `json:"refund_time" xml:"refund_time"`                     // 问询时间,Unix 时间戳
	OrderTime           string `json:"order_time" xml:"order_time"`                       // 该笔退款的订单时间,Unix 时间戳
	ChannelBill         string `json:"channel_bill" xml:"channel_bill"`                   // Apple 支付票据号
	BundleID            string `json:"bundleid" xml:"bundleid"`                           // 应用的 Apple bundleid
	ProductID           string `json:"product_id" xml:"product_id"`                       // 道具 id
	PCount              string `json:"p_count" xml:"p_count"`                             // 道具/代币数量
	RefundRequestReason string `json:"refund_request_reason" xml:"refund_request_reason"` // 用户请求退款的原因
	ProvideStatus       string `json:"provide_status" xml:"provide_status"`               // 发货状态,0:未发货 1:已发货 2:发货中
	PayOrderID          string `json:"pay_order_id" xml:"pay_order_id"`                   // 退款对应支付订单号
}

PushDataXpaySubscribeIosRefundQueryNotify iOS Apple 支付退款问询事件 文档:https://developers.weixin.qq.com/miniprogram/dev/platform-capabilities/business-capabilities/virtual-payment/ios.html

type PushReceiver added in v2.1.6

type PushReceiver struct {
	*context.Context
}

PushReceiver 接收消息推送 暂仅支付 Aes 加密方式

func NewPushReceiver added in v2.1.6

func NewPushReceiver(ctx *context.Context) *PushReceiver

NewPushReceiver 实例化

func (*PushReceiver) GetMsg added in v2.1.6

func (receiver *PushReceiver) GetMsg(r *http.Request) (string, []byte, error)

GetMsg 获取接收到的消息 (如果是加密的返回解密数据)

func (*PushReceiver) GetMsgData added in v2.1.6

func (receiver *PushReceiver) GetMsgData(r *http.Request) (MsgType, EventType, PushData, error)

GetMsgData 获取接收到的消息 (解密数据)

type Reply added in v2.1.6

type Reply struct {
	MsgType MsgType
	MsgData interface{}
}

Reply 消息回复

type SecVodAuditEvent added in v2.1.6

type SecVodAuditEvent struct {
	DramaID       int64            `json:"drama_id" xml:"drama_id"`             // 剧目 id
	SourceContext string           `json:"source_context" xml:"source_context"` // 透传上传接口中开发者设置的值
	AuditDetail   DramaAuditDetail `json:"audit_detail" xml:"audit_detail"`     // 剧目审核结果,单独每一集的审核结果可以根据 drama_id 查询剧集详情得到
}

SecVodAuditEvent 短剧媒资审核状态事件

type SecVodUploadEvent added in v2.1.6

type SecVodUploadEvent struct {
	MediaID       int64  `json:"media_id" xml:"media_id"`             // 媒资 id
	SourceContext string `json:"source_context" xml:"source_context"` // 透传上传接口中开发者设置的值。
	ErrCode       int    `json:"errcode" xml:"errcode"`               // 错误码,上传失败时该值非
	ErrMsg        string `json:"errmsg" xml:"errmsg"`                 // 错误提示
}

SecVodUploadEvent 短剧媒资上传完成事件

type SendUpdatableMsgReq added in v2.1.7

type SendUpdatableMsgReq struct {
	ActivityID   string               `json:"activity_id"`
	TemplateInfo UpdatableMsgTemplate `json:"template_info"`
	TargetState  UpdatableTargetState `json:"target_state"`
}

SendUpdatableMsgReq 修改动态消息参数

type SetChatToolMsgRequest added in v2.1.9

type SetChatToolMsgRequest struct {
	VersionType          int64                `json:"version_type"`
	TargetState          UpdatableTargetState `json:"target_state"`
	ActivityID           string               `json:"activity_id"`
	TemplateID           string               `json:"template_id"`
	ParticipatorInfoList []ParticipatorInfo   `json:"participator_info_list,omitempty"`
}

SetChatToolMsgRequest 修改小程序聊天工具的动态卡片消息请求

type SubscribeMsgChangeEvent added in v2.1.6

type SubscribeMsgChangeEvent struct {
	List []SubscribeMsgChangeList `xml:"List" json:"List"`
}

SubscribeMsgChangeEvent 用户管理订阅通知回调

type SubscribeMsgChangeList added in v2.1.6

type SubscribeMsgChangeList struct {
	TemplateID            string `xml:"TemplateId" json:"TemplateId"`
	SubscribeStatusString string `xml:"SubscribeStatusString" json:"SubscribeStatusString"`
}

SubscribeMsgChangeList 订阅消息事件列表

type SubscribeMsgPopupEvent added in v2.1.6

type SubscribeMsgPopupEvent struct {
	List []SubscribeMsgPopupEventList `xml:"List"`
}

SubscribeMsgPopupEvent 用户操作订阅通知弹窗消息回调

type SubscribeMsgPopupEventList added in v2.1.6

type SubscribeMsgPopupEventList struct {
	TemplateID            string `xml:"TemplateId" json:"TemplateId"`
	SubscribeStatusString string `xml:"SubscribeStatusString" json:"SubscribeStatusString"`
	PopupScene            string `xml:"PopupScene" json:"PopupScene"`
}

SubscribeMsgPopupEventList 订阅消息事件列表

type SubscribeMsgSentEvent added in v2.1.6

type SubscribeMsgSentEvent struct {
	List []SubscribeMsgSentList `xml:"List" json:"List"`
}

SubscribeMsgSentEvent 用户发送订阅通知回调

type SubscribeMsgSentList added in v2.1.6

type SubscribeMsgSentList struct {
	TemplateID  string `xml:"TemplateId" json:"TemplateId"`
	MsgID       string `xml:"MsgID" json:"MsgID"`
	ErrorCode   string `xml:"ErrorCode" json:"ErrorCode"`
	ErrorStatus string `xml:"ErrorStatus" json:"ErrorStatus"`
}

SubscribeMsgSentList 订阅消息事件列表

type UpdatableMessage added in v2.1.7

type UpdatableMessage struct {
	*context.Context
}

UpdatableMessage 动态消息

func NewUpdatableMessage added in v2.1.7

func NewUpdatableMessage(ctx *context.Context) *UpdatableMessage

NewUpdatableMessage 实例化

func (*UpdatableMessage) CreateActivityID added in v2.1.7

func (updatableMessage *UpdatableMessage) CreateActivityID() (CreateActivityIDResponse, error)

CreateActivityID 创建activity_id

func (*UpdatableMessage) CreateActivityIDWithReq added in v2.1.9

func (updatableMessage *UpdatableMessage) CreateActivityIDWithReq(req *CreateActivityIDRequest) (res CreateActivityIDResponse, err error)

CreateActivityIDWithReq 创建activity_id see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/updatable-message/createActivityId.html

func (*UpdatableMessage) SetChatToolMsg added in v2.1.9

func (updatableMessage *UpdatableMessage) SetChatToolMsg(req *SetChatToolMsgRequest) error

SetChatToolMsg 修改小程序聊天工具的动态卡片消息 see https://developers.weixin.qq.com/miniprogram/dev/OpenApiDoc/mp-message-management/updatable-message/setChatToolMsg.html

func (*UpdatableMessage) SetUpdatableMsg added in v2.1.7

func (updatableMessage *UpdatableMessage) SetUpdatableMsg(activityID string, targetState UpdatableTargetState, template UpdatableMsgTemplate) (err error)

SetUpdatableMsg 修改动态消息

type UpdatableMsgParameter added in v2.1.7

type UpdatableMsgParameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

UpdatableMsgParameter 动态消息参数

type UpdatableMsgTemplate added in v2.1.7

type UpdatableMsgTemplate struct {
	ParameterList []UpdatableMsgParameter `json:"parameter_list"`
}

UpdatableMsgTemplate 动态消息模板

type UpdatableTargetState added in v2.1.7

type UpdatableTargetState int

UpdatableTargetState 动态消息状态

const (
	// TargetStateNotStarted 未开始
	TargetStateNotStarted UpdatableTargetState = 0
	// TargetStateStarted 已开始
	TargetStateStarted UpdatableTargetState = 1
	// TargetStateFinished 已结束
	TargetStateFinished UpdatableTargetState = 2
)

type WeChatPayInfo added in v2.1.6

type WeChatPayInfo struct {
	MchOrderNo    string `json:"MchOrderNo" xml:"MchOrderNo"`       // 微信支付商户单号
	TransactionID string `json:"TransactionId" xml:"TransactionId"` // 交易单号(微信支付订单号)
	PaidTime      int64  `json:"PaidTime" xml:"PaidTime"`           // 用户支付时间,Linux 秒级时间戳
}

WeChatPayInfo 微信支付信息

type XpayTeamInfo added in v2.1.14

type XpayTeamInfo struct {
	ActivityID string `json:"ActivityId" xml:"ActivityId"` // 活动 id
	TeamID     string `json:"TeamId" xml:"TeamId"`         // 团 id
	TeamType   int    `json:"TeamType" xml:"TeamType"`     // 团类型 1-支付全部,拼成退款
	TeamAction int    `json:"TeamAction" xml:"TeamAction"` // 0-创团 1-参团
}

XpayTeamInfo team purchase info

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL