Subversion Repositories SmartDukaan

Rev

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

Rev 16561 Rev 16626
Line 105... Line 105...
105
            self.db.merchantOrder.update({"orderId":merchantOrder['orderId']}, {"$set":{"parseError":True}})
105
            self.db.merchantOrder.update({"orderId":merchantOrder['orderId']}, {"$set":{"parseError":True}})
106
            traceback.print_exc()
106
            traceback.print_exc()
107
            raise
107
            raise
108
        
108
        
109
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl):
109
    def parseOrderRawHtml(self, orderId, subTagId, userId, rawHtml, orderSuccessUrl):
110
        
110
        rawHtml1 = rawHtml
111
        #Expected is json
111
        #Expected is json
112
        rawHtml = "".join(["{", find_between(rawHtml,">{", "}</pre>"), "}"])
112
        rawHtml = "".join(["{", find_between(rawHtml,">{", "}</pre>"), "}"])
113
        if rawHtml != "": 
113
        if rawHtml != "": 
114
            try:
114
            try:
115
                resp = {}
115
                resp = {}
Line 179... Line 179...
179
                    resp['result'] = 'ORDER_ALREADY_CREATED_IGNORED'
179
                    resp['result'] = 'ORDER_ALREADY_CREATED_IGNORED'
180
            except:
180
            except:
181
                resp['result'] = 'ORDER_NOT_CREATED'
181
                resp['result'] = 'ORDER_NOT_CREATED'
182
                
182
                
183
        else:
183
        else:
-
 
184
            try:
-
 
185
                soup = BeautifulSoup(rawHtml1)
-
 
186
                if soup.h2.text == 'Web page not available':
-
 
187
                    resp['result'] = 'WEB_PAGE_NOT_AVAILABLE'
-
 
188
            except:
184
            resp['result'] = 'ORDER_NOT_CREATED'
189
                resp['result'] = 'ORDER_NOT_CREATED'
185
        return resp
190
        return resp
186
            
191
            
187
    def _getStatusFromDetailedStatus(self, detailedStatus):
192
    def _getStatusFromDetailedStatus(self, detailedStatus):
188
        for key, value in Store.OrderStatusMap.iteritems():
193
        for key, value in Store.OrderStatusMap.iteritems():
189
            if detailedStatus.lower() in value:
194
            if detailedStatus.lower() in value: