- Timestamp:
- 20 Sep 2019, 06:51:47 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r15593 r15596 113 113 def test_query_history(self): 114 114 transaction_id = str(random.randint(100000000, 999999999)) 115 r esponse= query_history(HOST, self.terminal_id,116 transaction_id, HTTPS , 'http://xxxxx')115 raw, formvars = query_history(HOST, self.terminal_id, 116 transaction_id, HTTPS) 117 117 self.assertTrue( 118 118 'Transaction with the given transaction_id (%s) not found' 119 % transaction_id in r esponse)119 % transaction_id in raw) 120 120 # Okay, let's create a transaction 121 121 caller_response = create_transaction(transaction_id) … … 123 123 # It seems that the transaction has been created but we don't get a 124 124 # useful response 125 query_response= query_history(HOST, self.terminal_id,126 transaction_id, HTTPS , 'http://xxxxx')125 raw, formvars = query_history(HOST, self.terminal_id, 126 transaction_id, HTTPS) 127 127 self.assertTrue( 128 128 '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"\r\n ' 129 '"http://www.w3.org/TR/html4/loose.dtd">' in query_response)129 '"http://www.w3.org/TR/html4/loose.dtd">' in raw) 130 130 # The same, an 'empty' response obviously means that the transaction 131 131 # was found but no result was sent to the response_url because the … … 139 139 # Peter has manually created a successful payment. Let's use this one. 140 140 transaction_id = 'etz1568638104web' 141 query_response= query_history(HOST, self.terminal_id,142 transaction_id, HTTPS , 'http://xxxxx')141 raw, formvars = query_history(HOST, self.terminal_id, 142 transaction_id, HTTPS) 143 143 # Now eTranzact is redirecting but the response is still useless 144 self.assertTrue('Redirecting...' in raw) 144 145 print query_response 145 self.assertTrue('Redirecting...' in query_response)146 146 return 147 147 … … 177 177 self.browser.getLink("Pay via eTranzact").click() 178 178 self.assertTrue("Pay now" in self.browser.contents) 179 # create an eTranzact transaction.180 logo_url = 'http://xxxx'181 responseurl = self.payment_url + '/receive_etranzact'182 amount = "%.1f" % self.payment.amount_auth183 customer = self.applicant184 hashargs = amount + TERMINAL_ID + self.payment.p_id \185 + responseurl + 'DEMO_KEY'186 hashvalue = hashlib.md5(hashargs).hexdigest()187 post_caller(HOST, HTTPS, TERMINAL_ID,188 self.payment.p_id, responseurl,189 self.payment.amount_auth, customer.email,190 customer.phone,191 customer.display_fullname, hashvalue,192 logo_url)193 self.browser.open(self.payment_url + '/requery_history')194 # Means of testing end here.195 196 #hashargs = amount + TERMINAL_ID + 'etz1568638104web' \197 # + responseurl + 'DEMO_KEY'198 #hashvalue = hashlib.md5(hashargs).hexdigest()199 #self.browser.open(self.payment_url + '/requery_history')200 #self.browser.getControl("Requery now").click()201 #import pdb; pdb.set_trace()202 203 179 204 180 return
Note: See TracChangeset for help on using the changeset viewer.