123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129 |
- package wx
- import "encoding/xml"
- /*type UnionPayRequest struct {
- AppId string `xml:"appid"` //公众账号ID(是)
- MchId string `xml:"mch_id"` //商户号(是)
- DeviceInfo string `xml:"device_info"` //设备号
- NonceStr string `xml:"nonce_str"` //随机字符串(是)
- Sign string `xml:"sign"` //签名(是)
- Body string `xml:"body"` //商品描述(是)
- Detail string `xml:"detail"` //商品详情
- Attach string `xml:"attach"` //附加数据
- OutTradeNo string `xml:"out_trade_no"` //商户订单号(是)
- FeeType string `xml:"fee_type"` //货币类型
- TotalFee int `xml:"total_fee"` //总金额(是)
- SpbillCreateIp string `xml:"spbill_create_ip"` //终端IP(是)
- TimeStart string `xml:"time_start"` //交易起始时间
- TimeExpire string `xml:"time_expire"` //交易结束时间
- GoodsTag string `xml:"goods_tag"` //商品标记
- NotifyUrl string `xml:"notify_url"` //通知地址(是)
- TradeType string `xml:"trade_type"` //交易类型(是)
- ProductId string `xml:"product_id"` //商品ID
- LimitPay string `xml:"limit_pay"` //指定支付方式
- OpenId string `xml:"openid"` //用户标识
- }*/
- type UnionPayRequest map[string]string
- func (s UnionPayRequest) MarshalXML(e *xml.Encoder, start xml.StartElement) error {
- tokens := []xml.Token{start}
- for key, value := range s {
- t := xml.StartElement{Name: xml.Name{"", key}}
- tokens = append(tokens, t, xml.CharData(value), xml.EndElement{t.Name})
- }
- tokens = append(tokens, xml.EndElement{start.Name})
- for _, t := range tokens {
- err := e.EncodeToken(t)
- if err != nil {
- return err
- }
- }
- // flush to ensure tokens are
- // written
- err := e.Flush()
- if err != nil {
- return err
- }
- return nil
- }
- type UnionPayResponse 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"` //h5支付中间回调页
- }
- type UnionPayResult 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"`
- TotalFee int `xml:"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"`
- CouponFee0 int `xml:"coupon_fee_0"`
- CouponId0 string `xml:"coupon_id_0"`
- 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"`
- }
- //type UnionPayResult map[string]string
- /*type OrderQueryResult 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"`
- TotalFee int `xml:"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"`
- TransactionId string `xml:"transaction_id"`
- OutTradeNo string `xml:"out_trade_no"`
- Attach string `xml:"attach"`
- TimeEnd string `xml:"time_end"`
- }*/
|