예제 #1
0
 def validate_payment_type(self, value):
     try:
         if not value.data or value.data == "0":
             self.payment_type.data = None
         else:
             self.payment_type.data = PayTypeEnum(int(value.data))
     except Exception as e:
         raise StopValidation("无效的payment_type")
예제 #2
0
    def validate_pay_type(self, value):
        try:

            if value.data not in ["1", "2"]:
                raise StopValidation("无效的交易类型")

            self.pay_type.data = PayTypeEnum(int(value.data))
        except Exception as e:
            raise StopValidation("无效的交易类型")
예제 #3
0
 def order_type(self) -> PayTypeEnum:
     return PayTypeEnum(self._order_type)
예제 #4
0
 def validate_type(self, value):
     try:
         self.type.data = PayTypeEnum(int(value.data))
     except Exception as e:
         raise StopValidation("无效的订单类型")
예제 #5
0
 def validate_pay_type(self, value):
     try:
         self.pay_type.data = PayTypeEnum(value.data)
     except Exception as e:
         raise StopValidation("无效的pay_type")
예제 #6
0
 def payment_way(self) -> PayTypeEnum:
     return PayTypeEnum(self._p_way)