初始化项目
This commit is contained in:
@@ -204,3 +204,120 @@ type OrderSummary struct {
|
||||
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||||
PaidAt *time.Time `json:"paid_at"` // 支付时间
|
||||
}
|
||||
|
||||
// PaymentNotifyReq 支付回调请求
|
||||
|
||||
type PaymentNotifyReq struct {
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
OrderNo string `json:"order_no"` // 订单号
|
||||
PayMethod string `json:"pay_method"` // 支付方式
|
||||
Status string `json:"status"` // 支付状态
|
||||
TransactionID string `json:"transaction_id"` // 交易号
|
||||
TradeNo string `json:"trade_no"` // 交易号
|
||||
Sign string `json:"sign"` // 签名
|
||||
}
|
||||
|
||||
// PaymentNotifyResp 支付回调响应
|
||||
|
||||
type PaymentNotifyResp struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// RefundNotifyReq 退款回调请求
|
||||
|
||||
type RefundNotifyReq struct {
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
RefundNo string `json:"refund_no"` // 退款单号
|
||||
Status string `json:"status"` // 退款状态
|
||||
RefundID string `json:"refund_id"` // 退款ID
|
||||
Sign string `json:"sign"` // 签名
|
||||
}
|
||||
|
||||
// RefundNotifyResp 退款回调响应
|
||||
|
||||
type RefundNotifyResp struct {
|
||||
Success bool `json:"success"` // 是否成功
|
||||
}
|
||||
|
||||
// CreatePaymentConfigReq 创建支付配置请求
|
||||
|
||||
type CreatePaymentConfigReq struct {
|
||||
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
|
||||
PayMethod string `json:"pay_method" binding:"required"` // 支付方式:wechat/alipay
|
||||
ConfigName string `json:"config_name" binding:"required"` // 配置名称
|
||||
Remark string `json:"remark"` // 备注
|
||||
IsEnabled bool `json:"is_enabled"` // 是否启用
|
||||
Config map[string]interface{} `json:"config" binding:"required"` // 配置参数
|
||||
}
|
||||
|
||||
// UpdatePaymentConfigReq 更新支付配置请求
|
||||
|
||||
type UpdatePaymentConfigReq struct {
|
||||
ID string `json:"id" binding:"required"` // 配置ID
|
||||
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
|
||||
ConfigName string `json:"config_name" binding:"required"` // 配置名称
|
||||
Remark string `json:"remark"` // 备注
|
||||
IsEnabled bool `json:"is_enabled"` // 是否启用
|
||||
Config map[string]interface{} `json:"config" binding:"required"` // 配置参数
|
||||
}
|
||||
|
||||
// QueryPaymentConfigReq 查询支付配置请求
|
||||
|
||||
type QueryPaymentConfigReq struct {
|
||||
TenantID string `json:"tenant_id" binding:"required"` // 租户ID
|
||||
PayMethod string `json:"pay_method"` // 支付方式(可选)
|
||||
}
|
||||
|
||||
// PaymentConfigResp 支付配置响应
|
||||
|
||||
type PaymentConfigResp struct {
|
||||
ID string `json:"id"` // 配置ID
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
PayMethod string `json:"pay_method"` // 支付方式
|
||||
ConfigName string `json:"config_name"` // 配置名称
|
||||
Remark string `json:"remark"` // 备注
|
||||
IsEnabled bool `json:"is_enabled"` // 是否启用
|
||||
Config map[string]interface{} `json:"config"` // 配置参数
|
||||
CreatedAt time.Time `json:"created_at"` // 创建时间
|
||||
UpdatedAt time.Time `json:"updated_at"` // 更新时间
|
||||
}
|
||||
|
||||
// WechatConfig 微信支付配置
|
||||
|
||||
type WechatConfig struct {
|
||||
ID string `json:"id"` // 配置ID
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
ConfigName string `json:"config_name"` // 配置名称
|
||||
AppID string `json:"app_id"` // 应用ID
|
||||
MchID string `json:"mch_id"` // 商户号
|
||||
APIKey string `json:"api_key"` // API密钥
|
||||
NotifyURL string `json:"notify_url"` // 回调地址
|
||||
ReturnURL string `json:"return_url"` // 返回地址
|
||||
CertPath string `json:"cert_path"` // 证书路径
|
||||
KeyPath string `json:"key_path"` // 密钥路径
|
||||
Sandbox bool `json:"sandbox"` // 是否沙箱环境
|
||||
SupportNative bool `json:"support_native"` // 支持扫码支付
|
||||
SupportJSAPI bool `json:"support_jsapi"` // 支持JSAPI支付
|
||||
SupportAPP bool `json:"support_app"` // 支持APP支付
|
||||
SupportH5 bool `json:"support_h5"` // 支持H5支付
|
||||
GatewayURL string `json:"gateway_url"` // 网关地址
|
||||
}
|
||||
|
||||
// AlipayConfig 支付宝支付配置
|
||||
|
||||
type AlipayConfig struct {
|
||||
ID string `json:"id"` // 配置ID
|
||||
TenantID string `json:"tenant_id"` // 租户ID
|
||||
ConfigName string `json:"config_name"` // 配置名称
|
||||
AppID string `json:"app_id"` // 应用ID
|
||||
NotifyURL string `json:"notify_url"` // 回调地址
|
||||
ReturnURL string `json:"return_url"` // 返回地址
|
||||
AppPrivateKey string `json:"app_private_key"` // 应用私钥
|
||||
AlipayPublicKey string `json:"alipay_public_key"` // 支付宝公钥
|
||||
Sandbox bool `json:"sandbox"` // 是否沙箱环境
|
||||
GatewayURL string `json:"gateway_url"` // 网关地址
|
||||
SupportNative bool `json:"support_native"` // 支持扫码支付
|
||||
SupportJSAPI bool `json:"support_jsapi"` // 支持JSAPI支付
|
||||
SupportAPP bool `json:"support_app"` // 支持APP支付
|
||||
SupportH5 bool `json:"support_h5"` // 支持H5支付
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user