Subversion Repositories SmartDukaan

Rev

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

Rev 14289 Rev 14312
Line 209... Line 209...
209
            br = getBrowserObject()
209
            br = getBrowserObject()
210
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
210
            url = ORDER_TRACK_URL + re.findall('.*(\?.*?)$', orderSuccessUrl,re.IGNORECASE)[0]
211
            page = br.open(url)
211
            page = br.open(url)
212
            page = ungzipResponse(page)
212
            page = ungzipResponse(page)
213
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)
213
            merchantOrder = self._parse(orderId, subTagId, userId, page, orderSuccessUrl)
214
            merchantOrder.orderTrackingUrl = url   
214
            merchantOrder.orderTrackingUrl = url
-
 
215
               
215
            self._saveToOrder(todict(merchantOrder))
216
            if self._saveToOrder(todict(merchantOrder)):
216
            resp['result'] = 'ORDER_CREATED'
217
                resp['result'] = 'ORDER_CREATED'
-
 
218
            else:
-
 
219
                resp['result'] = 'ORDER_ALREADY_CREATED_IGNORED'
-
 
220
                
217
            return resp
221
            return resp
218
        except:
222
        except:
219
            print "Error occurred"
223
            print "Error occurred"
220
            traceback.print_exc()
224
            traceback.print_exc()
221
            resp['result'] = 'PARSE_ERROR'
225
            resp['result'] = 'ORDER_NOT_CREATED'
222
            return resp
226
            return resp
223
             
227
             
224
        
228
        
225
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
229
        #soup = BeautifulSoup(rawHtml,convertEntities=BeautifulSoup.HTML_ENTITIES)
226
        #soup.find(name, attrs, recursive, text)
230
        #soup.find(name, attrs, recursive, text)