Ai
4 Star 19 Fork 32

少林码僧/pkg

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
wechat.go 2.07 KB
一键复制 编辑 原始数据 按行查看 历史
webphp 提交于 2022-12-18 16:24 +08:00 . add pay
package common
// 微信支付返回结构体
type WeChatReResult 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"`
}
// 微信基本信息
type WechatBaseResult struct {
ReturnCode string `xml:"return_code"`
ReturnMsg string `xml:"return_msg"`
}
// 微信返回通用数据
type WechatReturnData struct {
AppID string `xml:"appid,emitempty"`
MchID string `xml:"mch_id,emitempty"`
DeviceInfo string `xml:"device_info,emitempty"`
NonceStr string `xml:"nonce_str,emitempty"`
Sign string `xml:"sign,emitempty"`
ResultCode string `xml:"result_code,emitempty"`
ErrCode string `xml:"err_code,emitempty"`
ErrCodeDes string `xml:"err_code_des,emitempty"`
}
// 微信结果通用数据
type WechatResultData struct {
OpenID string `xml:"openid,emitempty"`
IsSubscribe string `xml:"is_subscribe,emitempty"`
TradeType string `xml:"trade_type,emitempty"`
BankType string `xml:"bank_type,emitempty"`
FeeType string `xml:"fee_type,emitempty"`
TotalFee int64 `xml:"total_fee,emitempty"`
CashFeeType string `xml:"cash_fee_type,emitempty"`
CashFee int64 `xml:"cash_fee,emitempty"`
TransactionID string `xml:"transaction_id,emitempty"`
OutTradeNO string `xml:"out_trade_no,emitempty"`
Attach string `xml:"attach,emitempty"`
TimeEnd string `xml:"time_end,emitempty"`
}
//微信支付回调结果结构体
type WeChatPayResult struct {
WechatBaseResult
WechatReturnData
WechatResultData
}
//微信查询结果结构体
type WeChatQueryResult struct {
WechatBaseResult
WechatReturnData
WechatResultData
TradeState string `xml:"trade_state"`
TradeStateDesc string `xml:"trade_state_desc"`
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/phper95/pkg.git
git@gitee.com:phper95/pkg.git
phper95
pkg
pkg
38d933c4cdfa

搜索帮助