Browse Source

Chore(booking-slot): Print payload mode first

master
Samuel Pua 3 years ago
parent
commit
a8cfc6b0b9
  1. 6
      backend/internal/ktmtrainbot/backgroundbookingjob.go

6
backend/internal/ktmtrainbot/backgroundbookingjob.go

@ -78,7 +78,7 @@ func (env *Env) BackgroundJobRunner() {
// Create next run where it's not the past (either from old NextRun or now())
timeNow := time.Now()
startTime := time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 00, 10, 0, 0, timeNow.Location())
endTime := startTime.Add(10 * time.Minute)
endTime := startTime.Add(15 * time.Minute)
if timeNow.After(startTime) && timeNow.Before(endTime) {
err := env.DB.Where(&user.Profile{UserID: jobToDo.UserID}).First(&jobToDo.User.Profile).Error
@ -276,8 +276,8 @@ func (env *Env) startBooking(job *Booking, username string, password string, cre
}
if strings.ToUpper(creditCardType) == "VISA" || strings.ToUpper(creditCardType) == "MASTERCARD" {
page = choosePaymentCreditCard(page)
log.Println("Credit card payment method chosen.")
page = choosePaymentCreditCard(page)
// Wait 5 seconds for payment gateway to load
time.Sleep(time.Second * 5)
@ -312,8 +312,8 @@ func (env *Env) startBooking(job *Booking, username string, password string, cre
page = makePayment(page, creditCardType, creditCard, expiryMonth, expiryYear, creditCardCVV)
log.Println("Credit card payment made.")
} else if strings.ToUpper(creditCardType) == "KTMWALLET" {
page = choosePaymentKTMWallet(page)
log.Println("KTM wallet payment method chosen.")
page = choosePaymentKTMWallet(page)
log.Println("KTM wallet payment made.")
}

Loading…
Cancel
Save