Changeset 11914 for main/kofacustom.nigeria
- Timestamp:
- 30 Oct 2014, 16:43:11 (10 years ago)
- Location:
- main/kofacustom.nigeria/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/kofacustom.nigeria/trunk/CHANGES.txt
r11780 r11914 4 4 1.2 (unreleased) 5 5 ================ 6 7 - Be prepared for https webservice requests. 6 8 7 9 - Add more exam subjects. -
main/kofacustom.nigeria/trunk/src/kofacustom/nigeria/interswitch/helpers.py
r10273 r11914 25 25 from kofacustom.nigeria.interfaces import MessageFactory as _ 26 26 27 def SOAP_post(soap_action, xml, host, url ):27 def SOAP_post(soap_action, xml, host, url, https): 28 28 """Handles making the SOAP request. 29 29 … … 31 31 http://testwebpay.interswitchng.com/test_paydirect/services/TransactionQueryWs.asmx?op=getTransactionData 32 32 """ 33 h = httplib.HTTPConnection(host) 33 if https: 34 h = httplib.HTTPSConnection(host) 35 else: 36 h = httplib.HTTPConnection(host) 34 37 headers={ 35 38 'Host':host, … … 42 45 return response 43 46 44 def get_SOAP_response(product_id, transref, host, url ):47 def get_SOAP_response(product_id, transref, host, url, https): 45 48 xml="""\ 46 49 <?xml version="1.0" encoding="utf-8"?> … … 53 56 </soap:Body> 54 57 </soap:Envelope>""" % (product_id, transref) 55 response=SOAP_post("http://tempuri.org/getTransactionData",xml, host, url )58 response=SOAP_post("http://tempuri.org/getTransactionData",xml, host, url, https) 56 59 if response.status!=200: 57 60 return 'Connection error (%s, %s)' % (response.status, response.reason) … … 61 64 return response 62 65 63 def query_interswitch(payment, product_id, host, url ):64 sr = get_SOAP_response(product_id, payment.p_id, host, url )66 def query_interswitch(payment, product_id, host, url, https=False): 67 sr = get_SOAP_response(product_id, payment.p_id, host, url, https) 65 68 if sr.startswith('Connection error'): 66 69 msg = _('Connection error')
Note: See TracChangeset for help on using the changeset viewer.