| Line 51... |
Line 51... |
| 51 |
aggTID = response.getElementsByTagName('aggregatorId')[0].childNodes[0].data
|
51 |
aggTID = response.getElementsByTagName('aggregatorId')[0].childNodes[0].data
|
| 52 |
providerTID = response.getElementsByTagName('ProviderTID')[0].childNodes[0].data
|
52 |
providerTID = response.getElementsByTagName('ProviderTID')[0].childNodes[0].data
|
| 53 |
except:
|
53 |
except:
|
| 54 |
aggTID = ''
|
54 |
aggTID = ''
|
| 55 |
providerTID = ''
|
55 |
providerTID = ''
|
| - |
|
56 |
|
| - |
|
57 |
if retCode !='00' or retStatus !='S':
|
| - |
|
58 |
try:
|
| - |
|
59 |
if (checkTransactionStatus('',transactionId))[0]:
|
| - |
|
60 |
return 'S','00', spiceTID, retDesc, aggTID, providerTID
|
| - |
|
61 |
except:
|
| - |
|
62 |
pass
|
| - |
|
63 |
|
| 56 |
return retStatus, retCode, spiceTID, retDesc, aggTID, providerTID
|
64 |
return retStatus, retCode, spiceTID, retDesc, aggTID, providerTID
|
| - |
|
65 |
|
| - |
|
66 |
def checkTransactionStatus(spiceTID='', merchantTxnId=''):
|
| - |
|
67 |
spString = getRechargeClient().service.getCheckStatus(username,password,spiceTID,merchantTxnId)
|
| - |
|
68 |
print spString
|
| - |
|
69 |
spString = re.sub('<\?.*\?>','',spString)
|
| - |
|
70 |
spString = "<dom>" + spString + "</dom>"
|
| - |
|
71 |
dom = parseString(spString)
|
| - |
|
72 |
response = dom.getElementsByTagName('CheckStatusObj')[0]
|
| - |
|
73 |
transStatus = response.getElementsByTagName('transStatus')[0].childNodes[0].data
|
| - |
|
74 |
responseCode = response.getElementsByTagName('ResponseCode')[0].childNodes[0].data
|
| - |
|
75 |
try:
|
| - |
|
76 |
responseDescription = response.getElementsByTagName('ResponseDescription')[0].childNodes[0].data
|
| - |
|
77 |
except:
|
| - |
|
78 |
responseDescription = ""
|
| - |
|
79 |
aggregatorRespCode = response.getElementsByTagName('aggregatorRespCode')[0].childNodes[0].data
|
| - |
|
80 |
if responseCode == '00' and transStatus == 'S':
|
| - |
|
81 |
return True, responseDescription
|
| - |
|
82 |
elif responseCode in ('STO','US', 'UP') and transStatus == 'S':
|
| - |
|
83 |
if aggregatorRespCode == '00':
|
| - |
|
84 |
return True, responseDescription
|
| - |
|
85 |
if aggregatorRespCode != 'NA':
|
| - |
|
86 |
return False, responseDescription
|
| - |
|
87 |
raise Exception(111, "Still status is not known")
|
| - |
|
88 |
else:
|
| - |
|
89 |
return False, responseDescription
|
| 57 |
|
90 |
|
| 58 |
def getAccountdetail():
|
91 |
def getAccountdetail():
|
| 59 |
return getAccountClient().service.getAccountdetail(username, password)
|
92 |
return getAccountClient().service.getAccountdetail(username, password)
|
| 60 |
|
93 |
|
| 61 |
def getBalance():
|
94 |
def getBalance():
|
| Line 127... |
Line 160... |
| 127 |
for detail in details:
|
160 |
for detail in details:
|
| 128 |
serviceDetails['Denomination Type'] = detail.getElementsByTagName('DenominationType')[0].childNodes[0].data
|
161 |
serviceDetails['Denomination Type'] = detail.getElementsByTagName('DenominationType')[0].childNodes[0].data
|
| 129 |
serviceDetails['Denomination Value'] = detail.getElementsByTagName('DenominationValue')[0].childNodes[0].data
|
162 |
serviceDetails['Denomination Value'] = detail.getElementsByTagName('DenominationValue')[0].childNodes[0].data
|
| 130 |
return serviceDetails
|
163 |
return serviceDetails
|
| 131 |
|
164 |
|
| 132 |
def checkTransactionStatus(spiceTID='', merchantTxnId=''):
|
- |
|
| 133 |
spString = getRechargeClient().service.getCheckStatus(username,password,spiceTID,merchantTxnId)
|
- |
|
| 134 |
print spString
|
- |
|
| 135 |
spString = re.sub('<\?.*\?>','',spString)
|
- |
|
| 136 |
spString = "<dom>" + spString + "</dom>"
|
- |
|
| 137 |
dom = parseString(spString)
|
- |
|
| 138 |
response = dom.getElementsByTagName('CheckStatusObj')[0]
|
- |
|
| 139 |
transStatus = response.getElementsByTagName('transStatus')[0].childNodes[0].data
|
- |
|
| 140 |
responseCode = response.getElementsByTagName('ResponseCode')[0].childNodes[0].data
|
- |
|
| 141 |
try:
|
- |
|
| 142 |
responseDescription = response.getElementsByTagName('ResponseDescription')[0].childNodes[0].data
|
- |
|
| 143 |
except:
|
- |
|
| 144 |
responseDescription = ""
|
- |
|
| 145 |
aggregatorRespCode = response.getElementsByTagName('aggregatorRespCode')[0].childNodes[0].data
|
- |
|
| 146 |
if responseCode == '00' and transStatus == 'S':
|
- |
|
| 147 |
return True, responseDescription
|
- |
|
| 148 |
elif responseCode in ('STO','US', 'UP') and transStatus == 'S':
|
- |
|
| 149 |
if aggregatorRespCode == '00':
|
- |
|
| 150 |
return True, responseDescription
|
- |
|
| 151 |
if aggregatorRespCode != 'NA':
|
- |
|
| 152 |
return False, responseDescription
|
- |
|
| 153 |
raise Exception(111, "Still status is not known")
|
- |
|
| 154 |
else:
|
- |
|
| 155 |
return False, responseDescription
|
- |
|
| 156 |
|
165 |
|
| 157 |
def getRefunds(forDate):
|
166 |
def getRefunds(forDate):
|
| 158 |
spString = getRechargeClient().service.checkRefundHistory(username, password, '3306', forDate.strftime("%d-%m-%Y"))
|
167 |
spString = getRechargeClient().service.checkRefundHistory(username, password, '3306', forDate.strftime("%d-%m-%Y"))
|
| 159 |
print spString
|
168 |
print spString
|
| 160 |
refundDetails = {}
|
169 |
refundDetails = {}
|