Jerry před 6 roky
rodič
revize
197e9b4a8d
1 změnil soubory, kde provedl 190 přidání a 190 odebrání
  1. 190 190
      wechat_rsp.go

+ 190 - 190
wechat_rsp.go

@@ -6,211 +6,211 @@
 package gopay
 package gopay
 
 
 type WeChatUnifiedOrderResponse struct {
 type WeChatUnifiedOrderResponse struct {
-	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"`
-	ErrCode    string `xml:"err_code"`
-	ErrCodeDes string `xml:"err_code_des"`
-	TradeType  string `xml:"trade_type"`
-	PrepayId   string `xml:"prepay_id"`
-	CodeUrl    string `xml:"code_url"`
-	MwebUrl    string `xml:"mweb_url"`
+	ReturnCode string `xml:"return_code,omitempty"`
+	ReturnMsg  string `xml:"return_msg,omitempty"`
+	Appid      string `xml:"appid,omitempty"`
+	MchId      string `xml:"mch_id,omitempty"`
+	DeviceInfo string `xml:"device_info,omitempty"`
+	NonceStr   string `xml:"nonce_str,omitempty"`
+	Sign       string `xml:"sign,omitempty"`
+	ResultCode string `xml:"result_code,omitempty"`
+	ErrCode    string `xml:"err_code,omitempty"`
+	ErrCodeDes string `xml:"err_code_des,omitempty"`
+	TradeType  string `xml:"trade_type,omitempty"`
+	PrepayId   string `xml:"prepay_id,omitempty"`
+	CodeUrl    string `xml:"code_url,omitempty"`
+	MwebUrl    string `xml:"mweb_url,omitempty"`
 }
 }
 
 
 type WeChatQueryOrderResponse struct {
 type WeChatQueryOrderResponse struct {
-	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"`
-	ErrCode            string `xml:"err_code"`
-	ErrCodeDes         string `xml:"err_code_des"`
-	DeviceInfo         string `xml:"device_info"`
-	Openid             string `xml:"openid"`
-	IsSubscribe        string `xml:"is_subscribe"`
-	TradeType          string `xml:"trade_type"`
-	TradeState         string `xml:"trade_state"`
-	BankType           string `xml:"bank_type"`
-	TotalFee           int    `xml:"total_fee"`
-	SettlementTotalFee int    `xml:"settlement_total_fee"`
-	FeeType            string `xml:"fee_type"`
-	CashFee            int    `xml:"cash_fee"`
-	CashFeeType        string `xml:"cash_fee_type"`
-	CouponFee          int    `xml:"coupon_fee"`
-	CouponCount        int    `xml:"coupon_count"`
-	CouponType0        string `xml:"coupon_type_0"`
-	CouponId0          string `xml:"coupon_id_0"`
-	CouponFee0         int    `xml:"coupon_fee_0"`
-	TransactionId      string `xml:"transaction_id"`
-	OutTradeNo         string `xml:"out_trade_no"`
-	Attach             string `xml:"attach"`
-	TimeEnd            string `xml:"time_end"`
-	TradeStateDesc     string `xml:"trade_state_desc"`
+	ReturnCode         string `xml:"return_code,omitempty"`
+	ReturnMsg          string `xml:"return_msg,omitempty"`
+	Appid              string `xml:"appid,omitempty"`
+	MchId              string `xml:"mch_id,omitempty"`
+	NonceStr           string `xml:"nonce_str,omitempty"`
+	Sign               string `xml:"sign,omitempty"`
+	ResultCode         string `xml:"result_code,omitempty"`
+	ErrCode            string `xml:"err_code,omitempty"`
+	ErrCodeDes         string `xml:"err_code_des,omitempty"`
+	DeviceInfo         string `xml:"device_info,omitempty"`
+	Openid             string `xml:"openid,omitempty"`
+	IsSubscribe        string `xml:"is_subscribe,omitempty"`
+	TradeType          string `xml:"trade_type,omitempty"`
+	TradeState         string `xml:"trade_state,omitempty"`
+	BankType           string `xml:"bank_type,omitempty"`
+	TotalFee           int    `xml:"total_fee,omitempty"`
+	SettlementTotalFee int    `xml:"settlement_total_fee,omitempty"`
+	FeeType            string `xml:"fee_type,omitempty"`
+	CashFee            int    `xml:"cash_fee,omitempty"`
+	CashFeeType        string `xml:"cash_fee_type,omitempty"`
+	CouponFee          int    `xml:"coupon_fee,omitempty"`
+	CouponCount        int    `xml:"coupon_count,omitempty"`
+	CouponType0        string `xml:"coupon_type_0,omitempty"`
+	CouponId0          string `xml:"coupon_id_0,omitempty"`
+	CouponFee0         int    `xml:"coupon_fee_0,omitempty"`
+	TransactionId      string `xml:"transaction_id,omitempty"`
+	OutTradeNo         string `xml:"out_trade_no,omitempty"`
+	Attach             string `xml:"attach,omitempty"`
+	TimeEnd            string `xml:"time_end,omitempty"`
+	TradeStateDesc     string `xml:"trade_state_desc,omitempty"`
 }
 }
 
 
 type WeChatCloseOrderResponse struct {
 type WeChatCloseOrderResponse struct {
-	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"`
-	ErrCode    string `xml:"err_code"`
-	ErrCodeDes string `xml:"err_code_des"`
+	ReturnCode string `xml:"return_code,omitempty"`
+	ReturnMsg  string `xml:"return_msg,omitempty"`
+	Appid      string `xml:"appid,omitempty"`
+	MchId      string `xml:"mch_id,omitempty"`
+	DeviceInfo string `xml:"device_info,omitempty"`
+	NonceStr   string `xml:"nonce_str,omitempty"`
+	Sign       string `xml:"sign,omitempty"`
+	ResultCode string `xml:"result_code,omitempty"`
+	ErrCode    string `xml:"err_code,omitempty"`
+	ErrCodeDes string `xml:"err_code_des,omitempty"`
 }
 }
 
 
 type WeChatReverseResponse struct {
 type WeChatReverseResponse struct {
-	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"`
-	ErrCode    string `xml:"err_code"`
-	ErrCodeDes string `xml:"err_code_des"`
-	Recall     string `xml:"recall"`
+	ReturnCode string `xml:"return_code,omitempty"`
+	ReturnMsg  string `xml:"return_msg,omitempty"`
+	Appid      string `xml:"appid,omitempty"`
+	MchId      string `xml:"mch_id,omitempty"`
+	NonceStr   string `xml:"nonce_str,omitempty"`
+	Sign       string `xml:"sign,omitempty"`
+	ResultCode string `xml:"result_code,omitempty"`
+	ErrCode    string `xml:"err_code,omitempty"`
+	ErrCodeDes string `xml:"err_code_des,omitempty"`
+	Recall     string `xml:"recall,omitempty"`
 }
 }
 
 
 type WeChatRefundResponse struct {
 type WeChatRefundResponse struct {
-	ReturnCode          string `xml:"return_code"`
-	ReturnMsg           string `xml:"return_msg"`
-	ResultCode          string `xml:"result_code"`
-	ErrCode             string `xml:"err_code"`
-	ErrCodeDes          string `xml:"err_code_des"`
-	Appid               string `xml:"appid"`
-	MchId               string `xml:"mch_id"`
-	NonceStr            string `xml:"nonce_str"`
-	Sign                string `xml:"sign"`
-	TransactionId       string `xml:"transaction_id"`
-	OutTradeNo          string `xml:"out_trade_no"`
-	OutRefundNo         string `xml:"out_refund_no"`
-	RefundId            string `xml:"refund_id"`
-	RefundFee           int    `xml:"refund_fee"`
-	SettlementRefundFee int    `xml:"settlement_refund_fee"`
-	TotalFee            int    `xml:"total_fee"`
-	SettlementTotalFee  int    `xml:"settlement_total_fee"`
-	FeeType             string `xml:"fee_type"`
-	CashFee             int    `xml:"cash_fee"`
-	CashFeeType         string `xml:"cash_fee_type"`
-	CashRefundFee       int    `xml:"cash_refund_fee"`
-	CouponType0         string `xml:"coupon_type_0"`
-	CouponRefundFee     int    `xml:"coupon_refund_fee"`
-	CouponRefundFee0    int    `xml:"coupon_refund_fee_0"`
-	CouponRefundCount   int    `xml:"coupon_refund_count"`
-	CouponRefundId0     string `xml:"coupon_refund_id_0"`
+	ReturnCode          string `xml:"return_code,omitempty"`
+	ReturnMsg           string `xml:"return_msg,omitempty"`
+	ResultCode          string `xml:"result_code,omitempty"`
+	ErrCode             string `xml:"err_code,omitempty"`
+	ErrCodeDes          string `xml:"err_code_des,omitempty"`
+	Appid               string `xml:"appid,omitempty"`
+	MchId               string `xml:"mch_id,omitempty"`
+	NonceStr            string `xml:"nonce_str,omitempty"`
+	Sign                string `xml:"sign,omitempty"`
+	TransactionId       string `xml:"transaction_id,omitempty"`
+	OutTradeNo          string `xml:"out_trade_no,omitempty"`
+	OutRefundNo         string `xml:"out_refund_no,omitempty"`
+	RefundId            string `xml:"refund_id,omitempty"`
+	RefundFee           int    `xml:"refund_fee,omitempty"`
+	SettlementRefundFee int    `xml:"settlement_refund_fee,omitempty"`
+	TotalFee            int    `xml:"total_fee,omitempty"`
+	SettlementTotalFee  int    `xml:"settlement_total_fee,omitempty"`
+	FeeType             string `xml:"fee_type,omitempty"`
+	CashFee             int    `xml:"cash_fee,omitempty"`
+	CashFeeType         string `xml:"cash_fee_type,omitempty"`
+	CashRefundFee       int    `xml:"cash_refund_fee,omitempty"`
+	CouponType0         string `xml:"coupon_type_0,omitempty"`
+	CouponRefundFee     int    `xml:"coupon_refund_fee,omitempty"`
+	CouponRefundFee0    int    `xml:"coupon_refund_fee_0,omitempty"`
+	CouponRefundCount   int    `xml:"coupon_refund_count,omitempty"`
+	CouponRefundId0     string `xml:"coupon_refund_id_0,omitempty"`
 }
 }
 
 
 type WeChatQueryRefundResponse struct {
 type WeChatQueryRefundResponse struct {
-	ReturnCode           string `xml:"return_code"`
-	ReturnMsg            string `xml:"return_msg"`
-	ResultCode           string `xml:"result_code"`
-	ErrCode              string `xml:"err_code"`
-	ErrCodeDes           string `xml:"err_code_des"`
-	Appid                string `xml:"appid"`
-	MchId                string `xml:"mch_id"`
-	NonceStr             string `xml:"nonce_str"`
-	Sign                 string `xml:"sign"`
-	TotalRefundCount     int    `xml:"total_refund_count"`
-	TransactionId        string `xml:"transaction_id"`
-	OutTradeNo           string `xml:"out_trade_no"`
-	TotalFee             int    `xml:"total_fee"`
-	SettlementTotalFee   int    `xml:"settlement_total_fee"`
-	FeeType              string `xml:"fee_type"`
-	CashFee              int    `xml:"cash_fee"`
-	RefundCount          int    `xml:"refund_count"`
-	OutRefundNo0         string `xml:"out_refund_no_0"`
-	RefundId0            string `xml:"refund_id_0"`
-	RefundChannel0       string `xml:"refund_channel_0"`
-	RefundFee0           int    `xml:"refund_fee_0"`
-	SettlementRefundFee0 int    `xml:"settlement_refund_fee_0"`
-	CouponType00         string `xml:"coupon_type_0_0"`
-	CouponRefundFee0     int    `xml:"coupon_refund_fee_0"`
-	CouponRefundCount0   int    `xml:"coupon_refund_count_0"`
-	CouponRefundId00     string `xml:"coupon_refund_id_0_0"`
-	CouponRefundFee00    int    `xml:"coupon_refund_fee_0_0"`
-	RefundStatus0        string `xml:"refund_status_0"`
-	RefundAccount0       string `xml:"refund_account_0"`
-	RefundRecvAccout0    string `xml:"refund_recv_accout_0"`
-	RefundSuccessTime0   string `xml:"refund_success_time_0"`
+	ReturnCode           string `xml:"return_code,omitempty"`
+	ReturnMsg            string `xml:"return_msg,omitempty"`
+	ResultCode           string `xml:"result_code,omitempty"`
+	ErrCode              string `xml:"err_code,omitempty"`
+	ErrCodeDes           string `xml:"err_code_des,omitempty"`
+	Appid                string `xml:"appid,omitempty"`
+	MchId                string `xml:"mch_id,omitempty"`
+	NonceStr             string `xml:"nonce_str,omitempty"`
+	Sign                 string `xml:"sign,omitempty"`
+	TotalRefundCount     int    `xml:"total_refund_count,omitempty"`
+	TransactionId        string `xml:"transaction_id,omitempty"`
+	OutTradeNo           string `xml:"out_trade_no,omitempty"`
+	TotalFee             int    `xml:"total_fee,omitempty"`
+	SettlementTotalFee   int    `xml:"settlement_total_fee,omitempty"`
+	FeeType              string `xml:"fee_type,omitempty"`
+	CashFee              int    `xml:"cash_fee,omitempty"`
+	RefundCount          int    `xml:"refund_count,omitempty"`
+	OutRefundNo0         string `xml:"out_refund_no_0,omitempty"`
+	RefundId0            string `xml:"refund_id_0,omitempty"`
+	RefundChannel0       string `xml:"refund_channel_0,omitempty"`
+	RefundFee0           int    `xml:"refund_fee_0,omitempty"`
+	SettlementRefundFee0 int    `xml:"settlement_refund_fee_0,omitempty"`
+	CouponType00         string `xml:"coupon_type_0_0,omitempty"`
+	CouponRefundFee0     int    `xml:"coupon_refund_fee_0,omitempty"`
+	CouponRefundCount0   int    `xml:"coupon_refund_count_0,omitempty"`
+	CouponRefundId00     string `xml:"coupon_refund_id_0_0,omitempty"`
+	CouponRefundFee00    int    `xml:"coupon_refund_fee_0_0,omitempty"`
+	RefundStatus0        string `xml:"refund_status_0,omitempty"`
+	RefundAccount0       string `xml:"refund_account_0,omitempty"`
+	RefundRecvAccout0    string `xml:"refund_recv_accout_0,omitempty"`
+	RefundSuccessTime0   string `xml:"refund_success_time_0,omitempty"`
 }
 }
 
 
 type WeChatMicropayResponse struct {
 type WeChatMicropayResponse struct {
-	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"`
-	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"`
-	FeeType            string `xml:"fee_type"`
-	TotalFee           int    `xml:"total_fee"`
-	SettlementTotalFee int    `xml:"settlement_total_fee"`
-	CouponFee          int    `xml:"coupon_fee"`
-	CashFeeType        string `xml:"cash_fee_type"`
-	CashFee            int    `xml:"cash_fee"`
-	TransactionId      string `xml:"transaction_id"`
-	OutTradeNo         string `xml:"out_trade_no"`
-	Attach             string `xml:"attach"`
-	TimeEnd            string `xml:"time_end"`
-	PromotionDetail    string `xml:"promotion_detail"`
+	ReturnCode         string `xml:"return_code,omitempty"`
+	ReturnMsg          string `xml:"return_msg,omitempty"`
+	Appid              string `xml:"appid,omitempty"`
+	MchId              string `xml:"mch_id,omitempty"`
+	DeviceInfo         string `xml:"device_info,omitempty"`
+	NonceStr           string `xml:"nonce_str,omitempty"`
+	Sign               string `xml:"sign,omitempty"`
+	ResultCode         string `xml:"result_code,omitempty"`
+	ErrCode            string `xml:"err_code,omitempty"`
+	ErrCodeDes         string `xml:"err_code_des,omitempty"`
+	Openid             string `xml:"openid,omitempty"`
+	IsSubscribe        string `xml:"is_subscribe,omitempty"`
+	TradeType          string `xml:"trade_type,omitempty"`
+	BankType           string `xml:"bank_type,omitempty"`
+	FeeType            string `xml:"fee_type,omitempty"`
+	TotalFee           int    `xml:"total_fee,omitempty"`
+	SettlementTotalFee int    `xml:"settlement_total_fee,omitempty"`
+	CouponFee          int    `xml:"coupon_fee,omitempty"`
+	CashFeeType        string `xml:"cash_fee_type,omitempty"`
+	CashFee            int    `xml:"cash_fee,omitempty"`
+	TransactionId      string `xml:"transaction_id,omitempty"`
+	OutTradeNo         string `xml:"out_trade_no,omitempty"`
+	Attach             string `xml:"attach,omitempty"`
+	TimeEnd            string `xml:"time_end,omitempty"`
+	PromotionDetail    string `xml:"promotion_detail,omitempty"`
 }
 }
 
 
 type getSignKeyResponse struct {
 type getSignKeyResponse struct {
-	ReturnCode     string `xml:"return_code"`
-	ReturnMsg      string `xml:"return_msg"`
-	Retmsg         string `xml:"retmsg"`
-	Retcode        string `xml:"retcode"`
-	MchId          string `xml:"mch_id"`
-	SandboxSignkey string `xml:"sandbox_signkey"`
+	ReturnCode     string `xml:"return_code,omitempty"`
+	ReturnMsg      string `xml:"return_msg,omitempty"`
+	Retmsg         string `xml:"retmsg,omitempty"`
+	Retcode        string `xml:"retcode,omitempty"`
+	MchId          string `xml:"mch_id,omitempty"`
+	SandboxSignkey string `xml:"sandbox_signkey,omitempty"`
 }
 }
 
 
 type WeChatNotifyRequest struct {
 type WeChatNotifyRequest struct {
-	ReturnCode         string `xml:"return_code"`
-	ReturnMsg          string `xml:"return_msg"`
-	ResultCode         string `xml:"result_code"`
-	ErrCode            string `xml:"err_code"`
-	ErrCodeDes         string `xml:"err_code_des"`
-	Appid              string `xml:"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"`
-	Openid             string `xml:"openid"`
-	IsSubscribe        string `xml:"is_subscribe"`
-	TradeType          string `xml:"trade_type"`
-	BankType           string `xml:"bank_type"`
-	TotalFee           int    `xml:"total_fee"`
-	SettlementTotalFee int    `xml:"settlement_total_fee"`
-	FeeType            string `xml:"fee_type"`
-	CashFee            int    `xml:"cash_fee"`
-	CashFeeType        string `xml:"cash_fee_type"`
-	CouponFee          int    `xml:"coupon_fee"`
-	CouponCount        int    `xml:"coupon_count"`
-	CouponType0        string `xml:"coupon_type_0"`
-	CouponId0          string `xml:"coupon_id_0"`
-	CouponFee0         int    `xml:"coupon_fee_0"`
-	TransactionId      string `xml:"transaction_id"`
-	OutTradeNo         string `xml:"out_trade_no"`
-	Attach             string `xml:"attach"`
-	TimeEnd            string `xml:"time_end"`
+	ReturnCode         string `xml:"return_code,omitempty"`
+	ReturnMsg          string `xml:"return_msg,omitempty"`
+	ResultCode         string `xml:"result_code,omitempty"`
+	ErrCode            string `xml:"err_code,omitempty"`
+	ErrCodeDes         string `xml:"err_code_des,omitempty"`
+	Appid              string `xml:"appid,omitempty"`
+	MchId              string `xml:"mch_id,omitempty"`
+	DeviceInfo         string `xml:"device_info,omitempty"`
+	NonceStr           string `xml:"nonce_str,omitempty"`
+	Sign               string `xml:"sign,omitempty"`
+	SignType           string `xml:"sign_type,omitempty"`
+	Openid             string `xml:"openid,omitempty"`
+	IsSubscribe        string `xml:"is_subscribe,omitempty"`
+	TradeType          string `xml:"trade_type,omitempty"`
+	BankType           string `xml:"bank_type,omitempty"`
+	TotalFee           int    `xml:"total_fee,omitempty"`
+	SettlementTotalFee int    `xml:"settlement_total_fee,omitempty"`
+	FeeType            string `xml:"fee_type,omitempty"`
+	CashFee            int    `xml:"cash_fee,omitempty"`
+	CashFeeType        string `xml:"cash_fee_type,omitempty"`
+	CouponFee          int    `xml:"coupon_fee,omitempty"`
+	CouponCount        int    `xml:"coupon_count,omitempty"`
+	CouponType0        string `xml:"coupon_type_0,omitempty"`
+	CouponId0          string `xml:"coupon_id_0,omitempty"`
+	CouponFee0         int    `xml:"coupon_fee_0,omitempty"`
+	TransactionId      string `xml:"transaction_id,omitempty"`
+	OutTradeNo         string `xml:"out_trade_no,omitempty"`
+	Attach             string `xml:"attach,omitempty"`
+	TimeEnd            string `xml:"time_end,omitempty"`
 }
 }
 
 
 type Code2SessionRsp struct {
 type Code2SessionRsp struct {
@@ -270,13 +270,13 @@ type watermarkInfo struct {
 }
 }
 
 
 type OpenIdByAuthCodeRsp struct {
 type OpenIdByAuthCodeRsp struct {
-	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"`
-	ErrCode    string `xml:"err_code"`
-	Openid     string `xml:"openid"` //用户唯一标识
+	ReturnCode string `xml:"return_code,omitempty"`
+	ReturnMsg  string `xml:"return_msg,omitempty"`
+	Appid      string `xml:"appid,omitempty"`
+	MchId      string `xml:"mch_id,omitempty"`
+	NonceStr   string `xml:"nonce_str,omitempty"`
+	Sign       string `xml:"sign,omitempty"`
+	ResultCode string `xml:"result_code,omitempty"`
+	ErrCode    string `xml:"err_code,omitempty"`
+	Openid     string `xml:"openid,omitempty"` //用户唯一标识
 }
 }