wechatpayapiv3

package
v1.0.47 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

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 *ConfigClient) (*Client, error)

func (*Client) GetAppId added in v1.0.47

func (c *Client) GetAppId() string

func (*Client) GetJsApi added in v1.0.47

func (c *Client) GetJsApi(param GetJsApi) (result GetJsApiResult, err error)

GetJsApi JSAPI调起支付API https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_4.shtml

func (*Client) GetMchId added in v1.0.47

func (c *Client) GetMchId() string

func (*Client) GetMchSslKey added in v1.0.47

func (c *Client) GetMchSslKey() string

func (*Client) GetMchSslSerialNo added in v1.0.47

func (c *Client) GetMchSslSerialNo() string

func (*Client) MerchantServiceComplaintsV2 added in v1.0.47

func (c *Client) MerchantServiceComplaintsV2(notMustParams ...gorequest.Params) *MerchantServiceComplaintsV2Result

MerchantServiceComplaintsV2 查询投诉单列表API https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter10_2_11.shtml

func (*Client) PayTransactionsId added in v1.0.47

func (c *Client) PayTransactionsId(transactionId string) *PayTransactionsIdResult

PayTransactionsId 微信支付订单号查询 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_2.shtml

func (*Client) PayTransactionsJsapi added in v1.0.47

func (c *Client) PayTransactionsJsapi(notMustParams ...gorequest.Params) *PayTransactionsJsapiResult

PayTransactionsJsapi 小程序 JSAPI下单 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_5_1.shtml

func (*Client) PayTransactionsOutTradeNo added in v1.0.47

func (c *Client) PayTransactionsOutTradeNo(outTradeNo string) *PayTransactionsOutTradeNoResult

PayTransactionsOutTradeNo 商户订单号查询 https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_2.shtml

func (*Client) PayTransactionsOutTradeNoClose added in v1.0.47

func (c *Client) PayTransactionsOutTradeNoClose(OutTradeNo string) *PayTransactionsOutTradeNoCloseResult

PayTransactionsOutTradeNoClose 关闭订单API https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter3_1_3.shtml

func (*Client) RefundDomesticRefunds added in v1.0.47

func (c *Client) RefundDomesticRefunds(notMustParams ...gorequest.Params) *RefundDomesticRefundsResult

RefundDomesticRefunds 申请退款API https://pay.weixin.qq.com/wiki/doc/apiv3/apis/chapter6_1_26.shtml

func (*Client) RefundDomesticRefundsOutRefundNo added in v1.0.47

func (c *Client) RefundDomesticRefundsOutRefundNo(outRefundNo string) *RefundDomesticRefundsOutRefundNoResult

RefundDomesticRefundsOutRefundNo 查询单笔退款API https://pay.weixin.qq.com/wiki/doc/apiv3_partner/apis/chapter4_5_10.shtml

func (*Client) SetAppId added in v1.0.47

func (c *Client) SetAppId(appId string)

func (*Client) SetAppSecret added in v1.0.47

func (c *Client) SetAppSecret(appSecret string)

type ConfigClient added in v1.0.47

type ConfigClient struct {
	AppId          string            // 小程序或者公众号唯一凭证
	AppSecret      string            // 小程序或者公众号唯一凭证密钥
	MchId          string            // 微信支付的商户id
	AesKey         string            // 私钥
	ApiV3          string            // API v3密钥
	MchSslSerialNo string            // pem 证书号
	MchSslKey      string            // pem key 内容
	MongoDb        *dorm.MongoClient // 日志数据库
	PgsqlDb        *gorm.DB          // 日志数据库
	DatabaseName   string            // 库名
}

type GetJsApi

type GetJsApi struct {
	Package string `json:"package"`
}

GetJsApi 入参

type GetJsApiResult

type GetJsApiResult struct {
	AppId     string // 应用ID
	TimeStamp string // 时间戳
	NonceStr  string // 随机字符串
	Package   string // 订单详情扩展字符串
	SignType  string // 签名方式
	PaySign   string // 签名
}

GetJsApiResult 返回参数

type MerchantServiceComplaintsV2Response added in v1.0.47

