redpack

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedPack

type RedPack struct {
	*config.Config
}

func NewRedPack

func NewRedPack(cfg *config.Config) *RedPack

NewRefund return an instance of refund package

func (*RedPack) SendRedPack

func (pcf *RedPack) SendRedPack(p *RedPackParams) (rsp RedPackResp, err error)

SendRedPack 发送普通红包

type RedPackParams

type RedPackParams struct {
	ActName     string
	MchBillno   string
	ReOpenid    string
	Remark      string
	SendName    string
	TotalAmount int
	TotalNum    int
	Wishing     string
	RootCa      string //ca证书
	SceneId     string //场景
}

RedPackParams 调用参数

type RedPackRequest

type RedPackRequest struct {
	ActName     string `xml:"act_name"`     //必填,活动名称
	ClientIP    string `xml:"client_ip"`    //必填,调用接口的机器ip地址
	MchBillno   string `xml:"mch_billno"`   //必填,商户订单号
	MchID       string `xml:"mch_id"`       //必填,微信支付分配的商户号
	NonceStr    string `xml:"nonce_str"`    //必填,随机字符串,不超过32位
	ReOpenid    string `xml:"re_openid"`    //必填,接收红包者用户,用户在wxappid下的openid
	Remark      string `xml:"remark"`       //必填,备注信息
	SendName    string `xml:"send_name"`    //必填,红包发送者名称
	TotalAmount int    `xml:"total_amount"` //必填,付款金额,单位为分
	TotalNum    int    `xml:"total_num"`    //必填,红包发放人数
	Wishing     string `xml:"wishing"`      //必填,红包祝福语
	Wxappid     string `xml:"wxappid"`      //必填,微信公众号id
	Sign        string `xml:"sign"`         //必填,签名
	SceneId     string `xml:"scene_id"`     //非必填,红包使用场景

}

RedPackRequest 请求参数

type RedPackResp

type RedPackResp struct {
	ReturnMsg   string `xml:"return_msg"`
	MchID       string `xml:"mch_id"`
	WxAppID     string `xml:"wxappid"`
	ReOpenid    string `xml:"re_openid"`
	TotalAmount int    `xml:"total_amount"`
	ReturnCode  string `xml:"return_code"`
	ResultCode  string `xml:"result_code"`
	ErrCode     string `xml:"err_code"`
	ErrCodeDes  string `xml:"err_code_des"`
	MchBillNo   string `xml:"mch_billno"`

	// 以下发送裂变红包的时候才会用到
	SendTime   string `xml:"send_time"`
	SendListID string `xml:"send_listid"`
}

RedPackResp 发送红包返回值

Jump to

Keyboard shortcuts

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