def METHOD_NAME(currency=None, providers=None):
    def validate(form, field):
        if form._total_amount == form.donation_amount.data:
            return
        if providers is not None and form._provider not in providers:
            return
        if currency is not None and form._currency != currency:
            return
        if not field.data:
            raise ValidationError("This field is required")
    return validate