Documentation
¶
Index ¶
- Constants
- func GetP12ToPem(cert, key string) (*tls.Certificate, error)
- func GetSign(param map[string]interface{}, key string) string
- type Client
- func (c *Client) GetAppId() string
- func (c *Client) GetAppSecret() string
- func (c *Client) GetCertString() string
- func (c *Client) GetKeyString() string
- func (c *Client) GetMchId() string
- func (c *Client) GetMchKey() string
- func (c *Client) MmpaymkttransfersGethbinfo(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersGethbinfoResult, error)
- func (c *Client) MmpaymkttransfersSendgroupredpack(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersSendgroupredpackResult, error)
- func (c *Client) MmpaymkttransfersSendredpack(ctx context.Context, notMustParams ...gorequest.Params) (*MmpaymkttransfersSendredpackResult, error)
- func (c *Client) P12ToPem() (*tls.Certificate, error)
- func (c *Client) PayCloseOrder(ctx context.Context, outTradeNo string, notMustParams ...gorequest.Params) (*PayCloseOrderResult, error)
- func (c *Client) PayOrderQuery(ctx context.Context, transactionId, outTradeNo string, ...) (*PayOrderQueryResult, error)
- func (c *Client) PayRefundQuery(ctx context.Context, notMustParams ...gorequest.Params) (*PayRefundQueryResult, error)
- func (c *Client) PayUnifiedOrder(ctx context.Context, notMustParams ...gorequest.Params) (*PayUnifiedOrderResult, error)
- func (c *Client) PayUnifiedOrderNotifyHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateXml PayUnifiedOrderNotifyHttpRequest, err error)
- func (c *Client) SecApiPayRefund(ctx context.Context, notMustParams ...gorequest.Params) (*SecApiPayRefundResult, error)
- func (c *Client) SecApiPayRefundNotifyHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateXml SecApiPayRefundNotifyHttpRequest, err error)
- func (c *Client) SetAppId(v string) *Client
- func (c *Client) SetAppSecret(v string) *Client
- func (c *Client) SetCertString(v string) *Client
- func (c *Client) SetClientIP(clientIP string) *Client
- func (c *Client) SetKeyString(v string) *Client
- func (c *Client) SetLogFun(logFun gorequest.LogFunc)
- func (c *Client) SetMchId(v string) *Client
- func (c *Client) SetMchKey(v string) *Client
- func (c *Client) SetTrace(trace bool)
- func (c *Client) TraceEndSpan()
- func (c *Client) TraceGetSpanID() (spanID string)
- func (c *Client) TraceGetTraceID() (traceID string)
- func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
- func (c *Client) TraceSetAttributes(kv ...attribute.KeyValue)
- func (c *Client) TraceSetStatus(code codes.Code, description string)
- func (c *Client) TraceStartSpan(ctx context.Context, spanName string) context.Context
- func (c *Client) Transfers(ctx context.Context, notMustParams ...gorequest.Params) (*TransfersResult, error)
- func (c *Client) TransfersQuery(ctx context.Context, notMustParams ...gorequest.Params) (*TransfersQueryResult, error)
- type ClientConfig
- type MmpaymkttransfersGethbinfoResponse
- type MmpaymkttransfersGethbinfoResult
- type MmpaymkttransfersSendgroupredpackResponse
- type MmpaymkttransfersSendgroupredpackResult
- type MmpaymkttransfersSendredpackResponse
- type MmpaymkttransfersSendredpackResult
- type PayCloseOrderResponse
- type PayCloseOrderResult
- type PayOrderQueryResponse
- type PayOrderQueryResult
- type PayRefundQueryResponse
- type PayRefundQueryResult
- type PayUnifiedOrderNotifyHttpRequest
- type PayUnifiedOrderResponse
- type PayUnifiedOrderResult
- type SecApiPayRefundNotifyHttpRequest
- type SecApiPayRefundResponse
- type SecApiPayRefundResult
- type TransfersQueryResponse
- type TransfersQueryResult
- type TransfersResponse
- type TransfersResult
Constants ¶
const (
LogTable = "wechatpayapiv2"
)
const (
Version = "1.0.16"
)
Variables ¶
This section is empty.
Functions ¶
func GetP12ToPem ¶ added in v1.0.12
func GetP12ToPem(cert, key string) (*tls.Certificate, error)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client 实例
func (*Client) GetAppSecret ¶ added in v1.0.4
func (*Client) GetCertString ¶
func (*Client) GetKeyString ¶
func (*Client) MmpaymkttransfersGethbinfo ¶ added in v1.0.12
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.12
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.12
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) PayCloseOrder ¶ added in v1.0.7
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.7
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.7
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.7
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) PayUnifiedOrderNotifyHttp ¶ added in v1.0.15
func (c *Client) PayUnifiedOrderNotifyHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateXml PayUnifiedOrderNotifyHttpRequest, err error)
PayUnifiedOrderNotifyHttp 小程序支付 - 统一下单 - 回调通知 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_7&index=8
func (*Client) SecApiPayRefund ¶ added in v1.0.7
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) SecApiPayRefundNotifyHttp ¶ added in v1.0.15
func (c *Client) SecApiPayRefundNotifyHttp(ctx context.Context, w http.ResponseWriter, r *http.Request) (validateXml SecApiPayRefundNotifyHttpRequest, err error)
SecApiPayRefundNotifyHttp 小程序支付 - 申请退款 - 回调通知 https://pay.weixin.qq.com/wiki/doc/api/wxa/wxa_api.php?chapter=9_16&index=10
func (*Client) SetAppSecret ¶ added in v1.0.16
func (*Client) SetCertString ¶ added in v1.0.16
func (*Client) SetClientIP ¶ added in v1.0.16
SetClientIP 配置
func (*Client) SetKeyString ¶ added in v1.0.16
func (*Client) TraceEndSpan ¶ added in v1.0.16
func (c *Client) TraceEndSpan()
TraceEndSpan 结束OpenTelemetry链路追踪状态
func (*Client) TraceGetSpanID ¶ added in v1.0.16
TraceGetSpanID 获取OpenTelemetry链路追踪SpanID
func (*Client) TraceGetTraceID ¶ added in v1.0.16
TraceGetTraceID 获取OpenTelemetry链路追踪TraceID
func (*Client) TraceRecordError ¶ added in v1.0.16
func (c *Client) TraceRecordError(err error, options ...trace.EventOption)
TraceRecordError 记录OpenTelemetry链路追踪错误
func (*Client) TraceSetAttributes ¶ added in v1.0.16
TraceSetAttributes 设置OpenTelemetry链路追踪属性
func (*Client) TraceSetStatus ¶ added in v1.0.16
TraceSetStatus 设置OpenTelemetry链路追踪状态
func (*Client) TraceStartSpan ¶ added in v1.0.16
TraceStartSpan 开始OpenTelemetry链路追踪状态
func (*Client) Transfers ¶
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 ¶
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.4
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.12
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.12
type MmpaymkttransfersGethbinfoResult struct {
Result MmpaymkttransfersGethbinfoResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type MmpaymkttransfersSendgroupredpackResponse ¶ added in v1.0.12
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.12
type MmpaymkttransfersSendgroupredpackResult struct {
Result MmpaymkttransfersSendgroupredpackResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type MmpaymkttransfersSendredpackResponse ¶ added in v1.0.12
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.12
type MmpaymkttransfersSendredpackResult struct {
Result MmpaymkttransfersSendredpackResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type PayCloseOrderResponse ¶ added in v1.0.7
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.7
type PayCloseOrderResult struct {
Result PayCloseOrderResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type PayOrderQueryResponse ¶ added in v1.0.7
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.7
type PayOrderQueryResult struct {
Result PayOrderQueryResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type PayRefundQueryResponse ¶ added in v1.0.7
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.7
type PayRefundQueryResult struct {
Result PayRefundQueryResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type PayUnifiedOrderNotifyHttpRequest ¶ added in v1.0.15
type PayUnifiedOrderNotifyHttpRequest struct {
ReturnCode string `json:"return_code" xml:"return_code"` // 返回状态码
ReturnMsg string `json:"return_msg,omitempty" xml:"return_msg,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"` // 签名
SignType string `json:"sign_type,omitempty" xml:"sign_type,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"` // 错误代码描述
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"` // 交易类型
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 string `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"` // 支付完成时间
}
PayUnifiedOrderNotifyHttpRequest 小程序支付 - 统一下单 - 回调通知 - 请求参数
type PayUnifiedOrderResponse ¶ added in v1.0.7
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.7
type PayUnifiedOrderResult struct {
Result PayUnifiedOrderResponse // 结果
Body []byte // 内容
Http gorequest.Response // 请求
}
type SecApiPayRefundNotifyHttpRequest ¶ added in v1.0.15
type SecApiPayRefundNotifyHttpRequest struct {
ReturnCode string `json:"return_code" xml:"return_code"` // 返回状态码
ReturnMsg string `json:"return_msg,omitempty" xml:"return_msg,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"` // 随机字符串
ReqInfo string `json:"req_info,omitempty" xml:"req_info,omitempty"` // 加密信息
}
SecApiPayRefundNotifyHttpRequest 小程序支付 - 申请退款 - 回调通知 - 请求参数
type SecApiPayRefundResponse ¶ added in v1.0.7
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.7
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 // 请求
}
Source Files
¶
- cert.go
- client.config.go
- client.const.go
- client.go
- client.opentelemetry.go
- get.sign.go
- mmpaymkttransfers.gethbinfo.go
- mmpaymkttransfers.gettransferinfo.go
- mmpaymkttransfers.promotion.transfers.go
- mmpaymkttransfers.sendgroupredpack.go
- mmpaymkttransfers.sendredpack.go
- pay.closeorder.go
- pay.orderquery.go
- pay.refundquery.go
- pay.unifiedorder.go
- pay.unifiedorder.notify.http.go
- request.go
- secapi.pay.refund.go
- secapi.pay.refund.notify.http.go
- sign.go
- version.go