예제 #1
0
class UserOrderSelectForm(DomainForm):
    """
        用户订单查询:
    """
    year = IntegerField(validators=[DataRequired()], description="年")
    mouth = IntegerField(validators=[DataRequired()], description="月")
    page_index = IntegerField(default=1, description="页码")
    payment_type = IntegerField(description=PayTypeEnum.description())

    @stop_validate_if_error_occurred
    def validate_page_index(self, value):
        try:
            self.page_index.data = int(value.data)
        except:
            raise StopValidation("无效的page_index")

    @stop_validate_if_error_occurred
    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
from app.libs.error_code import ResponseSuccess
from app.enums.trade import PayMethodEnum, PaymentTypeEnum, PaymentFeeTypeEnum, SettleTypeEnum, PaymentBankEnum, \
    InterfaceTypeEnum, PayTypeEnum
from config import MerchantEnum

DescNamePair = api.model("DescNamePair", {
    "name": fields.String(),
    "desc": fields.String()
})

ChannelConfigQueryDoc = api.model('DocChannelConfigQuery', {
    "pay_type": fields.Integer(
        required=True,
        description='通道号',
        example=PayTypeEnum.description()
    ),
})

bank = fields.String(
    required=True,
    description='支持的银行',
    example=PaymentBankEnum.description()
)

payment_methods = fields.String(
    required=True,
    description='支付方法',
    example=PayMethodEnum.description()
)