wechatpayapiv2

package
v1.0.215 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTable = "wechatpayapiv2"
)

Variables

This section is empty.

Functions

func GetP12ToPem added in v1.0.160

func GetP12ToPem(cert, key string) (*tls.Certificate, error)

func GetSign added in v1.0.160

func GetSign(param map[string]interface{}, key string) string

GetSign 获取签名

Types

type Client added in v1.0.47

type Client struct {
	// contains filtered or unexported fields
}

Client 实例

func NewClient added in v1.0.47

func NewClient(config *ClientConfig) (*Client, error)

NewClient 创建实例化

func (*Client) ConfigSLogClientFun added in v1.0.162

func (c *Client) ConfigSLogClientFun(apiSLogFun golog.ApiSLogFun)

ConfigSLogClientFun 日志配置

func (*Client) DefaultHttp added in v1.0.177

func (c *Client) DefaultHttp()

DefaultHttp 默认请求

func (*Client) GetAppId added in v1.0.47

func (c *Client) GetAppId() string

func (*Client) GetAppSecret added in v1.0.52

func (c *Client) GetAppSecret() string

func (*Client) GetCertString added in v1.0.47

func (c *Client) GetCertString() string

func (*Client) GetKeyString added in v1.0.47

func (c *Client) GetKeyString() string

func (*Client) GetMchId added in v1.0.47

func (c *Client) GetMchId() string

func (*Client) GetMchKey added in v1.0.47

func (c *Client) GetMchKey() string

func (*Client) MmpaymkttransfersGethbinfo added in v1.0.158

func (c *Client) MmpaymkttransfersGethbinfo(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersGethbinfoResult, error)

MmpaymkttransfersGethbinfo 现金红包 - 查询红包记录 https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon_sl.php?chapter=13_6&index=5

func (*Client) MmpaymkttransfersSendgroupredpack added in v1.0.158

func (c *Client) MmpaymkttransfersSendgroupredpack(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersSendgroupredpackResult, error)

MmpaymkttransfersSendgroupredpack 现金红包 - 发放裂变红包 https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon_sl.php?chapter=13_5&index=4

func (*Client) MmpaymkttransfersSendredpack added in v1.0.158

func (c *Client) MmpaymkttransfersSendredpack(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersSendredpackResult, error)

MmpaymkttransfersSendredpack 现金红包 - 发放普通红包 https://pay.weixin.qq.com/wiki/doc/api/tools/cash_coupon_sl.php?chapter=13_4&index=3

func (*Client) P12ToPem added in v1.0.47

func (c *Client) P12ToPem() (*tls.Certificate, error)

func (*Client) PayCloseOrder added in v1.0.52

func (c *Client) PayCloseOrder(ctx context.Context, outTradeNo string, notMustParams ...gorequest.Params) (*PayCloseOrderResult, error)

PayCloseOrder 小程序支付 - 关闭订单 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_3

func (*Client) PayOrderQuery added in v1.0.52

func (c *Client) PayOrderQuery(ctx context.Context, transactionId, outTradeNo string, notMustParams ...gorequest.Params) (*PayOrderQueryResult, error)

PayOrderQuery 小程序支付 - 查询订单 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_2

func (*Client) PayRefundQuery added in v1.0.52

func (c *Client) PayRefundQuery(ctx context.Context, notMustParams ...gorequest.Params) (*PayRefundQueryResult, error)

PayRefundQuery 小程序支付 - 查询退款 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_1

func (*Client) PayUnifiedOrder added in v1.0.52

func (c *Client) PayUnifiedOrder(ctx context.Context, notMustParams ...gorequest.Params) (*PayUnifiedOrderResult, error)

PayUnifiedOrder 小程序支付 - 统一下单 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_1

func (*Client) PayUnifiedOrderNotifyGin added in v1.0.52

