Пример #1
0
    def process(self):
        order_id = self.parameters.get('order_id')
        logging.info("GetOrderView. order_id:{}".format(order_id))
        order = OrderService.get_order(order_id)
        if (order):
            order_info = {
                'order_id': order.id,
                "user_id": order.user_id,
                "thunderservice_id" : order.thunderservice_id,
                "placeOrderTime" : order.placeOrderTime,
                "coupon": order.coupon,
                "paymentMethod": order.paymentMethod,
                "paymentTime": order.paymentTime,
                "paymentSN": order.paymentSN,
                "emailNotification": order.emailNotification,
                "amount":order.amount,
                "orderStatus":order.orderStatus,
                "thunderserviceStatus":order.thunderserviceStatus
            }

            return {
                "code": 200,
                "message": "get order success",
                "results": order_info
            }
        return {
            "code": 4013,
            "message": returncode['4013']
        },200
Пример #2
0
    def process(self):
        order_id = self.parameters.get('order_id')
        order = OrderService.get_order(order_id)
        if order.orderStatus == '2':
            if order.thunderserviceStatus != '1':
                if OrderService.make_fulfill(order_id):
                    return{
                             "code":200,
                             "message": "order fulfilled success"
                         },200
                else:
                    return{
                              "code":4011,
                              "message": returncode['4011']
                          },200

        elif order:
            return{
                      "code":4016,
                      "message": returncode['4016']
                  },200
        else:
            return{
                "code":4013,
                "message": returncode['4013']
            },200
Пример #3
0
 def process(self):
     order_id = self.parameters.get('order_id')
     order_data = OrderService.get_order(order_id)
     if order_data:
         OrderService.delete_order(order_id)
         db.session.commit()
         return{
             "code":200,
             "message":"delete success"
         }
     else:
         return{
             "code":4013,
             "message": returncode['4013']
         } ,200
Пример #4
0
 def process(self):
     order_id = self.parameters.get('order_id')
     print (self.parameters)
     order_data = OrderService.get_order(order_id)
     if order_data:
         OrderService.mark_paid_order(order_id)
         db.session.commit()
         return{
             "code":200,
             "message":"Mark this order as paid success"
         },200
     else:
         return{
             "code":4013,
             "message": returncode['4013']
         },200
Пример #5
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