type MerchantServiceComplaintsV2Response struct {
	Appid          string `json:"appid"`
	Mchid          string `json:"mchid"`
	OutTradeNo     string `json:"out_trade_no"`
	TransactionId  string `json:"transaction_id,omitempty"`
	TradeType      string `json:"trade_type,omitempty"`
	TradeState     string `json:"trade_state"`
	TradeStateDesc string `json:"trade_state_desc"`
	BankType       string `json:"bank_type,omitempty"`
	Attach         string `json:"attach,omitempty"`
	SuccessTime    string `json:"success_time,omitempty"`
	Payer          struct {
		Openid string `json:"openid"`
	} `json:"payer"`
	Amount struct {
		Total         int    `json:"total,omitempty"`
		PayerTotal    int    `json:"payer_total,omitempty"`
		Currency      string `json:"currency,omitempty"`
		PayerCurrency string `json:"payer_currency,omitempty"`
	} `json:"amount,omitempty"`
	SceneInfo struct {
		DeviceId string `json:"device_id,omitempty"`
	}
	PromotionDetail []struct {
		CouponId            string `json:"coupon_id"`
		Name                string `json:"name,omitempty"`
		Scope               string `json:"scope,omitempty"`
		Type                string `json:"type,omitempty"`
		Amount              int    `json:"amount"`
		StockId             string `json:"stock_id,omitempty"`
		WechatpayContribute int    `json:"wechatpay_contribute,omitempty"`
		MerchantContribute  int    `json:"merchant_contribute,omitempty"`
		OtherContribute     int    `json:"other_contribute,omitempty"`
		Currency            string `json:"currency,omitempty"`
		GoodsDetail         []struct {
			GoodsId        string `json:"goods_id"`
			Quantity       int    `json:"quantity"`
			UnitPrice      int    `json:"unit_price"`
			DiscountAmount int    `json:"discount_amount"`
			GoodsRemark    string `json:"goods_remark,omitempty"`
		} `json:"goods_detail"`
	}
}

type MerchantServiceComplaintsV2Result added in v1.0.47

type MerchantServiceComplaintsV2Result struct {
	Result MerchantServiceComplaintsV2Response // 结果
	Body   []byte                              // 内容
	Http   gorequest.Response                  // 请求
	Err    error                               // 错误
}

type PayTransactionsIdResponse added in v1.0.44

type PayTransactionsIdResponse struct {
	Appid          string `json:"appid"`
	Mchid          string `json:"mchid"`
	OutTradeNo     string `json:"out_trade_no"`
	TransactionId  string `json:"transaction_id,omitempty"`
	TradeType      string `json:"trade_type,omitempty"`
	TradeState     string `json:"trade_state"`
	TradeStateDesc string `json:"trade_state_desc"`
	BankType       string `json:"bank_type,omitempty"`
	Attach         string `json:"attach,omitempty"`
	SuccessTime    string `json:"success_time,omitempty"`
	Payer          struct {
		Openid string `json:"openid"`
	} `json:"payer"`
	Amount struct {
		Total         int    `json:"total,omitempty"`
		PayerTotal    int    `json:"payer_total,omitempty"`
		Currency      string `json:"currency,omitempty"`
		PayerCurrency string `json:"payer_currency,omitempty"`
	} `json:"amount,omitempty"`
	SceneInfo struct {
		DeviceId string `json:"device_id,omitempty"`
	}
	PromotionDetail []struct {
		CouponId            string `json:"coupon_id"`
		Name                string `json:"name,omitempty"`
		Scope               string `json:"scope,omitempty"`
		Type                string `json:"type,omitempty"`
		Amount              int    `json:"amount"`
		StockId             string `json:"stock_id,omitempty"`
		WechatpayContribute int    `json:"wechatpay_contribute,omitempty"`
		MerchantContribute  int    `json:"merchant_contribute,omitempty"`
		OtherContribute     int    `json:"other_contribute,omitempty"`
		Currency            string `json:"currency,omitempty"`
		GoodsDetail         []struct {
			GoodsId        string `json:"goods_id"`
			Quantity       int    `json:"quantity"`
			UnitPrice      int    `json:"unit_price"`
			DiscountAmount int    `json:"discount_amount"`
			GoodsRemark    string `json:"goods_remark,omitempty"`
		} `json:"goods_detail"`
	}
}

type PayTransactionsIdResult

type PayTransactionsIdResult struct {
	Result PayTransactionsIdResponse // 结果
	Body   []byte                    // 内容
	Http   gorequest.Response        // 请求
	Err    error                     // 错误
}

type PayTransactionsJsapiResponse added in v1.0.44

type PayTransactionsJsapiResponse struct {
	PrepayId string `json:"prepay_id"`
}

