Subversion Repositories SmartDukaan

Rev

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

Rev 17717 Rev 17718
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 = rawHtml.encode('utf-8')
52
        rawHtml = re.sub(r'[^\x00-\x7F]+',' ', rawHtml)
53
        parseString = "Tracking" if track else "Transacted"
53
        parseString = "Tracking" if track else "Transacted"
54
        print parseString, "Order Id to be parsed is :", orderId
54
        print parseString, "Order Id to be parsed is :", orderId
55
        resp = {}
55
        resp = {}
56
        resp['result'] = 'ORDER_NOT_CREATED'
56
        resp['result'] = 'ORDER_NOT_CREATED'
57
        if ORDER_SUCCESS_URL in orderSuccessUrl or THANKYOU_URL in orderSuccessUrl:
57
        if ORDER_SUCCESS_URL in orderSuccessUrl or THANKYOU_URL in orderSuccessUrl:
Line 473... Line 473...
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
            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']
474
        else: 
474
        else: 
475
            return missingOrderUrls
475
            return missingOrderUrls
476
            
476
            
477
    def trackOrdersForUser(self, userId, url, rawHtml):
477
    def trackOrdersForUser(self, userId, url, rawHtml):
478
        rawHtml = rawHtml.encode('utf-8')
478
        rawHtml = re.sub(r'[^\x00-\x7F]+',' ', rawHtml)
479
        directory = "/AmazonTrack/User" + str(userId)
479
        directory = "/AmazonTrack/User" + str(userId)
480
        if not os.path.exists(directory):
480
        if not os.path.exists(directory):
481
            os.makedirs(directory)
481
            os.makedirs(directory)
482
        
482
        
483
        
483