redpacket

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RedPacketGateWay = "https://api.mch.weixin.qq.com/mmpaymkttransfers/sendredpack"

RedPacketGateWay 发放红包接口 https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon.php?chapter=13_4&index=3

Functions

This section is empty.

Types

type Params

type Params struct {
	MchBillno   string // 商户订单号
	SendName    string // 商户名称
	ReOpenID    string
	TotalAmount int
	TotalNum    int
	Wishing     string
	ClientIP    string
	ActName     string
	Remark      string

	RootCa string // ca证书
}

Params 调用参数

type RedPacket

type RedPacket struct {
	*config.Config
}

RedPacket struct extends context

func NewRedPacket

func NewRedPacket(cfg *config.Config) *RedPacket

NewRedPacket return an instance of RedPacket package

func (*RedPacket) SendRedPacket

func (RedPacket *RedPacket) SendRedPacket(p *Params) (rsp *Response, err error)

SendRedPacket 发放红包

type Response

type Response struct {
	ReturnCode  string `xml:"return_code"`
	ReturnMsg   string `xml:"return_msg"`
	ResultCode  string `xml:"result_code,omitempty"`
	ErrCode     string `xml:"err_code,omitempty"`
	ErrCodeDes  string `xml:"err_code_des,omitempty"`
	MchBillno   string `xml:"mch_billno,omitempty"`
	MchID       string `xml:"mch_id,omitempty"`
	Wxappid     string `xml:"wxappid"`
	ReOpenID    string `xml:"re_openid"`
	TotalAmount int    `xml:"total_amount"`
	SendListid  string `xml:"send_listid"`
}

Response 接口返回

Jump to

Keyboard shortcuts

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