Documentation ¶
Index ¶
- Constants
- func DoWXRefund(transactionID, outRefundNo string, totalFee, refundFee int, refundDesc string) error
- func GetTransferInfo(tradeNO string)
- type Client
- func (c *Client) CheckSign(params WXPayParams) bool
- func (c *Client) Encode(params WXPayParams) io.Reader
- func (c *Client) SetTimeout(d time.Duration)
- func (c *Client) Sign(params WXPayParams) string
- func (c *Client) WithCert(certFile, keyFile string) error
- func (c *Client) WithCertBytes(cert, key []byte) error
- type GetTransferInfoRsp
- type WXPayParams
- type WeiXinTransferPayRsp
Constants ¶
View Source
const ( //WX_APP_ID = "wxb7107d9243749e29" //小程序id //WX_MCH_ID = "1543115441" //WX_APP_KEY = "bt7U56KBDNgXzaVLAOpTJE2eOziTrz2T" WX_TRANSFERS_URL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/promotion/transfers" WX_TRANSFERSinfo_URL = "https://api.mch.weixin.qq.com/mmpaymkttransfers/gettransferinfo" WX_UNIFIED_ORDER = "https://api.mch.weixin.qq.com/pay/unifiedorder" WX_REFUND_URL = "https://api.mch.weixin.qq.com/secapi/pay/refund" WX_NotifyURL = "https://api.yjlsj.cn/v1/wx/pay_callback" )
地址的定义
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct { AppId string MchId string ApiKey string WXKey []byte WXCert []byte // contains filtered or unexported fields }
API客户端
var WXPayClient *Client // InitWXPayClient(WX_APP_ID, WX_MCH_ID, WX_APP_KEY)
func InitWXPayClient ¶
实例化API客户端
func (*Client) WithCertBytes ¶
type GetTransferInfoRsp ¶
type GetTransferInfoRsp struct { XMLName xml.Name `xml:"xml"` ReturnCode string `xml:"return_code"` ReturnMsg string `xml:"return_msg"` ResultCode string `xml:"result_code"` MchID string `xml:"mch_id"` AppID string `xml:"appid"` DetailID string `xml:"detail_id"` PartnerTradeNo string `xml:"partner_trade_no"` Status string `xml:"status"` PaymentAmount string `xml:"payment_amount"` Openid string `xml:"openid"` TransferTime string `xml:"transfer_time"` TransferName string `xml:"transfer_name"` Desc string `xml:"desc"` Reason string `xml:"reason"` }
type WXPayParams ¶
func PlaceAnWXPayOrder ¶
func PlaceAnWXPayOrder(orderNo, orderBody string, totalFee int, clientIP, notifyURL, openID string) (*WXPayParams, error)
用户下单
func (WXPayParams) GetInt64 ¶
func (p WXPayParams) GetInt64(k string) int64
func (WXPayParams) GetString ¶
func (p WXPayParams) GetString(k string) string
func (WXPayParams) SetInt64 ¶
func (p WXPayParams) SetInt64(k string, i int64)
func (WXPayParams) SetString ¶
func (p WXPayParams) SetString(k, s string)
type WeiXinTransferPayRsp ¶
type WeiXinTransferPayRsp struct { XMLName xml.Name `xml:"xml"` ReturnCode string `xml:"return_code"` ReturnMsg string `xml:"return_msg"` ResultCode string `xml:"result_code"` MchAppid string `xml:"mch_appid"` Mchid string `xml:"mchid"` NonceStr string `xml:"nonce_str"` PartnerTradeNo string `xml:"partner_trade_no"` PaymentNo string `xml:"payment_no"` PaymentTime string `xml:"payment_time"` ErrCode string `xml:"err_code"` ErrCodeDes string `xml:"err_code_des"` }
func WXTransfer ¶
func WXTransfer(amount int, openid, tradeNo, desc, createIP string) (rsp WeiXinTransferPayRsp, err error)
微信企业支付
Click to show internal directories.
Click to hide internal directories.