wx

package
v0.0.0-...-5cfecba Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2018 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ReFundURL = "https://api.mch.weixin.qq.com/secapi/pay/refund"

退款URL

View Source
var UnifiedOrderURL = "https://api.mch.weixin.qq.com/pay/unifiedorder"

统一下单URL

Functions

This section is empty.

Types

type NativePayParams

type NativePayParams struct {
	Appid  string `xml:"appid"` //公众账号ID
	Attach string `xml:"attach"`
	Body   string `xml:"body"`   //商品描述
	MchID  string `xml:"mch_id"` //商户号

	NonceStr  string `xml:"nonce_str"`  //随机字符串
	NotifyURL string `xml:"notify_url"` //通知地址
	// Openid         string `xml:"openid"`           //用户标识	trade_type=JSAPI时(即公众号支付),此参数必传,此参数为微信用户在商户对应appid下的唯一标识
	OutTradeNO string `xml:"out_trade_no"` //商户订单号
	// ProductID      string `xml:"product_id"`       //非必填,trade_type=NATIVE时(即扫码支付),此参数必传。此参数为二维码中包含的商品ID,商户自行定义。
	SpbillCreateIP string `xml:"spbill_create_ip"` //终端IP
	TotalFee       int64  `xml:"total_fee"`        //标价金额
	TradeType      string `xml:"trade_type"`       //交易类型
	Sign           string `xml:"sign"`             //签名

}

支付请求参数

type NotifyReturn

type NotifyReturn struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
}

type PayNotify

type PayNotify struct {
	Appid         string  `xml:"appid"`
	Attach        string  `xml:"attach"`    //
	BankType      string  `xml:"bank_type"` //付款银行
	CashFee       float64 `xml:"cash_fee"`  //现金支付金额
	FeeType       string  `xml:"fee_type"`  //现金支付金额
	IsSubscribe   string  `xml:"is_subscribe"`
	MchID         string  `xml:"mch_id"`
	NonceStr      string  `xml:"nonce_str"`
	OpenID        string  `xml:"openid"` //用户标识
	OutTradeNo    string  `xml:"out_trade_no"`
	ResultCode    string  `xml:"result_code"`
	ReturnCode    string  `xml:"return_code"`
	Sign          string  `xml:"sign"`
	TimeEnd       string  `xml:"time_end"`
	TotalFee      float64 `xml:"total_fee"`
	TradeType     string  `xml:"trade_type"`
	TransactionID string  `xml:"transaction_id"` //微信支付订单号

}

通知回调数据

type RefundNotify

type RefundNotify struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
	Appid      string `xml:"appid"`
	MchID      string `xml:"mch_id"`
	NonceStr   string `xml:"nonce_str"`
	ReqInfo    string `xml:"req_info"`
}

type RefundNotifyDecrypt

type RefundNotifyDecrypt struct {
	OutRefundNO         string  `xml:"out_refund_no"`
	OutTradeNO          string  `xml:"out_trade_no"`
	RefundAccount       string  `xml:"refund_account"`
	RefundFee           string  `xml:"refund_fee"`
	RefundID            string  `xml:"refund_id"`
	RefundRecvAccout    string  `xml:"refund_recv_accout"`
	RefundRequestSource string  `xml:"refund_request_source"`
	RefundStatus        string  `xml:"refund_status"`
	SettlementRefundFee float64 `xml:"settlement_refund_fee"`
	SettlementTotalFee  float64 `xml:"settlement_total_fee"`
	SuccessTime         string  `xml:"success_time"`
	TotalFee            float64 `xml:"total_fee"`
	TransactionID       string  `xml:"transaction_id"`
}

type RefundParams

type RefundParams struct {
	Appid       string `xml:"appid"`
	MchID       string `xml:"mch_id"`
	NonceStr    string `xml:"nonce_str"`
	NotifyURL   string `xml:"notify_url"`
	OutRefundNo string `xml:"out_refund_no"`

	OutTradeNo string `xml:"out_trade_no"`
	RefundDesc string `xml:"refund_desc"`

	RefundFee int64 `xml:"refund_fee"`

	Sign     string `xml:"sign"`
	TotalFee int64  `xml:"total_fee"`
}

退款申请请求参数

type RefundReturn

type RefundReturn struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
	ResultCode string `xml:"result_code"`
	ErrCode    string `xml:"err_code"`
	ErrCodeDes string `xml:"err_code_des"`
}

退款申请请求返回信息

type ReturnMsg

type ReturnMsg struct {
	ReturnCode string `xml:"return_code"`
	ReturnMsg  string `xml:"return_msg"`
	ResultCode string `xml:"result_code"`
	PrepayID   string `xml:"prepay_id"`
	CodeURL    string `xml:"code_url"`
	ErrCode    string `xml:"err_code"`
	ErrCodeDes string `xml:"err_code_des"`
}

回调返回信息

type WxPayControl

type WxPayControl struct{}

func (WxPayControl) GetWxPay

func (WxPayControl) GetWxPay(dbOrder *order.Order, userid string) (ReturnMsg, error)

func (WxPayControl) Notify

func (WxPayControl) Notify(c *gin.Context)

func (WxPayControl) Pay

func (wxpay WxPayControl) Pay(c *gin.Context)

获取微信支付号

type WxRefundControl

type WxRefundControl struct{}

func (WxRefundControl) Notify

func (WxRefundControl) Notify(c *gin.Context)

微信退款通知

func (WxRefundControl) Refund

func (WxRefundControl) Refund(outTradeNo, outRefundNo string, totalFee, refundFee int64, refundDesc string) error

Refund func outTradeNo 订单号 outRefundNo系统内部订单号orderid,totalFee订单金额 refundFee退款金额

Jump to

Keyboard shortcuts

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