type PayTransactionsJsapiResult

type PayTransactionsJsapiResult struct {
	Result PayTransactionsJsapiResponse // 结果
	Body   []byte                       // 内容
	Http   gorequest.Response           // 请求
	Err    error                        // 错误
}

type PayTransactionsOutTradeNoCloseResult added in v1.0.44

type PayTransactionsOutTradeNoCloseResult struct {
	Body []byte             // 内容
	Http gorequest.Response // 请求
	Err  error              // 错误
}

type PayTransactionsOutTradeNoResponse added in v1.0.44

type PayTransactionsOutTradeNoResponse struct {
	Appid          string `json:"appid"`
	Mchid          string `json:"mchid"`
	OutTradeNo     string `json:"out_trade_no"`
	TransactionId  string `json:"transaction_id,omitempty"`
	TradeType      string `json:"trade_type,omitempty"`
	TradeState     string `json:"trade_state"`
	TradeStateDesc string `json:"trade_state_desc"`
	BankType       string `json:"bank_type,omitempty"`
	Attach         string `json:"attach,omitempty"`
	SuccessTime    string `json:"success_time,omitempty"`
	Payer          struct {
		Openid string `json:"openid"`
	} `json:"payer"`
	Amount struct {
		Total         int    `json:"total,omitempty"`
		PayerTotal    int    `json:"payer_total,omitempty"`
		Currency      string `json:"currency,omitempty"`
		PayerCurrency string `json:"payer_currency,omitempty"`
	} `json:"amount,omitempty"`
	SceneInfo struct {
		DeviceId string `json:"device_id,omitempty"`
	} `json:"scene_info"`
	PromotionDetail []struct {
		CouponId            string `json:"coupon_id"`
		Name                string `json:"name,omitempty"`
		Scope               string `json:"scope,omitempty"`
		Type                string `json:"type,omitempty"`
		Amount              int    `json:"amount"`
		StockId             string `json:"stock_id,omitempty"`
		WechatpayContribute int    `json:"wechatpay_contribute,omitempty"`
		MerchantContribute  int    `json:"merchant_contribute,omitempty"`
		OtherContribute     int    `json:"other_contribute,omitempty"`
		Currency            string `json:"currency,omitempty"`
		GoodsDetail         []struct {
			GoodsId        string `json:"goods_id"`
			Quantity       int    `json:"quantity"`
			UnitPrice      int    `json:"unit_price"`
			DiscountAmount int    `json:"discount_amount"`
			GoodsRemark    string `json:"goods_remark,omitempty"`
		} `json:"goods_detail"`
	} `json:"promotion_detail"`
}

type PayTransactionsOutTradeNoResult

type PayTransactionsOutTradeNoResult struct {
	Result PayTransactionsOutTradeNoResponse // 结果
	Body   []byte                            // 内容
	Http   gorequest.Response                // 请求
	Err    error                             // 错误
}

type RefundDomesticRefundsOutRefundNoResponse added in v1.0.44

type RefundDomesticRefundsOutRefundNoResponse struct {
	RefundId            string `json:"refund_id"`               // 微信支付退款单号
	OutRefundNo         string `json:"out_refund_no"`           // 商户退款单号
	TransactionId       string `json:"transaction_id"`          // 微信支付订单号
	OutTradeNo          string `json:"out_trade_no"`            // 商户订单号
	Channel             string `json:"channel"`                 // 退款渠道
	UserReceivedAccount string `json:"user_received_account"`   // 退款入账账户
	SuccessTime         string `json:"success_time,omitempty"`  // 退款成功时间
	CreateTime          string `json:"create_time"`             // 退款创建时间
	Status              string `json:"status"`                  // 退款状态
	FundsAccount        string `json:"funds_account,omitempty"` // 资金账户
	Amount              struct {
		Total  int `json:"total"`  // 订单金额
		Refund int `json:"refund"` // 退款金额
		From   []struct {
			Account string `json:"account"` // 出资账户类型
			Amount  int    `json:"amount"`  // 出资金额
		} `json:"from,omitempty"`
		PayerTotal       int    `json:"payer_Total"`       // 用户支付金额
		PayerRefund      int    `json:"payer_Refund"`      // 用户退款金额
		SettlementRefund int    `json:"settlement_Refund"` // 应结退款金额
		SettlementTotal  int    `json:"settlement_total"`  // 应结订单金额
		DiscountRefund   int    `json:"discount_refund"`   // 优惠退款金额
		Currency         string `json:"currency"`          // 退款币种
	} `json:"amount"` // 金额信息
	PromotionDetail []struct {
		PromotionId  string `json:"promotion_id"`  // 券ID
		Scope        string `json:"scope"`         // 优惠范围
		Type         string `json:"type"`          // 优惠类型
		Amount       int    `json:"amount"`        // 优惠券面额
		RefundAmount int    `json:"refund_amount"` // 优惠退款金额
		GoodsDetail  []struct {
			MerchantGoodsId  string `json:"merchant_goods_id"`            // 商户侧商品编码
			WechatpayGoodsId string `json:"wechatpay_goods_id,omitempty"` // 微信侧商品编码
			GoodsName        string `json:"goods_name,omitempty"`         // 商品名称
			UnitPrice        int    `json:"unit_price"`                   // 商品单价
			RefundAmount     int    `json:"refund_amount"`                // 商品退款金额
			RefundQuantity   int    `json:"refund_quantity"`              // 商品退货数量
		} `json:"goods_detail"`
	} `json:"promotion_detail,omitempty"` // 优惠退款信息
}

