Subversion Repositories SmartDukaan

Rev

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

Rev 17709 Rev 17715
Line 47... Line 47...
47
        
47
        
48
    def getName(self):
48
    def getName(self):
49
        return "amazon"
49
        return "amazon"
50
    
50
    
51
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl, track=False):
51
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl, track=False):
-
 
52
        rawHtml = unicode(rawHtml, errors='ignore')
52
        parseString = "Tracking" if track else "Transacted"
53
        parseString = "Tracking" if track else "Transacted"
53
        print parseString, "Order Id to be parsed is :", orderId
54
        print parseString, "Order Id to be parsed is :", orderId
54
        resp = {}
55
        resp = {}
55
        resp['result'] = 'ORDER_NOT_CREATED'
56
        resp['result'] = 'ORDER_NOT_CREATED'
56
        if ORDER_SUCCESS_URL in orderSuccessUrl or THANKYOU_URL in orderSuccessUrl:
57
        if ORDER_SUCCESS_URL in orderSuccessUrl or THANKYOU_URL in orderSuccessUrl:
Line 472... Line 473...
472
            return missingOrderUrls + ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled&startIndex=10']
473
            return missingOrderUrls + ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled&startIndex=10']
473
        else: 
474
        else: 
474
            return missingOrderUrls
475
            return missingOrderUrls
475
            
476
            
476
    def trackOrdersForUser(self, userId, url, rawHtml):
477
    def trackOrdersForUser(self, userId, url, rawHtml):
-
 
478
        rawHtml = unicode(rawHtml, errors='ignore')
477
        directory = "/AmazonTrack/User" + str(userId)
479
        directory = "/AmazonTrack/User" + str(userId)
478
        if not os.path.exists(directory):
480
        if not os.path.exists(directory):
479
            os.makedirs(directory)
481
            os.makedirs(directory)
480
        
482
        
481
        
483