Example #1
0
def cancel_order():
    try:
        data = request.get_json()
        order_id = data['order']
        order_service = OrderService()
        order_service.cancel_order(order_id)
        return 'OK', 200
    except Exception as error:
        from run import app
        app.logger.error(error)
        return "Error al cargar la orden", 500
Example #2
0
 def process(self):
     order_id = self.parameters.get('order_id')
     order_data = OrderService.get_order(order_id)
     if order_data:
         if order_data.thunderserviceStatus == "1":
             return{
                       "code":4015,
                       "message": returncode['4015']
                   } ,200
         else:
             OrderService.cancel_order(order_id)
             return{
                 "code":200,
                 "message":"Cancel this order success"
         }
     else:
         return{
             "code":4013,
             "message": returncode['4013']
         } ,200