func (c *Client) PayUnifiedOrderNotifyGin(ctx context.Context, ginCtx *gin.Context) (validateJson PayUnifiedOrderNotifyGinRequest, err error)

PayUnifiedOrderNotifyGin 小程序支付 - 统一下单 - 回调通知 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_7&index=8

func (*Client) Post added in v1.0.160

func (c *Client) Post(ctx context.Context, _method string, certStatus bool, cert *tls.Certificate, notMustParams ...gorequest.Params) ([]byte, error)

func (*Client) SecApiPayRefund added in v1.0.52

func (c *Client) SecApiPayRefund(ctx context.Context, notMustParams ...gorequest.Params) (*SecApiPayRefundResult, error)

SecApiPayRefund 小程序支付 - 申请退款 需要证书 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_4

func (*Client) SecApiPayRefundNotifyGin added in v1.0.52

func (c *Client) SecApiPayRefundNotifyGin(ctx context.Context, ginCtx *gin.Context) (validateJson SecApiPayRefundNotifyGinRequest, err error)

SecApiPayRefundNotifyGin 小程序支付 - 申请退款 - 回调通知 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_16&index=10

func (*Client) SetHttp added in v1.0.177

func (c *Client) SetHttp(app *gorequest.App)

SetHttp 配置请求

func (*Client) Transfers added in v1.0.47

func (c *Client) Transfers(ctx context.Context, notMustParams ...gorequest.Params) (*TransfersResult, error)

Transfers 付款到零钱 - 付款 需要证书 https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_2

func (*Client) TransfersQuery added in v1.0.47

func (c *Client) TransfersQuery(ctx context.Context, notMustParams ...gorequest.Params) (*TransfersQueryResult, error)

TransfersQuery 付款到零钱 - 查询付款 需要证书 https://pay.weixin.qq.com/wiki/doc/api/tools/mch_pay.php?chapter=14_3

type ClientConfig added in v1.0.52

type ClientConfig struct {
	AppId      string `json:"app_id"` // 小程序或者公众号唯一凭证
	AppSecret  string // 小程序或者公众号唯一凭证密钥
	MchId      string `json:"mch_id"` // 微信支付的商户id
	MchKey     string // 私钥
	CertString string
	KeyString  string
}

ClientConfig 实例配置

type MmpaymkttransfersGethbinfoResponse added in v1.0.158

type MmpaymkttransfersGethbinfoResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code" xml:"result_code"`                       // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	MchBillno    string `json:"mch_billno" xml:"mch_billno"`       // 商户订单号
	MchId        string `json:"mch_id" xml:"mch_id"`               // 商户号
	DetailId     string `json:"detail_id" xml:"detail_id"`         // 红包单号
	Status       string `json:"status" xml:"status"`               // 红包状态
	SendType     string `json:"send_type" xml:"send_type"`         // 发放类型
	HbType       string `json:"hb_type" xml:"hb_type"`             // 红包类型
	TotalNum     int64  `json:"total_num" xml:"total_num"`         // 红包个数
	TotalAmount  int64  `json:"total_amount" xml:"total_amount"`   // 红包金额
	Reason       string `json:"reason" xml:"reason"`               // 失败原因
	SendTime     string `json:"send_time" xml:"send_time"`         // 红包发送时间
	RefundTime   string `json:"refund_time" xml:"refund_time"`     // 红包退款时间
	RefundAmount int64  `json:"refund_amount" xml:"refund_amount"` // 红包退款金额
	Wishing      string `json:"wishing" xml:"wishing"`             // 祝福语
	Remark       string `json:"remark" xml:"remark"`               // 活动描述
	ActName      string `json:"act_name" xml:"act_name"`           // 活动名称
	Hblist       []struct {
		Openid   string `json:"openid" xml:"openid"`     // 领取红包的Openid
		Amount   int64  `json:"amount" xml:"amount"`     // 金额
		Rcv_time string `json:"rcv_time" xml:"rcv_time"` // 接收时间
	} `json:"hblist" xml:"hblist"` // 裂变红包领取列表
}

