Subversion Repositories SmartDukaan

Rev

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

Rev 13629 Rev 13631
Line 93... Line 93...
93
        
93
        
94
class StoreOrder():
94
class StoreOrder():
95
    def on_post(self, req, resp):
95
    def on_post(self, req, resp):
96
        
96
        
97
        try:
97
        try:
-
 
98
            string1 = req.stream.read()
98
            req_json = json.loads(req.stream.read(), encoding='utf-8')
99
            req_json = json.loads(string1, encoding='utf-8')
99
        except ValueError:
100
        except ValueError:
100
            raise falcon.HTTPError(falcon.HTTP_400,
101
            raise falcon.HTTPError(falcon.HTTP_400,
101
                'Malformed JSON',
102
                'Malformed JSON',
102
                'Could not decode the request body. The '
103
                'Could not decode the request body. The '
103
                'JSON was incorrect.')
104
                'JSON was incorrect.')
104
            
105
            
105
        store = main.getStore(req_json['sourceId'])
106
        store = main.getStore(int(req_json['sourceId']))
106
        result = store.parseOrderRawHtml(req_json['orderId'], req_json['subTagId'], req_json['userId'], req_json['rawHtml'], req_json['orderSuccessUrl'])
107
        result = store.parseOrderRawHtml(int(req_json['orderId']), req_json['subTagId'], int(req_json['userId']), req_json['rawHtml'], req_json['orderSuccessUrl'])
107
        resp.body = json.dumps({"result":result}, encoding='utf-8')
108
        resp.body = json.dumps({"result":result}, encoding='utf-8')
108
    
109
    
109
    def on_get(self, req, resp, userId):
110
    def on_get(self, req, resp, userId):
110
        page = req.get_param_as_int("page")
111
        page = req.get_param_as_int("page")
111
        window = req.get_param_as_int("window")
112
        window = req.get_param_as_int("window")