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