Feat(booking-job): Loop detect payment merchant
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:
@@ -322,6 +322,9 @@ func chooseAndMakePayment(timerCtx context.Context, creditCardType, creditCard,
|
|||||||
log.Println("Waiting for payment gateway to load.")
|
log.Println("Waiting for payment gateway to load.")
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
|
|
||||||
|
foundPage := false
|
||||||
|
|
||||||
|
for !foundPage {
|
||||||
for _, currPage := range browser.MustPages() {
|
for _, currPage := range browser.MustPages() {
|
||||||
currPage.MustWaitLoad()
|
currPage.MustWaitLoad()
|
||||||
|
|
||||||
@@ -334,6 +337,8 @@ func chooseAndMakePayment(timerCtx context.Context, creditCardType, creditCard,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if strings.Contains(currTitle, "Payment Acceptance") {
|
if strings.Contains(currTitle, "Payment Acceptance") {
|
||||||
|
log.Println("Page found.")
|
||||||
|
foundPage = true
|
||||||
page = currPage
|
page = currPage
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -347,6 +352,9 @@ func chooseAndMakePayment(timerCtx context.Context, creditCardType, creditCard,
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
time.Sleep(time.Second * 1)
|
||||||
|
}
|
||||||
|
|
||||||
expiryMonth := strings.Split(creditCardExpiry, "/")[0]
|
expiryMonth := strings.Split(creditCardExpiry, "/")[0]
|
||||||
expiryYear := strings.Split(creditCardExpiry, "/")[1]
|
expiryYear := strings.Split(creditCardExpiry, "/")[1]
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user