Return Payment Status

This commit is contained in:
aditya.siregar 2024-08-28 13:55:21 +07:00
parent 7aceb0488b
commit dacd341c6e
2 changed files with 13 additions and 1 deletions

View File

@ -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
}

View File

@ -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,
}
}