Subversion Repositories SmartDukaan

Rev

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

Rev 16167 Rev 16371
Line 75... Line 75...
75
                'Malformed JSON',
75
                'Malformed JSON',
76
                'Could not decode the request body. The '
76
                'Could not decode the request body. The '
77
                'JSON was incorrect.')
77
                'JSON was incorrect.')
78
        try:
78
        try:
79
            store = main.getStore(req.get_param_as_int("storeId"))
79
            store = main.getStore(req.get_param_as_int("storeId"))
80
            if req.get_param_as_int("storeId") == 1:
-
 
81
                result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
80
            result = store.trackOrdersForUser(int(userId),req_obj['url'][0],req_obj['html'][0])
82
                resp.body = json.dumps({'result':result}, encoding='utf-8')
81
            resp.body = json.dumps({'result':result}, encoding='utf-8')
83
            else:
-
 
84
                resp.body = json.dumps({'result':'NOT_IMPLEMENTED'}, encoding='utf-8')
-
 
85
            '''
82
            '''
86
            elif req.get_param_as_int("storeId") == 7:
83
            elif req.get_param_as_int("storeId") == 7:
87
                if 'myprofile' in req_obj['url'][0]:
84
                if 'myprofile' in req_obj['url'][0]:
88
                    result = store.parseMyProfileForEmailId(int(userId),req_obj['url'][0],req_obj['html'][0])
85
                    result = store.parseMyProfileForEmailId(int(userId),req_obj['url'][0],req_obj['html'][0])
89
                else:
86
                else:
Line 91... Line 88...
91
                resp.body = json.dumps({'result':result}, encoding='utf-8')
88
                resp.body = json.dumps({'result':result}, encoding='utf-8')
92
            '''
89
            '''
93
        except:
90
        except:
94
            resp.body = json.dumps({'result':'PARSE_ERROR'}, encoding='utf-8')
91
            resp.body = json.dumps({'result':'PARSE_ERROR'}, encoding='utf-8')
95
            
92
            
96
        print "Returned from track POST", resp.body
-
 
97
        resp.body = json.dumps({'result':'PARSE_ERROR'}, encoding='utf-8')
-
 
98
        
-
 
99
    
93
    
100
    def on_get(self, req, resp, userId):
94
    def on_get(self, req, resp, userId):
101
        try:
95
        try:
102
            storeId = req.get_param_as_int("storeId")
96
            storeId = req.get_param_as_int("storeId")
103
            result = main.getStore(storeId).getTrackingUrls(int(userId))
97
            result = main.getStore(storeId).getTrackingUrls(int(userId))