This commit is contained in:
邹宗楠
2023-04-06 18:25:24 +08:00
parent 18572ce050
commit 88e7b96fec
10 changed files with 457 additions and 18 deletions

View File

@@ -42,8 +42,158 @@ type PreCreateOrderReq struct {
CancelOrder int64 `json:"cancel_order"` // 该字段表示创建订单的同时是否覆盖之前已存在的订单。
}
// PreCreateOrderResponse 预下单返回参数
type PreCreateOrderResponse struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
OrderInfo string `json:"order_info"` //拉起收银台的 orderInfo
}
// GetOrderDetailRes 获取支付订单详情
type GetOrderDetailRes struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
PaymentInfo string `json:"payment_info"` //拉起收银台的 orderInfo
}
type PaymentInfo struct {
TotalAmount int64 `json:"total_amount"` // 预下单用户支付金额
PayStatus string `json:"pay_status"` // 支付状态。 取值: PROCESSING-处理中SUCCESS-成功FAILED-失败 TIMEOUT-超时
PayTime int64 `json:"pay_time"` // 订单支付时间,单位为毫秒时间戳。
PayChannel string `json:"pay_channel"` // 支付渠道。取值UNKNOWN - 未知WECHAT-微信 ALIPAY-支付宝。(注如果用户还未支付这里返回的是UNKNOWN.
OutOrderNo string `json:"out_order_no"` // 开发者下单单号
KsOrderNo string `json:"ks_order_no"` // 快手小程序平台订单号
ExtraInfo string `json:"extra_info"` // 订单来源信息,历史订单为""
EnablePromotion bool `json:"enable_promotion"` // 是否参与分销true:分销false:非分销
PromotionAmount int64 `json:"promotion_amount"` // 预计分销金额,单位:分
OpenId string `json:"open_id"` // 订单对应的用户open id
OrderStatus int64 `json:"order_status"` // 开发者回传的订单同步状态
}
// KauiShouCallbackRes 快手支付回调
type KauiShouCallbackRes struct {
Data interface{} `json:"data"`
MessageId string `json:"message_id"` // 当前回调消息的唯一ID在同一个消息多次通知时保持一致。
BizType string `json:"biz_type"` // 业务类型。取值PAYMENT-支付
AppId string `json:"app_id"` // 当前小程序的AppID
Timestamp int64 `json:"timestamp"` // 流程变动的时间戳
}
type CallBackDetail struct {
Channel string `json:"channel"` // 支付渠道。取值UNKNOWN - 未知WECHAT-微信ALIPAY-支付宝
OutOrderNo string `json:"out_order_no"` // 商户系统内部订单号
Attach string `json:"attach"` // 预下单时携带的开发者自定义信息
Status string `json:"status"` // 订单支付状态。 取值: PROCESSING-处理中SUCCESS-成功FAILED-失败
KsOrderNo string `json:"ks_order_no"` // 快手小程序平台订单号
OrderAmount int `json:"order_amount"` // 订单金额
TradeNo string `json:"trade_no"` // 用户侧支付页交易单号
ExtraInfo string `json:"extra_info"` // 订单来源信息,同支付查询接口
EnablePromotion bool `json:"enable_promotion"` // 是否参与分销true:分销false:非分销
PromotionAmount int `json:"promotion_amount"` // 预计分销金额,单位:分
}
// RefundParam 申请退单参数
type RefundParam struct {
OutOrderNo string `json:"out_order_no"` // 开发者需要发起退款的支付订单号
OutRefundNo string `json:"out_refund_no"` // 开发者的退款单号
Reason string `json:"reason"` // 退款理由
Attach string `json:"attach"` // 开发者自定义字段,回调原样回传
NotifyUrl string `json:"notify_url"` // 通知URL必须为直接可访问的URL不允许携带查询串。
RefundAmount int64 `json:"refund_amount"` // 用户退款金额,单位为分。不允许传非整数的数值
Sign string `json:"sign"` // 签名
MultiCopiesGoodsInfo string `json:"multi_copies_goods_info"` // 单商品购买多份场景,示例值:[{"copies":2}] 内容见multi_copies_goods_info字段说明
}
// RefundRes 申请退款返回参数
type RefundRes struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
RefundNo string `json:"refund_no"`
}
// RefundOrderDetail 获取退款订单详情
type RefundOrderDetail struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
RefundInfo string `json:"refund_info"`
}
// RefundInfo 获取申请退款详情
type RefundInfo struct {
KsOrderNo string `json:"ks_order_no"`
RefundStatus string `json:"refund_status"`
RefundNo string `json:"refund_no"`
KsRefundType string `json:"ks_refund_type"`
RefundAmount int `json:"refund_amount"`
KsRefundNo string `json:"ks_refund_no"`
}
// RefundCallBack 快手退款回调
type RefundCallBack struct {
//Data struct {
OutRefundNo string `json:"out_refund_no"` // 开发者的退款单号
RefundAmount int `json:"refund_amount"` // 退款金额
Attach string `json:"attach"` // 预下单时携带的开发者自定义信息
Status string `json:"status"` // 退款状态。 取值: PROCESSING-处理中SUCCESS-成功FAILED-失败
KsOrderNo string `json:"ks_order_no"` // 快手小程序平台订单号
KsRefundNo string `json:"ks_refund_no"` // 快手小程序平台退款单号
KsRefundType string `json:"ks_refund_type"` // 退款账户说明[]
//} `json:"data"`
//MessageId string `json:"message_id"`
//BizType string `json:"biz_type"`
//AppId string `json:"app_id"`
//Timestamp int64 `json:"timestamp"`
}
// OrderSettleAccountParam 发起订单结算请求参数
type OrderSettleAccountParam struct {
OutOrderNo string `json:"out_order_no"`
OutSettleNo string `json:"out_settle_no"`
Reason string `json:"reason"`
Attach string `json:"attach"`
NotifyUrl string `json:"notify_url"`
Sign string `json:"sign"`
SettleAmount int64 `json:"settle_amount"`
MultiCopiesGoodsInfo string `json:"multi_copies_goods_info"`
}
// OrderSettleAccountRes 发起订单结算返回参数
type OrderSettleAccountRes struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
SettleNo string `json:"settle_no"`
}
// QuerySettleInfoRes 查询订单结算信息
type QuerySettleInfoRes struct {
Result int `json:"result"`
ErrorMsg string `json:"error_msg"`
SettleInfo string `json:"settle_info"`
}
type SettleInfo struct {
SettleNo string `json:"settle_no"`
TotalAmount int `json:"total_amount"`
SettleAmount int `json:"settle_amount"`
SettleStatus string `json:"settle_status"`
KsOrderNo string `json:"ks_order_no"`
KsSettleNo string `json:"ks_settle_no"`
}
// SettleCallback 快手结算回调
type SettleCallback struct {
//Data struct {
OutSettleNo string `json:"out_settle_no"` // 外部结算单号,即开发者结算请求的单号。
Attach string `json:"attach"` // 预下单时携带的开发者自定义信息
SettleAmount int `json:"settle_amount"` // 结算后给商户的金额,单位:分
Status string `json:"status"` // 结算状态。 取值: PROCESSING-处理中SUCCESS-成功FAILED-失败
KsOrderNo string `json:"ks_order_no"` // 快手小程序平台订单号。
KsSettleNo string `json:"ks_settle_no"` // 快手小程序平台结算单号。
EnablePromotion bool `json:"enable_promotion"` // 是否参与分销true:分销false:非分销
PromotionAmount int `json:"promotion_amount"` // 预计分销金额,单位:分
//} `json:"data"`
//BizType string `json:"biz_type"`
//MessageId string `json:"message_id"`
//AppId string `json:"app_id"`
//Timestamp int64 `json:"timestamp"`
}