Subversion Repositories SmartDukaan

Rev

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

Rev 14065 Rev 14074
Line 122... Line 122...
122
    #This should be exposed from api for specific sources
122
    #This should be exposed from api for specific sources
123
    def scrapeStoreOrders(self):
123
    def scrapeStoreOrders(self):
124
        pass
124
        pass
125
    
125
    
126
    def getTrackingUrls(self, userId):
126
    def getTrackingUrls(self, userId):
-
 
127
        
-
 
128
        missingOrderUrls = []
-
 
129
        missingOrders = self._getMissingOrders({'userId':userId})
-
 
130
        for missingOrder in missingOrders:
-
 
131
            missingOrderUrls.append(ORDER_REDIRECT_URL%(missingOrder['merchantOrderId']))
127
        orders = self._getActiveOrders({'userId':userId})
132
        orders = self._getActiveOrders({'userId':userId})
128
        print "orders", orders
133
        print "orders", orders
129
        count = len(orders)
134
        count = len(orders)
130
        print "count", count
135
        print "count", count
131
        if count > 0:
136
        if count > 0:
132
            return ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled']
137
            return missingOrderUrls + ['https://www.amazon.in/gp/css/order-history', 'https://www.amazon.in/gp/css/order-history/?orderFilter=cancelled']
133
        else: 
138
        else: 
134
            return []
139
            return missingOrderUrls
135
            
140
            
136
    def trackOrdersForUser(self, userId, url, rawHtml):
141
    def trackOrdersForUser(self, userId, url, rawHtml):
137
        try:
142
        try:
138
            searchMap = {'userId':userId}
143
            searchMap = {'userId':userId}
139
            collectionMap = {'merchantOrderId':1}
144
            collectionMap = {'merchantOrderId':1}