type MmpaymkttransfersGethbinfoResult added in v1.0.158

type MmpaymkttransfersGethbinfoResult struct {
	Result MmpaymkttransfersGethbinfoResponse // 结果
	Body   []byte                             // 内容
	Http   gorequest.Response                 // 请求
}

type MmpaymkttransfersSendgroupredpackResponse added in v1.0.158

type MmpaymkttransfersSendgroupredpackResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code" xml:"result_code"`                       // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	MchBillno   string `json:"mch_billno" xml:"mch_billno"`     // 商户订单号
	MchId       string `json:"mch_id" xml:"mch_id"`             // 商户号
	Wxappid     string `json:"wxappid" xml:"wxappid"`           // 公众账号appid
	ReOpenid    string `json:"re_openid" xml:"re_openid"`       // 用户openid
	TotalAmount int64  `json:"total_amount" xml:"total_amount"` // 付款金额
	SendListid  string `json:"send_listid" xml:"send_listid"`   // 微信单号
}

type MmpaymkttransfersSendgroupredpackResult added in v1.0.158

type MmpaymkttransfersSendgroupredpackResult struct {
	Result MmpaymkttransfersSendgroupredpackResponse // 结果
	Body   []byte                                    // 内容
	Http   gorequest.Response                        // 请求
}

type MmpaymkttransfersSendredpackResponse added in v1.0.158

type MmpaymkttransfersSendredpackResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code" xml:"result_code"`                       // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	MchBillno   string `json:"mch_billno" xml:"mch_billno"`     // 商户订单号
	MchId       string `json:"mch_id" xml:"mch_id"`             // 商户号
	Wxappid     string `json:"wxappid" xml:"wxappid"`           // 公众账号appid
	ReOpenid    string `json:"re_openid" xml:"re_openid"`       // 用户openid
	TotalAmount int64  `json:"total_amount" xml:"total_amount"` // 付款金额
	SendListid  string `json:"send_listid" xml:"send_listid"`   // 微信单号
}

type MmpaymkttransfersSendredpackResult added in v1.0.158

type MmpaymkttransfersSendredpackResult struct {
	Result MmpaymkttransfersSendredpackResponse // 结果
	Body   []byte                               // 内容
	Http   gorequest.Response                   // 请求
}

type PayCloseOrderResponse added in v1.0.52

type PayCloseOrderResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code,omitempty" xml:"result_code,omitempty"`   // 业务结果
	ResultMsg  string `json:"result_msg,omitempty" xml:"result_msg,omitempty"`     // 业务结果描述
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	Appid    string `json:"appid,omitempty" xml:"appid,omitempty"`         // 小程序ID
	MchId    string `json:"mch_id,omitempty" xml:"mch_id,omitempty"`       // 商户号
	NonceStr string `json:"nonce_str,omitempty" xml:"nonce_str,omitempty"` // 随机字符串
	Sign     string `json:"sign,omitempty" xml:"sign,omitempty"`           // 签名
}

type PayCloseOrderResult added in v1.0.52

type PayCloseOrderResult struct {
	Result PayCloseOrderResponse // 结果
	Body   []byte                // 内容
	Http   gorequest.Response    // 请求
}

type PayOrderQueryResponse added in v1.0.52

type PayOrderQueryResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code,omitempty" xml:"result_code,omitempty"`   // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	Appid    string `json:"appid,omitempty" xml:"appid,omitempty"`         // 小程序ID
	MchId    string `json:"mch_id,omitempty" xml:"mch_id,omitempty"`       // 商户号
	NonceStr string `json:"nonce_str,omitempty" xml:"nonce_str,omitempty"` // 随机字符串
	Sign     string `json:"sign,omitempty" xml:"sign,omitempty"`           // 签名

	DeviceInfo         string `json:"device_info,omitempty" xml:"device_info,omitempty"`                   // 设备号
	Openid             string `json:"openid,omitempty" xml:"openid,omitempty"`                             // 用户标识
	IsSubscribe        string `json:"is_subscribe,omitempty" xml:"is_subscribe,omitempty"`                 // 是否关注公众账号
	TradeType          string `json:"trade_type,omitempty" xml:"trade_type,omitempty"`                     // 交易类型
	TradeState         string `json:"trade_state,omitempty" xml:"trade_state,omitempty"`                   // 交易状态
	BankType           string `json:"bank_type,omitempty" xml:"bank_type,omitempty"`                       // 付款银行
	TotalFee           int    `json:"total_fee,omitempty" xml:"total_fee,omitempty"`                       // 标价金额
	SettlementTotalFee int    `json:"settlement_total_fee,omitempty" xml:"settlement_total_fee,omitempty"` // 应结订单金额
	FeeType            string `json:"fee_type,omitempty" xml:"fee_type,omitempty"`                         // 标价币种
	CashFee            int    `json:"cash_fee,omitempty" xml:"cash_fee,omitempty"`                         // 现金支付金额
	CashFeeType        string `json:"cash_fee_type,omitempty" xml:"cash_fee_type,omitempty"`               // 现金支付币种
	CouponFee          int    `json:"coupon_fee,omitempty" xml:"coupon_fee,omitempty"`                     // 代金券金额
	CouponCount        int    `json:"coupon_count,omitempty" xml:"coupon_count,omitempty"`                 // 代金券使用数量
	CouponType         string `json:"coupon_type,omitempty" xml:"coupon_type,omitempty"`                   // 代金券类型
	CouponId           string `json:"coupon_id,omitempty" xml:"coupon_id,omitempty"`                       // 代金券ID
	TransactionId      string `json:"transaction_id,omitempty" xml:"transaction_id,omitempty"`             // 微信支付订单号
	OutTradeNo         string `json:"out_trade_no,omitempty" xml:"out_trade_no,omitempty"`                 // 商户订单号
	Attach             string `json:"attach,omitempty" xml:"attach,omitempty"`                             // 附加数据
	TimeEnd            string `json:"time_end,omitempty" xml:"time_end,omitempty"`                         // 支付完成时间
	TradeStateDesc     string `json:"trade_state_desc,omitempty" xml:"trade_state_desc,omitempty"`         // 交易状态描述
}

type PayOrderQueryResult added in v1.0.52

type PayOrderQueryResult struct {
	Result PayOrderQueryResponse // 结果
	Body   []byte                // 内容
	Http   gorequest.Response    // 请求
}

type PayRefundQueryResponse added in v1.0.52

type PayRefundQueryResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code,omitempty" xml:"result_code,omitempty"`   // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	Appid      string `json:"appid,omitempty" xml:"appid,omitempty"`             // 小程序ID
	MchId      string `json:"mch_id,omitempty" xml:"mch_id,omitempty"`           // 商户号
	DeviceInfo string `json:"device_info,omitempty" xml:"device_info,omitempty"` // 设备号
	NonceStr   string `json:"nonce_str,omitempty" xml:"nonce_str,omitempty"`     // 随机字符串
	Sign       string `json:"sign,omitempty" xml:"sign,omitempty"`               // 签名

	TotalRefundCount    int    `json:"total_refund_count,omitempty" xml:"total_refund_count,omitempty"`       // 订单总退款次数
	TransactionId       string `json:"transaction_id,omitempty" xml:"transaction_id,omitempty"`               // 微信订单号
	OutTradeNo          string `json:"out_trade_no,omitempty" xml:"out_trade_no,omitempty"`                   // 商户订单号
	TotalFee            int    `json:"total_fee,omitempty" xml:"total_fee,omitempty"`                         // 订单金额
	SettlementTotalFee  int    `json:"settlement_total_fee,omitempty" xml:"settlement_total_fee,omitempty"`   // 应结订单金额
	FeeType             string `json:"fee_type,omitempty" xml:"fee_type,omitempty"`                           // 货币种类
	CashFee             int    `json:"cash_fee,omitempty" xml:"cash_fee,omitempty"`                           // 现金支付金额
	RefundCount         int    `json:"refund_count,omitempty" xml:"refund_count,omitempty"`                   // 退款笔数
	OutRefundNo         string `json:"out_refund_no,omitempty" xml:"out_refund_no,omitempty"`                 // 商户退款单号
	RefundId            string `json:"refund_id,omitempty" xml:"refund_id,omitempty"`                         // 微信退款单号
	RefundChannel       string `json:"refund_channel,omitempty" xml:"refund_channel,omitempty"`               // 退款渠道
	RefundFee           int    `json:"refund_fee,omitempty" xml:"refund_fee,omitempty"`                       // 退款总金额
	CouponRefundFee     int    `json:"coupon_refund_fee,omitempty" xml:"coupon_refund_fee,omitempty"`         // 代金券退款总金额
	SettlementRefundFee int    `json:"settlement_refund_fee,omitempty" xml:"settlement_refund_fee,omitempty"` // 退款金额
	CouponType          string `json:"coupon_type,omitempty" xml:"coupon_type,omitempty"`                     // 代金券类型
	CouponRefundCount   int    `json:"coupon_refund_count,omitempty" xml:"coupon_refund_count,omitempty"`     // 退款代金券使用数量
	CouponRefundId      string `json:"coupon_refund_id,omitempty" xml:"coupon_refund_id,omitempty"`           // 退款代金券ID
	RefundStatus        string `json:"refund_status,omitempty" xml:"refund_status,omitempty"`                 // 退款状态
	RefundAccount       string `json:"refund_account,omitempty" xml:"refund_account,omitempty"`               // 退款资金来源
	RefundRecvAccout    string `json:"refund_recv_accout,omitempty" xml:"refund_recv_accout,omitempty"`       // 退款入账账户
	RefundSuccessTime   string `json:"refund_success_time,omitempty" xml:"refund_success_time,omitempty"`     // 退款成功时间
	CashRefundFee       int    `json:"cash_refund_fee,omitempty" xml:"cash_refund_fee,omitempty"`             // 用户退款金额
}

type PayRefundQueryResult added in v1.0.52

type PayRefundQueryResult struct {
	Result PayRefundQueryResponse // 结果
	Body   []byte                 // 内容
	Http   gorequest.Response     // 请求
}

type PayUnifiedOrderNotifyGinRequest added in v1.0.52

