1 Star 0 Fork 0

h79/goutils

Create your Gitee Account
Explore and code with more than 12 million developers,Free private repositories !:)
Sign up
Clone or Download
common.go 1.94 KB
Copy Edit Raw Blame History
huqiuyun authored 2022-06-01 16:22 . init
package common
// PayClient 支付客户端接口
type PayClient interface {
// 用户下单付款
Pay(charge *Charge) (map[string]string, error)
// 付款给用户
PayToClient(charge *Charge) (map[string]string, error)
}
// Charge 支付参数
type Charge struct {
AppId string `json:"-"`
TradeNum string `json:"tradeNum,omitempty"` //交易流水号
Origin string `json:"origin,omitempty"`
UserId string `json:"userId,omitempty"`
TradeType int `json:"payMethod,omitempty"`
MoneyFee float64 `json:"MoneyFee,omitempty"`
CallbackURL string `json:"callbackURL,omitempty"`
ReturnURL string `json:"returnURL,omitempty"`
ShowURL string `json:"showURL,omitempty"`
Describe string `json:"describe,omitempty"`
OpenId string `json:"openid,omitempty"`
CheckName bool `json:"check_name,omitempty"`
ReUserName string `json:"re_user_name,omitempty"`
AliAccount string `json:"ali_account"`
AliAccountType string `json:"ali_account_type"`
}
//PayCallback 支付返回
type PayCallback struct {
Origin string `json:"origin"`
TradeNum string `json:"trade_num"`
OrderNum string `json:"order_num"`
CallBackURL string `json:"callback_url"`
Status int64 `json:"status"`
}
// CallbackReturn 回调业务代码时的参数
type CallbackReturn struct {
IsSucceed bool `json:"isSucceed"`
OrderNum string `json:"orderNum"`
TradeNum string `json:"tradeNum"`
UserID string `json:"userID"`
MoneyFee int64 `json:"moneyFee"`
Sign string `json:"sign"`
ThirdDiscount int64 `json:"thirdDiscount"`
}
// BaseResult 支付结果
type BaseResult struct {
IsSucceed bool // 是否交易成功
TradeNum string // 交易流水号
MoneyFee int64 // 支付金额
TradeTime string // 交易时间
ContractNum string // 交易单号
UserInfo string // 支付账号信息(有可能有,有可能没有)
ThirdDiscount int64 // 第三方优惠
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/h79/goutils.git
git@gitee.com:h79/goutils.git
h79
goutils
goutils
v1.4.14

Search

Cb406eda 1850385 E526c682 1850385