Changeset 15593
- Timestamp:
- 19 Sep 2019, 10:12:53 (5 years ago)
- Location:
- main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/browser_templates/requery_etranzact.pt
r15589 r15593 12 12 Transaction Id:</td> 13 13 <td> 14 <span tal:replace="view/ context/p_id">TRANSID</span>14 <span tal:replace="view/transaction_id">TRANSID</span> 15 15 </td> 16 16 </tr> -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/helpers.py
r15589 r15593 54 54 return 'Connection error (%s, %s)' % (response.status, response.reason) 55 55 resp = response.read() 56 resp = resp.replace('\r\n','')57 # eTranzact sends strange HTML tags which must be removed.58 resp = re.sub("<.*?>", "", resp)59 56 return resp 60 57 -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/etranzact/tests.py
r15589 r15593 115 115 response = query_history(HOST, self.terminal_id, 116 116 transaction_id, HTTPS, 'http://xxxxx') 117 self.assertEqual( 118 response, 117 self.assertTrue( 119 118 'Transaction with the given transaction_id (%s) not found' 120 % transaction_id )119 % transaction_id in response) 121 120 # Okay, let's create a transaction 122 121 caller_response = create_transaction(transaction_id) … … 126 125 query_response = query_history(HOST, self.terminal_id, 127 126 transaction_id, HTTPS, 'http://xxxxx') 128 self.assertEqual(query_response, '') 127 self.assertTrue( 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 130 # The same, an 'empty' response obviously means that the transaction 130 # was found. The result was sent to the response_url (see below). 131 # We need browser tests. 131 # was found but no result was sent to the response_url because the 132 # payment was cancelled. 133 134 # Peter: No response would be returned because payment status information 135 # was not saved. Whenever you get a null response, means payment was 136 # not received only payments with error code 0 is successful. 137 # So in this case transaction fails. 138 139 # Peter has manually created a successful payment. Let's use this one. 140 transaction_id = 'etz1568638104web' 141 query_response = query_history(HOST, self.terminal_id, 142 transaction_id, HTTPS, 'http://xxxxx') 143 # Now eTranzact is redirecting but the response is still useless 144 print query_response 145 self.assertTrue('Redirecting...' in query_response) 132 146 return 133 147 … … 163 177 self.browser.getLink("Pay via eTranzact").click() 164 178 self.assertTrue("Pay now" in self.browser.contents) 165 # Means of testing end here. We have to manually166 179 # create an eTranzact transaction. 167 180 logo_url = 'http://xxxx' … … 178 191 customer.display_fullname, hashvalue, 179 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 180 204 return 181 205
Note: See TracChangeset for help on using the changeset viewer.