type RefundDomesticRefundsOutRefundNoResult added in v1.0.38

type RefundDomesticRefundsOutRefundNoResult struct {
	Result RefundDomesticRefundsOutRefundNoResponse // 结果
	Body   []byte                                   // 内容
	Http   gorequest.Response                       // 请求
	Err    error                                    // 错误
}

type RefundDomesticRefundsResponse added in v1.0.44

type RefundDomesticRefundsResponse struct {
	RefundId            string `json:"refund_id"`               // 微信支付退款单号
	OutRefundNo         string `json:"out_refund_no"`           // 商户退款单号
	TransactionId       string `json:"transaction_id"`          // 微信支付订单号
	OutTradeNo          string `json:"out_trade_no"`            // 商户订单号
	Channel             string `json:"channel"`                 // 退款渠道
	UserReceivedAccount string `json:"user_received_account"`   // 退款入账账户
	SuccessTime         string `json:"success_time,omitempty"`  // 退款成功时间
	CreateTime          string `json:"create_time"`             // 退款创建时间
	Status              string `json:"status"`                  // 退款状态
	FundsAccount        string `json:"funds_account,omitempty"` // 资金账户
	Amount              struct {
		Total  int `json:"total"`  // 订单金额
		Refund int `json:"refund"` // 退款金额
		From   []struct {
			Account string `json:"account"` // 出资账户类型
			Amount  int    `json:"amount"`  // 出资金额
		} `json:"from,omitempty"`
		PayerTotal       int    `json:"payer_Total"`       // 用户支付金额
		PayerRefund      int    `json:"payer_Refund"`      // 用户退款金额
		SettlementRefund int    `json:"settlement_Refund"` // 应结退款金额
		SettlementTotal  int    `json:"settlement_total"`  // 应结订单金额
		DiscountRefund   int    `json:"discount_refund"`   // 优惠退款金额
		Currency         string `json:"currency"`          // 退款币种
	} `json:"amount"` // 金额信息
	PromotionDetail []struct {
		PromotionId  string `json:"promotion_id"`  // 券ID
		Scope        string `json:"scope"`         // 优惠范围
		Type         string `json:"type"`          // 优惠类型
		Amount       int    `json:"amount"`        // 优惠券面额
		RefundAmount int    `json:"refund_amount"` // 优惠退款金额
		GoodsDetail  []struct {
			MerchantGoodsId  string `json:"merchant_goods_id"`            // 商户侧商品编码
			WechatpayGoodsId string `json:"wechatpay_goods_id,omitempty"` // 微信侧商品编码
			GoodsName        string `json:"goods_name,omitempty"`         // 商品名称
			UnitPrice        int    `json:"unit_price"`                   // 商品单价
			RefundAmount     int    `json:"refund_amount"`                // 商品退款金额
			RefundQuantity   int    `json:"refund_quantity"`              // 商品退货数量
		} `json:"goods_detail"`
	} `json:"promotion_detail,omitempty"` // 优惠退款信息
}

type RefundDomesticRefundsResult added in v1.0.38

type RefundDomesticRefundsResult struct {
	Result RefundDomesticRefundsResponse // 结果
	Body   []byte                        // 内容
	Http   gorequest.Response            // 请求
	Err    error                         // 错误
}

Jump to

Keyboard shortcuts

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