添加文件: hb/types.go
This commit is contained in:
parent
32ec24f57d
commit
91d9552172
|
|
@ -0,0 +1,58 @@
|
|||
package hb
|
||||
|
||||
// RefundRequest 退款接口请求参数
|
||||
type RefundRequest struct {
|
||||
MerchantId string `json:"merchantId"` // 商户编号
|
||||
RequestId string `json:"requestId"` // 商户请求号
|
||||
SignType string `json:"signType"` // 签名方式:MD5 或 RSA
|
||||
Type string `json:"type"` // 接口类型:OrderRefund
|
||||
Version string `json:"version"` // 版本号:2.0.0
|
||||
OrderId string `json:"orderId"` // 商户订单号
|
||||
Amount string `json:"amount"` // 退款金额,以分为单位
|
||||
MerchantCert string `json:"merchantCert,omitempty"` // 商户证书公钥(不参与签名)
|
||||
Hmac string `json:"hmac,omitempty"` // 签名数据
|
||||
}
|
||||
|
||||
// RefundResponse 退款接口响应参数
|
||||
type RefundResponse struct {
|
||||
MerchantId string `json:"merchantId"` // 商户编号
|
||||
PayNo string `json:"payNo"` // 手机支付平台退款交易流水号
|
||||
ReturnCode string `json:"returnCode"` // 返回码
|
||||
Message string `json:"message"` // 返回码描述信息
|
||||
SignType string `json:"signType"` // 签名方式:MD5 或 RSA
|
||||
Type string `json:"type"` // 接口类型:OrderRefund
|
||||
Version string `json:"version"` // 版本号:2.0.0
|
||||
Amount string `json:"amount"` // 退款金额,单位为分
|
||||
OrderId string `json:"orderId"` // 商户订单号
|
||||
Status string `json:"status"` // 退款结果:SUCCESS / FAILED
|
||||
ServerCert string `json:"serverCert,omitempty"` // 服务器证书公钥(不参与签名)
|
||||
Hmac string `json:"hmac,omitempty"` // 签名数据
|
||||
}
|
||||
|
||||
// RefundStatus 退款状态常量
|
||||
const (
|
||||
RefundStatusSuccess = "SUCCESS"
|
||||
RefundStatusFailed = "FAILED"
|
||||
)
|
||||
|
||||
// SignType 签名方式常量
|
||||
const (
|
||||
SignTypeMD5 = "MD5"
|
||||
SignTypeRSA = "RSA"
|
||||
)
|
||||
|
||||
// 接口类型常量
|
||||
const (
|
||||
InterfaceTypeOrderRefund = "OrderRefund"
|
||||
)
|
||||
|
||||
// 版本号常量
|
||||
const (
|
||||
Version = "2.0.0"
|
||||
)
|
||||
|
||||
// 返回码常量
|
||||
const (
|
||||
ReturnCodeSuccess = "000000"
|
||||
ReturnCodeSuccessAlt = "MCG00000"
|
||||
)
|
||||
Loading…
Reference in New Issue