type PayUnifiedOrderNotifyGinRequest struct {
	ReturnCode         string `form:"return_code" json:"return_code" xml:"return_code" uri:"return_code" binding:"required"`      // 返回状态码
	ReturnMsg          string `form:"return_msg" json:"return_msg" xml:"return_msg" uri:"return_msg" binding:"omitempty"`         // 返回信息
	Appid              string `form:"appid" json:"appid" xml:"appid" uri:"appid" binding:"omitempty"`                             // 小程序ID
	MchId              string `form:"mch_id" json:"mch_id" xml:"mch_id" uri:"mch_id" binding:"omitempty"`                         // 商户号
	DeviceInfo         string `form:"device_info" json:"device_info" xml:"device_info" uri:"device_info" binding:"omitempty"`     // 设备号
	NonceStr           string `form:"nonce_str" json:"nonce_str" xml:"nonce_str" uri:"nonce_str" binding:"omitempty"`             // 随机字符串
	Sign               string `form:"sign" json:"sign" xml:"sign" uri:"sign" binding:"omitempty"`                                 // 签名
	SignType           string `form:"sign_type" json:"sign_type" xml:"sign_type" uri:"sign_type" binding:"omitempty"`             // 签名类型
	ResultCode         string `form:"result_code" json:"result_code" xml:"result_code" uri:"result_code" binding:"omitempty"`     // 业务结果
	ErrCode            string `form:"err_code" json:"err_code" xml:"err_code" uri:"err_code" binding:"omitempty"`                 // 错误代码
	ErrCodeDes         string `form:"err_code_des" json:"err_code_des" xml:"err_code_des" uri:"err_code_des" binding:"omitempty"` // 错误代码描述
	Openid             string `form:"openid" json:"openid" xml:"openid" uri:"openid" binding:"omitempty"`                         // 用户标识
	IsSubscribe        string `form:"is_subscribe" json:"is_subscribe" xml:"is_subscribe" uri:"is_subscribe" binding:"omitempty"` // 是否关注公众账号
	TradeType          string `form:"trade_type" json:"trade_type" xml:"trade_type" uri:"trade_type" binding:"omitempty"`         // 交易类型
	BankType           string `form:"bank_type" json:"bank_type" xml:"bank_type" uri:"bank_type" binding:"omitempty"`             // 付款银行
	TotalFee           int    `form:"total_fee" json:"total_fee" xml:"total_fee" uri:"total_fee" binding:"omitempty"`             // 订单金额
	SettlementTotalFee int    ``                                                                                                  // 应结订单金额
	/* 129-byte string literal not displayed */
	FeeType       string `form:"fee_type" json:"fee_type" xml:"fee_type" uri:"fee_type" binding:"omitempty"`                         // 货币种类
	CashFee       int    `form:"cash_fee" json:"cash_fee" xml:"cash_fee" uri:"cash_fee" binding:"omitempty"`                         // 现金支付金额
	CashFeeType   string `form:"cash_fee_type" json:"cash_fee_type" xml:"cash_fee_type" uri:"cash_fee_type" binding:"omitempty"`     // 现金支付货币类型
	CouponFee     string `form:"coupon_fee" json:"coupon_fee" xml:"coupon_fee" uri:"coupon_fee" binding:"omitempty"`                 // 总代金券金额
	CouponCount   int    `form:"coupon_count" json:"coupon_count" xml:"coupon_count" uri:"coupon_count" binding:"omitempty"`         // 代金券使用数量
	CouponType    string `form:"coupon_type" json:"coupon_type" xml:"coupon_type" uri:"coupon_type" binding:"omitempty"`             // 代金券类型
	CouponId      string `form:"coupon_id" json:"coupon_id" xml:"coupon_id" uri:"coupon_id" binding:"omitempty"`                     // 代金券ID
	TransactionId string `form:"transaction_id" json:"transaction_id" xml:"transaction_id" uri:"transaction_id" binding:"omitempty"` // 微信支付订单号
	OutTradeNo    string `form:"out_trade_no" json:"out_trade_no" xml:"out_trade_no" uri:"out_trade_no" binding:"omitempty"`         // 商户订单号
	Attach        string `form:"attach" json:"attach" xml:"attach" uri:"attach" binding:"omitempty"`                                 // 商家数据包
	TimeEnd       string `form:"time_end" json:"time_end" xml:"time_end" uri:"time_end" binding:"omitempty"`                         // 支付完成时间
}

PayUnifiedOrderNotifyGinRequest 小程序支付 - 统一下单 - 回调通知 - 请求参数

type PayUnifiedOrderResponse added in v1.0.52

type PayUnifiedOrderResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code,omitempty" xml:"result_code,omitempty"`   // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	Appid      string `json:"appid,omitempty" xml:"appid,omitempty"`             // 小程序ID
	MchId      string `json:"mch_id,omitempty" xml:"mch_id,omitempty"`           // 商户号
	DeviceInfo string `json:"device_info,omitempty" xml:"device_info,omitempty"` // 设备号
	NonceStr   string `json:"nonce_str,omitempty" xml:"nonce_str,omitempty"`     // 随机字符串
	Sign       string `json:"sign,omitempty" xml:"sign,omitempty"`               // 签名

	TradeType string `json:"trade_type,omitempty" xml:"trade_type,omitempty"` // 交易类型
	PrepayId  string `json:"prepay_id,omitempty" xml:"prepay_id,omitempty"`   // 预支付交易会话标识
	CodeUrl   string `json:"code_url,omitempty" xml:"code_url,omitempty"`     // 二维码链接
}

