This commit is contained in:
28
pkg/constants/payment.go
Normal file
28
pkg/constants/payment.go
Normal file
@@ -0,0 +1,28 @@
|
||||
package constants
|
||||
|
||||
const (
|
||||
// PaymentRecordStatusPending 表示支付单待支付。
|
||||
PaymentRecordStatusPending = 0
|
||||
// PaymentRecordStatusPaid 表示支付单已支付。
|
||||
PaymentRecordStatusPaid = 1
|
||||
// PaymentRecordStatusFailed 表示支付单已失败。
|
||||
PaymentRecordStatusFailed = 2
|
||||
// PaymentRecordStatusRefunded 表示支付单已退款。
|
||||
PaymentRecordStatusRefunded = 3
|
||||
)
|
||||
|
||||
// GetPaymentRecordStatusName 返回支付单状态中文名称。
|
||||
func GetPaymentRecordStatusName(status int) string {
|
||||
switch status {
|
||||
case PaymentRecordStatusPending:
|
||||
return "待支付"
|
||||
case PaymentRecordStatusPaid:
|
||||
return "已支付"
|
||||
case PaymentRecordStatusFailed:
|
||||
return "已失败"
|
||||
case PaymentRecordStatusRefunded:
|
||||
return "已退款"
|
||||
default:
|
||||
return "未知"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user