niki/domain/payment/entity/payment.go

46 lines
852 B
Go

package entity
import "time"
type Currency string
const (
CurrencyIRR Currency = "IRR"
CurrencyUSD Currency = "USD"
)
type PaymentStatus string
const (
PaymentStatusPending PaymentStatus = "Pending"
PaymentStatusSuccess PaymentStatus = "Success"
PaymentStatusFailed PaymentStatus = "Failed"
PaymentStatusCancelled PaymentStatus = "Cancelled"
//...
)
type PayableType string
const (
PayableTypeDonate PayableType = "Donate"
PayableTypeOrder PayableType = "Order"
PayableTypeWalet PayableType = "WaletCharge"
)
type Payment struct {
ID uint
UserID uint
MethodID uint
GatewayID uint
PayableType PayableType
PayableID uint
TotalAmount int64
PaidAmount int64
Currency Currency
Status PaymentStatus
Description string
CreatedAt time.Time
UpdatedAt time.Time
PaidAt *time.Time
}