type PayUnifiedOrderResult added in v1.0.52

type PayUnifiedOrderResult struct {
	Result PayUnifiedOrderResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
}

type SecApiPayRefundNotifyGinRequest added in v1.0.52

type SecApiPayRefundNotifyGinRequest struct {
	ReturnCode string `form:"return_code" json:"return_code" xml:"return_code" uri:"return_code" binding:"required"` // 返回状态码
	ReturnMsg  string `form:"return_msg" json:"return_msg" xml:"return_msg" uri:"return_msg" binding:"omitempty"`    // 返回信息
	Appid      string `form:"appid" json:"appid" xml:"appid" uri:"appid" binding:"omitempty"`                        // 公众账号ID
	MchId      string `form:"mch_id" json:"mch_id" xml:"mch_id" uri:"mch_id" binding:"omitempty"`                    // 退款的商户号
	NonceStr   string `form:"nonce_str" json:"nonce_str" xml:"nonce_str" uri:"nonce_str" binding:"omitempty"`        // 随机字符串
	ReqInfo    string `form:"req_info" json:"req_info" xml:"req_info" uri:"req_info" binding:"omitempty"`            // 加密信息
}

SecApiPayRefundNotifyGinRequest 小程序支付 - 申请退款 - 回调通知 - 请求参数

type SecApiPayRefundResponse added in v1.0.52

type SecApiPayRefundResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code,omitempty" xml:"result_code,omitempty"`   // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	Appid      string `json:"appid,omitempty" xml:"appid,omitempty"`             // 小程序ID
	MchId      string `json:"mch_id,omitempty" xml:"mch_id,omitempty"`           // 商户号
	DeviceInfo string `json:"device_info,omitempty" xml:"device_info,omitempty"` // 设备号
	NonceStr   string `json:"nonce_str,omitempty" xml:"nonce_str,omitempty"`     // 随机字符串
	Sign       string `json:"sign,omitempty" xml:"sign,omitempty"`               // 签名

	TotalRefundCount    int    `json:"total_refund_count,omitempty" xml:"total_refund_count,omitempty"`       // 订单总退款次数
	TransactionId       string `json:"transaction_id,omitempty" xml:"transaction_id,omitempty"`               // 微信订单号
	OutTradeNo          string `json:"out_trade_no,omitempty" xml:"out_trade_no,omitempty"`                   // 商户订单号
	OutRefundNo         string `json:"out_refund_no,omitempty" xml:"out_refund_no,omitempty"`                 // 商户退款单号
	RefundId            string `json:"refund_id,omitempty" xml:"refund_id,omitempty"`                         // 微信退款单号
	RefundFee           int    `json:"refund_fee,omitempty" xml:"refund_fee,omitempty"`                       // 退款金额
	SettlementRefundFee int    `json:"settlement_refund_fee,omitempty" xml:"settlement_refund_fee,omitempty"` // 退款金额
	TotalFee            int    `json:"total_fee,omitempty" xml:"total_fee,omitempty"`                         // 标价金额
	SettlementTotalFee  int    `json:"settlement_total_fee,omitempty" xml:"settlement_total_fee,omitempty"`   // 应结订单金额
	FeeType             string `json:"fee_type,omitempty" xml:"fee_type,omitempty"`                           // 货币种类
	CashFee             int    `json:"cash_fee,omitempty" xml:"cash_fee,omitempty"`                           // 现金支付金额
	CashFeeType         string `json:"cash_fee_type,omitempty" xml:"cash_fee_type,omitempty"`                 // 现金支付币种
	CashRefundFee       int    `json:"cash_refund_fee,omitempty" xml:"cash_refund_fee,omitempty"`             // 现金退款金额
	CouponType          string `json:"coupon_type,omitempty" xml:"coupon_type,omitempty"`                     // 代金券类型
	CouponRefundFee     int    `json:"coupon_refund_fee,omitempty" xml:"coupon_refund_fee,omitempty"`         // 代金券退款总金额
	CouponRefundCount   int    `json:"coupon_refund_count,omitempty" xml:"coupon_refund_count,omitempty"`     // 退款代金券使用数量
	CouponRefundId      string `json:"coupon_refund_id,omitempty" xml:"coupon_refund_id,omitempty"`           // 退款代金券ID
}

