Class: Vantiv::Certification::PaypageDriver

Inherits:
Object
  • Object
show all
Defined in:
lib/vantiv/certification/paypage_driver.rb

Instance Method Summary collapse

Instance Method Details

#get_paypage_registration_id(card_number, cvv = '123') ⇒ Object



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# File 'lib/vantiv/certification/paypage_driver.rb', line 19

def get_paypage_registration_id(card_number, cvv = '123')
  driver.navigate.to paypage_server.root_path

  driver.switch_to.frame('vantiv-payframe')
  driver.find_element(:id, 'accountNumber').send_keys card_number
  driver.find_element(:id, 'cvv').send_keys cvv

  driver.switch_to.default_content
  button = driver.find_element(:id, 'submit')
  button.click

  wait = Selenium::WebDriver::Wait.new(:timeout => 10)
  wait.until {
    driver.find_element(:id, "request-status").text.include?("Request Complete")
  }

  driver.find_element(:id, 'temp-token').text
end

#startObject



8
9
10
11
12
# File 'lib/vantiv/certification/paypage_driver.rb', line 8

def start
  paypage_server.start
  start_driver
  self
end

#stopObject



14
15
16
17
# File 'lib/vantiv/certification/paypage_driver.rb', line 14

def stop
  paypage_server.stop
  driver.quit
end