Documentation
¶
Overview ¶
Package wxpay 微信支付
Index ¶
- Variables
- type Client
- type Config
- type PaymentNotifyParams
- type RefundNotifyParams
- type Server
- func (s *Server) PaymentNotify(request *http.Request) (params PaymentNotifyParams, err error)
- func (s *Server) RefundNotify(request *http.Request) (params RefundNotifyParams, err error)
- func (s *Server) ResponsePaymentParams(writer http.ResponseWriter, request *http.Request, prepayId string) (err error)
- func (s *Server) ResponseSuccess(writer http.ResponseWriter, request *http.Request) (err error)
- type WXPay
Constants ¶
This section is empty.
Variables ¶
View Source
var WXPayServerUrl = "https://api.mch.weixin.qq.com"
微信 api 服务器地址
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Appid string Mchid string // 商户 id ApiKey string // 商户 api key IsSandBoxMode bool // 是否开启沙箱模式 Cert string // 证书路径 }
微信支付配置
type PaymentNotifyParams ¶
type PaymentNotifyParams struct { ReturnCode string `xml:"return_code"` ReturnMsg string `xml:"return_msg"` Appid string `xml:"appid" json:"appid"` Mchid string `xml:"mch_id"` DeviceInfo string `xml:"device_info"` NonceStr string `xml:"nonce_str"` Sign string `xml:"sign"` SignType string `xml:"sign_type"` ResultCode string `xml:"result_code"` ErrCode string `xml:"err_code"` ErrCodeDes string `xml:"err_code_des"` Openid string `xml:"openid"` IsSubscribe string `xml:"is_subscribe"` TradeType string `xml:"trade_type"` BankType string `xml:"bank_type"` TotalFee string `xml:"total_fee"` SettlementTotalFee string `xml:"settlement_total_fee"` FeeType string `xml:"fee_type"` CashFee string `xml:"cash_fee"` CashFeeType string `xml:"cash_fee_type"` CouponFee string `xml:"coupon_fee"` CouponCount string `xml:"coupon_count"` CouponType0 string `xml:"coupon_type_0"` CouponID0 string `xml:"coupon_id_0"` CouponFee0 string `xml:"coupon_fee_0"` TransactionID string `xml:"transaction_id"` OutTradeNo string `xml:"out_trade_no"` Attach string `xml:"attach"` TimeEnd string `xml:"time_end"` }
type RefundNotifyParams ¶
type RefundNotifyParams 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 string `xml:"settlement_refund_fee"` SettlementTotalFee string `xml:"settlement_total_fee"` SuccessTime string `xml:"success_time"` TotalFee string `xml:"total_fee"` TransactionID string `xml:"transaction_id"` }
type Server ¶
type Server struct {
Ctx *WXPay
}
响应微信请求 或 推送消息/事件 的服务器
func (*Server) PaymentNotify ¶
func (s *Server) PaymentNotify(request *http.Request) (params PaymentNotifyParams, err error)
支付结果 回调
func (*Server) RefundNotify ¶
func (s *Server) RefundNotify(request *http.Request) (params RefundNotifyParams, err error)
退款结果 回调
func (*Server) ResponsePaymentParams ¶
func (s *Server) ResponsePaymentParams(writer http.ResponseWriter, request *http.Request, prepayId string) (err error)
响应 客户端 支付参数
func (*Server) ResponseSuccess ¶
ResponseSuccess 响应微信消息
<xml> <return_code><![CDATA[SUCCESS]]></return_code> <return_msg><![CDATA[OK]]></return_msg> </xml>
Directories
¶
Path | Synopsis |
---|---|
Package test 模拟微信服务器 测试
|
Package test 模拟微信服务器 测试 |
Package ecb implements block cipher mode of encryption ECB (Electronic Code Book) functions.
|
Package ecb implements block cipher mode of encryption ECB (Electronic Code Book) functions. |
Click to show internal directories.
Click to hide internal directories.