| Line 122... |
Line 122... |
| 122 |
spString = re.sub('<\?.*\?>','',spString)
|
122 |
spString = re.sub('<\?.*\?>','',spString)
|
| 123 |
spString = "<dom>" + spString + "</dom>"
|
123 |
spString = "<dom>" + spString + "</dom>"
|
| 124 |
dom = parseString(spString)
|
124 |
dom = parseString(spString)
|
| 125 |
response = dom.getElementsByTagName('CheckStatusObj')[0]
|
125 |
response = dom.getElementsByTagName('CheckStatusObj')[0]
|
| 126 |
transStatus = response.getElementsByTagName('transStatus')[0].childNodes[0].data
|
126 |
transStatus = response.getElementsByTagName('transStatus')[0].childNodes[0].data
|
| 127 |
try:
|
- |
|
| 128 |
responseCode = response.getElementsByTagName('ResponseCode')[0].childNodes[0].data
|
127 |
responseCode = response.getElementsByTagName('ResponseCode')[0].childNodes[0].data
|
| 129 |
responseDescription = response.getElementsByTagName('ResponseDescription')[0].childNodes[0].data
|
128 |
responseDescription = response.getElementsByTagName('ResponseDescription')[0].childNodes[0].data
|
| 130 |
except:
|
- |
|
| 131 |
responseCode = ""
|
- |
|
| 132 |
responseDescription = ""
|
- |
|
| 133 |
if responseCode == '00' and transStatus == 'S':
|
129 |
if responseCode == '00' and transStatus == 'S':
|
| 134 |
return True, responseDescription
|
130 |
return True, responseDescription
|
| - |
|
131 |
elif responseCode in ('STO','US', 'UP') and transStatus == 'S':
|
| - |
|
132 |
raise Exception(111, "Still status is not known")
|
| 135 |
else:
|
133 |
else:
|
| 136 |
return False, responseDescription
|
134 |
return False, responseDescription
|
| 137 |
|
135 |
|
| 138 |
def getRefunds(forDate):
|
136 |
def getRefunds(forDate):
|
| 139 |
spString = getRechargeClient().service.checkRefundHistory(username, password, '3306', forDate.strftime("%d-%m-%Y"))
|
137 |
spString = getRechargeClient().service.checkRefundHistory(username, password, '3306', forDate.strftime("%d-%m-%Y"))
|