Guest User

Untitled

a guest
Mar 17th, 2013
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.01 KB | None | 0 0
  1. def grab_check_start():
  2.             try:
  3.                 g.go('https://desktop.onlive.com/login', log_file = 'log.html')
  4.                 print g.response.body
  5.                 login_status = g.xpath_text('/html/body/div[2]/section/div/h1')
  6.                 if login_status == 'Sign In':
  7.                     g.set_input("useremail", "[email protected]")
  8.                     g.set_input('userpass', 's45fdfx65')
  9.                     g.submit()
  10.             except DataNotFound:
  11.                 pass
  12.             g.go('https://desktop.onlive.com/account', log_file = 'log3.html')
  13.             print g.response.body
  14.             g.go('/account/update_billing', log_file =  'billing.html')
  15.             print g.response.body
  16.             g.set_input('cardname', str(self.First_name_input.text()))
  17.             g.set_input('cardnum', str(self.cc_number_input.text()))
  18.             type_check = str(self.cc_number_input.text())
  19.             if type_check[0] == '4':
  20.                 cc_type = 'Visa'
  21.             elif type_check[0] == '5':
  22.                 cc_type = 'MasterCard'
  23.             elif type_check[0] == '6':
  24.                 cc_type = 'Discover'
  25.             g.set_input('cardtype', cc_type)
  26.             g.set_input('seccode', str(self.Cvv_input.text()))
  27.             g.set_input('expirymonth', str(self.Exp_mm.currentText()))
  28.             g.set_input('expiryyear', str(self.Exp_year.currentText()))
  29.             g.submit()
  30.             print g.response.body
  31.             try:
  32.                 check_result = g.xpath_text('/html/body/div[2]/section/div/form/div')
  33.                 print check_result
  34.                 if check_result == 'There was a problem with the billing information you have provided.':
  35.                     cc_status = 'Cc not valid'
  36.                     self.Check_status.setText("         " + cc_status)
  37.                 else:
  38.                     cc_status = 'Cc Valid'
  39.                     self.Check_status.setText("         " + cc_status)
  40.             except DataNotFound:
  41.                 print('Check Error, see logs')
Advertisement
Add Comment
Please, Sign In to add comment