Chore(booking-slot): Print payload mode first
All checks were successful
ktm-booking-bot/ktm-booking-bot/pipeline/head This commit looks good
All checks were successful
ktm-booking-bot/ktm-booking-bot/pipeline/head This commit looks good
This commit is contained in:
@@ -78,7 +78,7 @@ func (env *Env) BackgroundJobRunner() {
|
|||||||
// Create next run where it's not the past (either from old NextRun or now())
|
// Create next run where it's not the past (either from old NextRun or now())
|
||||||
timeNow := time.Now()
|
timeNow := time.Now()
|
||||||
startTime := time.Date(timeNow.Year(), timeNow.Month(), timeNow.Day(), 00, 10, 0, 0, timeNow.Location())
|
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) {
|
if timeNow.After(startTime) && timeNow.Before(endTime) {
|
||||||
err := env.DB.Where(&user.Profile{UserID: jobToDo.UserID}).First(&jobToDo.User.Profile).Error
|
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" {
|
if strings.ToUpper(creditCardType) == "VISA" || strings.ToUpper(creditCardType) == "MASTERCARD" {
|
||||||
page = choosePaymentCreditCard(page)
|
|
||||||
log.Println("Credit card payment method chosen.")
|
log.Println("Credit card payment method chosen.")
|
||||||
|
page = choosePaymentCreditCard(page)
|
||||||
|
|
||||||
// Wait 5 seconds for payment gateway to load
|
// Wait 5 seconds for payment gateway to load
|
||||||
time.Sleep(time.Second * 5)
|
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)
|
page = makePayment(page, creditCardType, creditCard, expiryMonth, expiryYear, creditCardCVV)
|
||||||
log.Println("Credit card payment made.")
|
log.Println("Credit card payment made.")
|
||||||
} else if strings.ToUpper(creditCardType) == "KTMWALLET" {
|
} else if strings.ToUpper(creditCardType) == "KTMWALLET" {
|
||||||
page = choosePaymentKTMWallet(page)
|
|
||||||
log.Println("KTM wallet payment method chosen.")
|
log.Println("KTM wallet payment method chosen.")
|
||||||
|
page = choosePaymentKTMWallet(page)
|
||||||
log.Println("KTM wallet payment made.")
|
log.Println("KTM wallet payment made.")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user