Subversion Repositories SmartDukaan

Rev

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

Rev 12991 Rev 20251
Line 15... Line 15...
15
recharge_url = 'https://api.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
store_map = {
-
 
21
             'H01':'105',
-
 
22
'H02':'109',
-
 
23
'H03':'113',
-
 
24
'H04':'115',
-
 
25
'H05':'116',
-
 
26
'H06':'119',
-
 
27
'H07':'120',
-
 
28
'H08':'125',
-
 
29
'H09':'129',
-
 
30
'H10':'130',
-
 
31
'H11':'131',
-
 
32
'H12':'132',
-
 
33
'H13':'133',
-
 
34
'H14':'134',
-
 
35
'H15':'135',
-
 
36
'H16':'141',
-
 
37
'H17':'143',
-
 
38
'H18':'144',
-
 
39
'H19':'146',
-
 
40
'H20':'147',
-
 
41
'H21':'150',
-
 
42
'H22':'151',
-
 
43
'H23':'153',
-
 
44
'H24':'159',
-
 
45
'H25':'164',
-
 
46
'H26':'189',
-
 
47
'H27':'226',
-
 
48
'H28':'230',
-
 
49
'H29':'253',
-
 
50
'H30':'254',
-
 
51
'H31':'265',
-
 
52
'H32':'281',
-
 
53
'H33':'296',
-
 
54
'H34':'327',
-
 
55
'H35':'358',
-
 
56
'H36':'425',
-
 
57
'H37':'427',
-
 
58
'H38':'440',
-
 
59
'H39':'441',
-
 
60
'H40':'469',
-
 
61
'H41':'475',
-
 
62
'H42':'502',
-
 
63
'H43':'C31',
-
 
64
'H44':'C33',
-
 
65
'H45':'C34',
-
 
66
'H46':'C52',
-
 
67
'H47':'C70',
-
 
68
'H48':'C76',
-
 
69
'H49':'C86',
-
 
70
'H50':'C87',
-
 
71
'H51':'CA6',
-
 
72
'H52':'CB7',
-
 
73
'H53':'CC5',
-
 
74
'H54':'CC9',
-
 
75
'H55':'CE0',
-
 
76
'H56':'CF6',
-
 
77
'H57':'CF8',
-
 
78
'H58':'CG3',
-
 
79
'H59':'CQ0',
-
 
80
'H60':'CQ9',
-
 
81
'H61':'CR4',
-
 
82
'H62':'CS0',
-
 
83
'H70':'M01',
-
 
84
'H71':'M02',
-
 
85
'H72':'M07',
-
 
86
'H73':'M08',
-
 
87
'H74':'MB5',
-
 
88
'H75':'CM8',
-
 
89
'H76':'M78',
-
 
90
'H77':'112',
-
 
91
'H78':'137',
-
 
92
'H79':'138',
-
 
93
'H80':'165',
-
 
94
'H81':'255',
-
 
95
'H82':'317',
-
 
96
'H83':'347',
-
 
97
'H84':'476',
-
 
98
'H85':'477',
-
 
99
'H86':'518',
-
 
100
'H87':'C49',
-
 
101
'H88':'CC4',
-
 
102
'H89':'CF9',
-
 
103
'H90':'178',
-
 
104
'H91':'183',
-
 
105
'H92':'200',
-
 
106
'H93':'239',
-
 
107
'H94':'309',
-
 
108
'H95':'CD1',
-
 
109
'H96':'CD8',
-
 
110
'H97':'CE1',
-
 
111
'H98':'CI5',
-
 
112
'H99':'CK6',
-
 
113
'HA0':'CL2',
-
 
114
'HA1':'CN5',
-
 
115
'HA2':'G02',
-
 
116
'HA3':'G03',
-
 
117
'HA4':'G04',
-
 
118
'HA5':'G05',
-
 
119
'HA6':'G06',
-
 
120
'HA7':'G07',
-
 
121
'HA8':'G10',
-
 
122
'HA9':'G12',
-
 
123
'HB0':'G14',
-
 
124
'HB1':'G15',
-
 
125
'HB2':'G17',
-
 
126
'HB3':'M49',
-
 
127
'HB4':'M51',
-
 
128
'HB5':'M54',
-
 
129
'HB6':'353',
-
 
130
'HB7':'414',
-
 
131
'HB8':'431',
-
 
132
'HB9':'CA0',
-
 
133
'HC0':'CK4',
-
 
134
'HC1':'M26',
-
 
135
'HC2':'M27',
-
 
136
'HC3':'208',
-
 
137
'HC4':'215',
-
 
138
'HC5':'231',
-
 
139
'HC6':'240',
-
 
140
'HC7':'252',
-
 
141
'HC8':'289',
-
 
142
'HC9':'383',
-
 
143
'HD0':'CB3',
-
 
144
'HD1':'CD7',
-
 
145
'HD2':'CJ0',
-
 
146
'HD3':'CM3',
-
 
147
'HD4':'CN9',
-
 
148
'HD5':'CO3',
-
 
149
'HD6':'CQ1',
-
 
150
'HD7':'M46',
-
 
151
'HD8':'424',
-
 
152
'HD9':'M64',
-
 
153
'HE0':'145',
-
 
154
'HE1':'160',
-
 
155
'HE2':'328',
-
 
156
'HE3':'331',
-
 
157
'HE4':'343',
-
 
158
'HE5':'393',
-
 
159
'HE6':'460',
-
 
160
'HE7':'C25',
-
 
161
'HE8':'C84',
-
 
162
'HE9':'CB2',
-
 
163
'HF0':'CC3',
-
 
164
'HF1':'CC7',
-
 
165
'HF2':'CH5',
-
 
166
'HF3':'CP3',
-
 
167
'HF7':'M15',
-
 
168
'HF8':'471',
-
 
169
'HF9':'472',
-
 
170
'HG0':'481',
-
 
171
'HG1':'483',
-
 
172
'HG2':'484',
-
 
173
'HG3':'486',
-
 
174
'HG4':'C14',
-
 
175
'HG5':'C15',
-
 
176
'HG6':'C21',
-
 
177
'HG7':'C23',
-
 
178
'HG8':'C98',
-
 
179
'HG9':'CD2',
-
 
180
'HH0':'CD4',
-
 
181
'HH1':'CD5',
-
 
182
'HH2':'CG4',
-
 
183
'HH3':'CG5',
-
 
184
'HH4':'CG7',
-
 
185
'HH5':'CG8',
-
 
186
'HH6':'CI1',
-
 
187
'HH7':'CJ1',
-
 
188
'HH8':'CJ7',
-
 
189
'HH9':'CK1',
-
 
190
'HI0':'CK2',
-
 
191
'HI1':'CM1',
-
 
192
'HI2':'CM2',
-
 
193
'HI3':'CM5',
-
 
194
'HI4':'CN0',
-
 
195
'HI5':'CN4',
-
 
196
'HI6':'CO0',
-
 
197
'HI7':'CQ4',
-
 
198
'HI8':'CQ5',
-
 
199
'HI9':'CR8'
-
 
200
            }