type SecApiPayRefundResult added in v1.0.52

type SecApiPayRefundResult struct {
	Result SecApiPayRefundResponse // 结果
	Body   []byte                  // 内容
	Http   gorequest.Response      // 请求
}

type TransfersQueryResponse

type TransfersQueryResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code" xml:"result_code"`                       // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	PartnerTradeNo string `json:"partner_trade_no" xml:"partner_trade_no"`               // 商户单号
	Appid          string `json:"appid" xml:"appid"`                                     // Appid
	MchId          string `json:"mch_id" xml:"mch_id"`                                   // 商户号
	DetailId       string `json:"detail_id" xml:"detail_id"`                             // 付款单号
	Status         string `json:"status" xml:"status"`                                   // 转账状态
	Reason         string `json:"reason,omitempty" xml:"reason,omitempty"`               // 失败原因
	Openid         string `json:"openid" xml:"openid"`                                   // 收款用户openid
	TransferName   string `json:"transfer_name,omitempty" xml:"transfer_name,omitempty"` // 收款用户姓名
	PaymentAmount  string `json:"payment_amount" xml:"payment_amount"`                   // 付款金额
	TransferTime   string `json:"transfer_time" xml:"transfer_time"`                     // 转账时间
	PaymentTime    string `json:"payment_time" xml:"payment_time"`                       // 付款成功时间
	Desc           string `json:"desc" xml:"desc"`                                       // 付款备注
}

type TransfersQueryResult

type TransfersQueryResult struct {
	Result TransfersQueryResponse // 结果
	Body   []byte                 // 内容
	Http   gorequest.Response     // 请求
}

type TransfersResponse

type TransfersResponse struct {
	ReturnCode string `json:"return_code" xml:"return_code"`                   // 返回状态码
	ReturnMsg  string `json:"return_msg,omitempty" xml:"return_msg,omitempty"` // 返回信息

	ResultCode string `json:"result_code" xml:"result_code"`                       // 业务结果
	ErrCode    string `json:"err_code,omitempty" xml:"err_code,omitempty"`         // 错误代码
	ErrCodeDes string `json:"err_code_des,omitempty" xml:"err_code_des,omitempty"` // 错误代码描述

	MchAppid       string `json:"mch_appid" xml:"mch_appid"`                         // 商户appid
	Mchid          string `json:"mchid" xml:"mchid"`                                 // 商户号
	DeviceInfo     string `json:"device_info,omitempty" xml:"device_info,omitempty"` // 设备号
	NonceStr       string `json:"nonce_str" xml:"nonce_str"`                         // 随机字符串
	PartnerTradeNo string `json:"partner_trade_no" xml:"partner_trade_no"`           // 商户订单号
	PaymentNo      string `json:"payment_no" xml:"payment_no"`                       // 微信付款单号
	PaymentTime    string `json:"payment_time" xml:"payment_time"`                   // 付款成功时间
}

type TransfersResult

type TransfersResult struct {
	Result TransfersResponse  // 结果
	Body   []byte             // 内容
	Http   gorequest.Response // 请求
}

Jump to

Keyboard shortcuts

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