Documentation ¶
Index ¶
Constants ¶
View Source
const ( ServiceCloseOrder = "CloseOrder" ServiceQueryTrxState = "QueryTrxState" ServiceMPCreateTrade = "MPCreateTrade" ServicePayResultMerNotify = "PayResultMerNotify" )
View Source
const ( ReturnCodeSuccess = "000000" ReturnCodeInvalidSign = "100036" )
Variables ¶
View Source
var ErrInvalidSign = errors.New("invalid sign")
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) ReadNotify ¶
func (c *Client) ReadNotify(httpReq *http.Request) (req *PayResultMerNotifyRequest, err error)
type CloseOrderRequest ¶
type CloseOrderRequest struct { RequestCommon TradeNo string `json:"tradeNo"` OriginTradeNo string `json:"originTradeNo"` OrderID string `json:"orderId"` NotifyURL string `json:"notifyUrl"` }
type CloseOrderResponse ¶
type CloseOrderResponse struct { ResponseCommon State string `json:"state"` }
type MPCreateTradeRequest ¶
type MPCreateTradeRequest struct { RequestCommon TradeNo string `json:"tradeNo"` TradeChannel string `json:"tradeChannel"` BusinessType string `json:"businessType"` TotalAmt string `json:"totalAmt"` TotalNum string `json:"totalNum"` OrderDesc string `json:"orderDesc"` OnlineFlag string `json:"onlineFlag"` EventFlag string `json:"eventFlag"` Ccy string `json:"ccy"` SubOpenID string `json:"subOpenId"` SubAppID string `json:"subAppId"` NotifyURL string `json:"notifyUrl"` }
type MPCreateTradeResponse ¶
type MPCreateTradeResponse struct { ResponseCommon TradeNo string `json:"tradeNo"` State string `json:"state"` OrderID string `json:"orderId"` TradeTime string `json:"tradeTime"` WxPayData struct { TimeStamp string `json:"timeStamp"` Package string `json:"package"` PaySign string `json:"paySign"` AppID string `json:"appId"` SignType string `json:"signType"` NonceStr string `json:"nonceStr"` } `json:"wxPayData"` }
type PayResultMerNotifyRequest ¶
type PayResultMerNotifyRequest struct { RequestCommon Code string `json:"code"` Msg string `json:"msg"` TradeNo string `json:"tradeNo"` State string `json:"state"` OrderID string `json:"orderId"` TradeTime string `json:"tradeTime"` TotalAmt string `json:"totalAmt"` PaidAmt string `json:"paidAmt"` DiscountAmt int `json:"discountAmt"` }
type PayResultMerNotifyResponse ¶
type PayResultMerNotifyResponse struct {
ResponseCommon
}
type QueryTrxStateRequest ¶
type QueryTrxStateRequest struct { RequestCommon TradeNo string `json:"tradeNo"` }
type QueryTrxStateResponse ¶
type QueryTrxStateResponse struct { ResponseCommon TradeNo string `json:"tradeNo"` State string `json:"state"` OrderID string `json:"orderId"` BuyerAnonyID string `json:"buyerAnonyId"` TotalAmt string `json:"totalAmt"` PaidAmt string `json:"paidAmt"` DiscountAmt string `json:"discountAmt"` PayTime string `json:"payTime"` }
type RequestCommon ¶
type ResponseCommon ¶
type ResponseCommon struct { Code string `json:"code"` Msg string `json:"msg"` SubCode string `json:"subCode"` SubMsg string `json:"subMsg"` }
func (ResponseCommon) Err ¶
func (r ResponseCommon) Err() error
Click to show internal directories.
Click to hide internal directories.