-
 
201
 
20
allow_recharge_string = ConfigClient().get_property('allow_recharge')
202
allow_recharge_string = ConfigClient().get_property('allow_recharge')
21
 
203
 
22
if allow_recharge_string in ['True', 'true']:
204
if allow_recharge_string in ['True', 'true']:
23
    allow_recharge = True    
205
    allow_recharge = True    
24
 
206
 
Line 35... Line 217...
35
    return raclient
217
    return raclient
36
 
218
 
37
def rechargeDevice(transactionId, rechargeType, strProviderCode, deviceNumber, amount, plan, storeCode = '', rechargeMode=None):
219
def rechargeDevice(transactionId, rechargeType, strProviderCode, deviceNumber, amount, plan, storeCode = '', rechargeMode=None):
38
    if not allow_recharge:
220
    if not allow_recharge:
39
        return 'S', '00', 'spiceTID', 'SUCCESS', 'aggTID', 'providerTID'
221
        return 'S', '00', 'spiceTID', 'SUCCESS', 'aggTID', 'providerTID'
-
 
222
    if storeCode:
-
 
223
        storeCode=store_map.get(storeCode)
-
 
224
        if storeCode is None:
-
 
225
            return '', '', '', 'Store Code is Not Mapped', '', '' 
40
    spString = getRechargeClient().service.getRecharge(username, password, '919650889334', 'SOAP', '115.249.47.66', transactionId, rechargeType, strProviderCode, deviceNumber, amount, 'DEBIT', plan, storeCode)
226
    spString = getRechargeClient().service.getRecharge(username, password, '919650889334', 'SOAP', '115.249.47.66', transactionId, rechargeType, strProviderCode, deviceNumber, amount, 'DEBIT', plan, storeCode)
41
    print spString
227
    print spString
42
    spString = re.sub('<\?.*\?>','',spString)
228
    spString = re.sub('<\?.*\?>','',spString)
43
    spString = "<dom>" + spString + "</dom>"
229
    spString = "<dom>" + spString + "</dom>"
44
    dom = parseString(spString)
230
    dom = parseString(spString)