Documentation ¶
Index ¶
- Constants
- func WxNative(d NativeData) (string, error)
- func WxPayCalcSign(mReq map[string]interface{}, key string) (sign string)
- func WxSecondSign(appId string, timeStamp string, nonceStr string, prepayId string) (string, error)
- type AmountData
- type CloseOrderReq
- type DownloadBillReq
- type DownloadFundFlowReq
- type NativeData
- type NativeReponse
- type OrderQueryReq
- type RefundQueryReq
- type RefundReq
- type UnifyOrderReq
- type WxPayResponse
- func WxCloseOrder(appId string, orderCode string) (WxPayResponse, error)
- func WxDownloadBill(appId string, billDate string) (WxPayResponse, error)
- func WxDownloadFundFlow(appId string, billDate string, accountType string) (WxPayResponse, error)
- func WxOrderQuery(appId string, orderCode string) (WxPayResponse, error)
- func WxRefund(appId string, orderCode string, refundFee int, totalFee int) (WxPayResponse, error)
- func WxRefundQuery(appId string, orderCode string) (WxPayResponse, error)
- func WxUnifiedOrder(appId string, payTitle string, totalFee int, orderCode string, openId string) (WxPayResponse, error)
Constants ¶
View Source
const MchId = "1606577609"
View Source
const MchSecret = "G2ADlVDdTYeGs9MqLQrgKtfFwL5WhF8g"
View Source
const NotifyUrl = "https://api.pubcloud.vip/mall/pay/v1/wxPayCallback"
Variables ¶
This section is empty.
Functions ¶
func WxNative ¶
func WxNative(d NativeData) (string, error)
native下单 https://api.mch.weixin.qq.com/v3/pay/transactions/native
func WxPayCalcSign ¶
Types ¶
type AmountData ¶
type CloseOrderReq ¶
type DownloadBillReq ¶
type DownloadFundFlowReq ¶
type NativeData ¶
type NativeData struct { Appid string `json:"appid"` // 由微信生成的应用ID,全局唯一。 Mchid string `json:"mchid"` // 直连商户的商户号,由微信支付生成并下发。 Description string `json:"description"` // 商品描述 OutTradeNo string `json:"out_trade_no"` // 商户系统内部订单号,只能是数字、大小写字母_-*且在同一个商户号下唯一 TimeExpire string `json:"time_expire,omitempty"` // 订单失效时间 yyyy-MM-DDTHH:mm:ss+TIMEZONE Attach string `json:"attach,omitempty"` // 附加数据,在查询API和支付通知中原样返回,可作为自定义参数使用,实际情况下只有支付完成状态才会返回该字段 NotifyUrl string `json:"notify_url"` // 知URL必须为直接可访问的URL GoodsTag string `json:"goods_tag,omitempty"` // 订单优惠标记 Amount AmountData `json:"amount"` // 订单金额信息 }
type NativeReponse ¶
type NativeReponse struct {
CodeUrl string `json:"code_url"`
}
type OrderQueryReq ¶
type RefundQueryReq ¶
type UnifyOrderReq ¶
type UnifyOrderReq struct { AppId string `xml:"appid"` Body string `xml:"body"` MchId string `xml:"mch_id"` NonceStr string `xml:"nonce_str"` NotifyUrl string `xml:"notify_url"` TradeType string `xml:"trade_type"` SpBillCreateIp string `xml:"spbill_create_ip"` TotalFee int `xml:"total_fee"` OutTradeNo string `xml:"out_trade_no"` Sign string `xml:"sign"` OpenId string `xml:"openid"` }
type WxPayResponse ¶
type WxPayResponse struct { ReturnCode string `xml:"return_code"` ReturnMsg string `xml:"return_msg"` NonceStr string `xml:"nonce_str"` PrepayId string `xml:"prepay_id"` ResultCode string `xml:"result_code"` ErrCodeDes string `xml:"err_code_des"` //SUCCESS--支付成功 //REFUND--转入退款 //NOTPAY--未支付 //CLOSED--已关闭 //REVOKED--已撤销(刷卡支付) //USERPAYING--用户支付中 //PAYERROR--支付失败(其他原因,如银行返回失败) //ACCEPT--已接收,等待扣款 TradeState string `xml:"trade_state"` OpenId string `xml:"openid"` BankType string `xml:"bank_type"` TotalFee int `xml:"total_fee"` TransactionId string `xml:"transaction_id"` TimeEnd string `xml:"time_end"` TradeStateDesc string `xml:"trade_state_desc"` OutTradeNo string `xml:"out_trade_no"` RefundCount int `xml:"refund_count"` OutRefundNo0 string `xml:"out_refund_no_0"` RefundFee0 int `xml:"refund_fee_0"` RefundStatus0 string `xml:"refund_status_0"` RefundSuccessTime0 string `xml:"refund_success_time_0"` }
func WxCloseOrder ¶
func WxCloseOrder(appId string, orderCode string) (WxPayResponse, error)
func WxDownloadBill ¶
func WxDownloadBill(appId string, billDate string) (WxPayResponse, error)
func WxDownloadFundFlow ¶
func WxDownloadFundFlow(appId string, billDate string, accountType string) (WxPayResponse, error)
func WxOrderQuery ¶
func WxOrderQuery(appId string, orderCode string) (WxPayResponse, error)
func WxRefundQuery ¶
func WxRefundQuery(appId string, orderCode string) (WxPayResponse, error)
func WxUnifiedOrder ¶
Click to show internal directories.
Click to hide internal directories.