Return Payment Status
This commit is contained in:
parent
7aceb0488b
commit
dacd341c6e
@ -137,6 +137,18 @@ type HistoryOrder struct {
|
||||
Source string `gorm:"type:numeric;column:source"`
|
||||
}
|
||||
|
||||
func (h *HistoryOrder) GetPaymentStatus() string {
|
||||
if h.Status == "PAID" {
|
||||
return "E-TICKET TELAH TERBIT"
|
||||
}
|
||||
|
||||
if h.Status == "PENDING" {
|
||||
return "MENUNGGU PEMBAYARAN"
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
type HistoryOrderDB struct {
|
||||
HistoryOrder
|
||||
}
|
||||
|
||||
@ -155,7 +155,7 @@ func (h *Handler) toHistoryOrderResponse(resp *entity.HistoryOrder) response.His
|
||||
BookingTime: resp.BookingTime.Format(time.RFC3339),
|
||||
Tickets: resp.Tickets,
|
||||
PaymentType: resp.PaymentType,
|
||||
Status: resp.Status,
|
||||
Status: resp.GetPaymentStatus(),
|
||||
Amount: resp.Amount,
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user