59 lines
2.0 KiB
Go
59 lines
2.0 KiB
Go
package front
|
|
|
|
type ApiCommonBody struct {
|
|
AppId int64 `json:"app_id" validate:"required"`
|
|
Timestamp int64 `json:"timestamp" validate:"required"`
|
|
}
|
|
|
|
type RequestBody struct {
|
|
AppId int64 `json:"app_id" validate:"required"`
|
|
Timestamp int64 `json:"timestamp" validate:"required"`
|
|
Data string `json:"data" validate:"required"`
|
|
Key string `json:"key" validate:"max=32"`
|
|
}
|
|
|
|
type PayCommonReqBody struct {
|
|
ApiCommonBody
|
|
PayChannelId int64 `json:"pay_channel_id" validate:"required" label:"支付渠道"`
|
|
Amount int `json:"amount" validate:"required" label:"支付金额,单位分"`
|
|
ExtJson string `json:"ext_json" label:"扩展参数"`
|
|
Desc string `json:"desc" validate:"max=100" label:"商品描述"`
|
|
ReturnUrl string `json:"return_url" validate:"max=1024" label:"支付成功后跳转的地址"`
|
|
OpenId string `json:"open_id" label:"用户openid"`
|
|
}
|
|
|
|
type PayReqs struct {
|
|
PayCommonReqBody
|
|
OutTradeNo string `json:"out_trade_no" validate:"required" label:"外侧商户订单号"`
|
|
}
|
|
|
|
type RefundReqs struct {
|
|
PayCommonReqBody
|
|
RefundOutTradeNo string `json:"refund_out_trade_no" label:"需要退款的外侧商户订单号"`
|
|
RefundOrderId string `json:"refundOrder_id" label:"需要退款的平台订单号"`
|
|
OutTradeNo string `json:"out_trade_no" validate:"required" label:"外侧商户订单号"`
|
|
}
|
|
|
|
type PayUrlResp struct {
|
|
Order string `json:"order"`
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
type QueryReqs struct {
|
|
ApiCommonBody
|
|
OutTradeNo string `json:"out_trade_no" validate:"required" label:"外侧商户订单号"`
|
|
}
|
|
|
|
// 关闭订单
|
|
type CloseReqs struct {
|
|
ApiCommonBody
|
|
PayChannelId int64 `json:"pay_channel_id" validate:"required" label:"支付渠道"`
|
|
OutTradeNo string `json:"out_trade_no" validate:"required" label:"外侧商户订单号"`
|
|
}
|
|
|
|
// api 接口返回数据, 统一返回结构, order数据会进行加密
|
|
type ApiResponse struct {
|
|
Order interface{} `json:"order,omitempty"`
|
|
Url string `json:"url,omitempty"`
|
|
}
|