Documentation
¶
Index ¶
Constants ¶
View Source
const ( UnifiedOrerWCPayRequest = []string{"appid", "mch_id", "nonce_str", "sign", "body", "out_trade_no", "total_fee", "spbill_create_ip", "notify_url", "trade_type"} QueryOrderWCPayRequest = []string{"appid", "mch_id", "nonce_str", "sign", "transaction_id"} CloseOrderWCPayRequest = []string{"appid", "mch_id", "nonce_str", "sign", "out_trade_no"} RefundWCPayRequest = []string{"appid", "mch_id", "nonce_str", "sign", "transaction_id", "out_refund_no", "total_fee", "refund_fee"} )
Variables ¶
View Source
var ( Appid string MchId string AppSecret string Key string ApiclientCert *x509.Certificate ApiclientKey interface{} )
Functions ¶
func GenerateBatchNo ¶
func GenerateBatchNo() (batchNo string)
func SetApiclientByPkcs12 ¶
Types ¶
type CloseOrderResult ¶
type CloseOrderResult struct {
XMLName xml.Name `xml:"xml"`
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Appid string `xml:"appid"`
MchId string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
ResultCode string `xml:"result_code"`
ResultMsg string `xml:"result_msg"`
}
func CloseOrder ¶
func CloseOrder(options map[string]string) (result CloseOrderResult, err error)
取消订单
type QueryOrderResult ¶
type QueryOrderResult struct {
XMLName xml.Name `xml:"xml"`
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Appid string `xml:"appid"`
MchId string `xml:"mch_id"`
DeviceInfo string `xml:"device_info"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
ResultCode string `xml:"result_code"`
Openid string `xml:"openid"`
IsSubscribe string `xml:"is_subscribe"`
TradeType string `xml:"trade_type"`
BankType string `xml:"bank_type"`
TotalFee string `xml:"total_fee"`
FeeType string `xml:"fee_type"`
TransactionId string `xml:"transaction_id"`
OutTradeNo string `xml:"out_trade_no"`
Attach string `xml:"attach"`
TimeEnd string `xml:"time_end"`
TradeState string `xml:"trade_state"`
}
func QueryOrder ¶
func QueryOrder(options map[string]string) (result QueryOrderResult, err error)
订单查询
type RefundResult ¶
type RefundResult struct {
XMLName xml.Name `xml:"xml"`
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Appid string `xml:"appid"`
MchId string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Sign string `xml:"sign"`
ResultCode string `xml:"result_code"`
TransactionId string `xml:"transaction_id"`
OutTradeNo string `xml:"out_trade_no"`
OutRefundNo string `xml:"out_refund_no"`
RefundId string `xml:"refund_id"`
RefundFee string `xml:"refund_fee"`
}
type UnifiedOrderResult ¶
type UnifiedOrderResult struct {
XMLName xml.Name `xml:"xml"`
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
Appid string `xml:"appid"`
MchId string `xml:"mch_id"`
NonceStr string `xml:"nonce_str"`
Openid string `xml:"openid"`
Sign string `xml:"sign"`
TradeType string `xml:"trade_type"`
PrepayId string `xml:"prepay_id"`
ResultCode string `xml:"result_code"`
CodeUrl string `xml:"code_url"`
}
func UnifiedOrder ¶
func UnifiedOrder(options map[string]string) (result UnifiedOrderResult, err error)
统一下单
Click to show internal directories.
Click to hide internal directories.