Subversion Repositories SmartDukaan

Rev

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

Rev 20420 Rev 20421
Line 101... Line 101...
101
        orders = self._getActiveOrders()
101
        orders = self._getActiveOrders()
102
        for order in orders:
102
        for order in orders:
103
            print "Order", self.store_name, order['orderId']
103
            print "Order", self.store_name, order['orderId']
104
            try:
104
            try:
105
                closed = True
105
                closed = True
106
                url = ORDER_TRACK_URL + urlparse(order['orderSuccessUrl']).query
106
                url = ORDER_TRACK_URL + urlparse(order['orderSuccessUrl']).query    
107
                page = fetchResponseUsingProxy(url)
107
                page = fetchResponseUsingProxy(url)
108
                soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
108
                soup = BeautifulSoup(page,convertEntities=BeautifulSoup.HTML_ENTITIES)
109
                
109
                
110
                sections = soup.findAll("div", {"class":"ui-app-card-body"})
110
                sections = soup.findAll("div", {"class":"ui-app-card-body"})
111
                sections.pop(1)
111
                sections.pop(1)
Line 156... Line 156...
156
                                status=MStore.ORDER_PLACED
156
                                status=MStore.ORDER_PLACED
157
                            elif "shippingDetails-ongoing" in str(tr):
157
                            elif "shippingDetails-ongoing" in str(tr):
158
                                status = MStore.ORDER_SHIPPED
158
                                status = MStore.ORDER_SHIPPED
159
                            elif "delivery-complete" in str(tr):
159
                            elif "delivery-complete" in str(tr):
160
                                status = MStore.ORDER_DELIVERED
160
                                status = MStore.ORDER_DELIVERED
161
                                if cashbackStatus == Store.CB_PENDING:
161
                                if cashbackStatus != Store.CB_NA:
162
                                    cashbackStatus = Store.CB_APPROVED
162
                                    cashbackStatus = Store.CB_APPROVED
163
                                closedStatus = True
163
                                closedStatus = True
164
                            if "dead" in str(tr) or "shippingDetails-returnOngoing" in str(tr) or "shippingDetails-return" in str(tr):
164
                            if "dead" in str(tr) or "shippingDetails-returnOngoing" in str(tr) or "shippingDetails-return" in str(tr):
165
                                status = MStore.ORDER_CANCELLED
165
                                status = MStore.ORDER_CANCELLED
166
                                closedStatus = True
166
                                closedStatus = True