Subversion Repositories SmartDukaan

Rev

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

Rev 23231 Rev 23232
Line 28... Line 28...
28
if live=="true":
28
if live=="true":
29
    username = 'newspice671445'
29
    username = 'newspice671445'
30
    password = 'npcs67unsd44debm'
30
    password = 'npcs67unsd44debm'
31
    wayBillApi = 'http://api.ecomexpress.in/apiv2/pincodes/'
31
    wayBillApi = 'http://api.ecomexpress.in/apiv2/pincodes/'
32
    forwardApi = 'http://api.ecomexpress.in/apiv3/manifest_awb/'
32
    forwardApi = 'http://api.ecomexpress.in/apiv3/manifest_awb/'
33
    serviceablePincodeApi = 'http://staging.ecomexpress.in/apiv2/pincodes/'
33
    serviceablePincodeApi = 'http://api.ecomexpress.in/apiv2/pincodes/'
34
else:
34
else:
35
    username = 'ecomexpress'
35
    username = 'ecomexpress'
36
    password = 'Ke$3c@4oT5m6h#$'
36
    password = 'Ke$3c@4oT5m6h#$'
37
    wayBillApi = 'http://staging.ecomexpress.in/apiv2/fetch_awb/'
37
    wayBillApi = 'http://staging.ecomexpress.in/apiv2/fetch_awb/'
38
    forwardApi = 'http://staging.ecomexpress.in/apiv2/manifest_awb/'
38
    forwardApi = 'http://staging.ecomexpress.in/apiv2/manifest_awb/'
Line 244... Line 244...
244
              'state' : ''
244
              'state' : ''
245
              }
245
              }
246
    data = urllib.urlencode(values)
246
    data = urllib.urlencode(values)
247
    req = urllib2.Request(serviceablePincodeApi, data)
247
    req = urllib2.Request(serviceablePincodeApi, data)
248
    response = urllib2.urlopen(req)
248
    response = urllib2.urlopen(req)
249
    the_page = response.read()    
249
    the_page = response.read()
250
    return json.loads(the_page)
250
    return json.loads(the_page)
251
 
251
 
252
def main():
252
def main():
253
    print generate_awb(DeliveryType.COD)
253
    print generate_awb(DeliveryType.COD)
254
 
254