Subversion Repositories SmartDukaan

Rev

Rev 12979 | Rev 20251 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 12979 Rev 12991
Line 7... Line 7...
7
from shop2020.config.client.ConfigClient import ConfigClient
7
from shop2020.config.client.ConfigClient import ConfigClient
8
from decimal import Decimal
8
from decimal import Decimal
9
from shop2020.thriftpy.model.v1.order.ttypes import RechargeMode
9
from shop2020.thriftpy.model.v1.order.ttypes import RechargeMode
10
logging.basicConfig(level=logging.INFO)
10
logging.basicConfig(level=logging.INFO)
11
 
11
 
12
username = base64.b64encode('ashish')
12
username = base64.b64encode('saholic20')
13
password = base64.b64encode('ashish@20')
13
password = base64.b64encode('ap2020sh')
14
account_url = 'https://apistaging.spicesafar.com/McommWebServices/AccountApiMcomm?wsdl'
14
account_url = 'https://api.spicesafar.com/McommWebServices/AccountApiMcomm?wsdl'
15
recharge_url = 'https://apistaging.spicesafar.com/McommWebServices/RechargeApiMcomm?wsdl'
15
recharge_url = 'https://api.spicesafar.com/McommWebServices/RechargeApiMcomm?wsdl'
16
aclient = None
16
aclient = None
17
raclient = None
17
raclient = None
18
allow_recharge = False
18
allow_recharge = False
19
 
19
 
20
allow_recharge_string = ConfigClient().get_property('allow_recharge')
20
allow_recharge_string = ConfigClient().get_property('allow_recharge')
Line 63... Line 63...
63
            pass
63
            pass
64
    
64
    
65
    return retStatus, retCode, spiceTID, retDesc, aggTID, providerTID
65
    return retStatus, retCode, spiceTID, retDesc, aggTID, providerTID
66
 
66
 
67
def checkTransactionStatus(spiceTID='', merchantTxnId=''):
67
def checkTransactionStatus(spiceTID='', merchantTxnId=''):
-
 
68
    if not allow_recharge:
-
 
69
        return True, ''
68
    spString = getRechargeClient().service.getCheckStatus(username,password,spiceTID,merchantTxnId)
70
    spString = getRechargeClient().service.getCheckStatus(username,password,spiceTID,merchantTxnId)
69
    print spString
71
    print spString
70
    spString = re.sub('<\?.*\?>','',spString)
72
    spString = re.sub('<\?.*\?>','',spString)
71
    spString = "<dom>" + spString + "</dom>"
73
    spString = "<dom>" + spString + "</dom>"
72
    dom = parseString(spString)
74
    dom = parseString(spString)
Line 225... Line 227...
225
        responseDescription = ""
227
        responseDescription = ""
226
    return responseCode, responseDescription
228
    return responseCode, responseDescription
227
 
229
 
228
def main():
230
def main():
229
    #print rechargeDevice(20141031157,'MTP','BSP','9459060666',1,'')
231
    #print rechargeDevice(20141031157,'MTP','BSP','9459060666',1,'')
230
    print checkTransactionStatus('','201410282200')
232
    print checkTransactionStatus('','664267')
231
 
233
 
232
if __name__=='__main__':
234
if __name__=='__main__':
233
    main()
235
    main()
234
236