diff --git a/stubs/sepaxml/__init__.pyi b/stubs/sepaxml/__init__.pyi new file mode 100644 index 000000000..150a42131 --- /dev/null +++ b/stubs/sepaxml/__init__.pyi @@ -0,0 +1,4 @@ +from .debit import SepaDD as SepaDD +from .transfer import SepaTransfer as SepaTransfer + +version: str diff --git a/stubs/sepaxml/debit.pyi b/stubs/sepaxml/debit.pyi new file mode 100644 index 000000000..2d05255ac --- /dev/null +++ b/stubs/sepaxml/debit.pyi @@ -0,0 +1,9 @@ +from .shared import SepaPaymentInitn as SepaPaymentInitn +from .utils import ADDRESS_MAPPING as ADDRESS_MAPPING, int_to_decimal_str as int_to_decimal_str, make_id as make_id + +class SepaDD(SepaPaymentInitn): + root_el: str + def __init__(self, config, schema: str = 'pain.008.003.02', clean: bool = True) -> None: ... + def check_config(self, config): ... + def check_payment(self, payment): ... + def add_payment(self, payment) -> None: ... diff --git a/stubs/sepaxml/shared.pyi b/stubs/sepaxml/shared.pyi new file mode 100644 index 000000000..efd208c1a --- /dev/null +++ b/stubs/sepaxml/shared.pyi @@ -0,0 +1,10 @@ +from .utils import decimal_str_to_int as decimal_str_to_int, int_to_decimal_str as int_to_decimal_str, make_msg_id as make_msg_id +from .validation import try_valid_xml as try_valid_xml +from _typeshed import Incomplete + +class SepaPaymentInitn: + schema: Incomplete + msg_id: Incomplete + clean: Incomplete + def __init__(self, config, schema, clean: bool = True) -> None: ... + def export(self, validate: bool = True, pretty_print: bool = False) -> bytes: ... diff --git a/stubs/sepaxml/transfer.pyi b/stubs/sepaxml/transfer.pyi new file mode 100644 index 000000000..4db17622f --- /dev/null +++ b/stubs/sepaxml/transfer.pyi @@ -0,0 +1,9 @@ +from .shared import SepaPaymentInitn as SepaPaymentInitn +from .utils import ADDRESS_MAPPING as ADDRESS_MAPPING, int_to_decimal_str as int_to_decimal_str, make_id as make_id + +class SepaTransfer(SepaPaymentInitn): + root_el: str + def __init__(self, config, schema: str = 'pain.001.001.03', clean: bool = True) -> None: ... + def check_config(self, config): ... + def check_payment(self, payment): ... + def add_payment(self, payment) -> None: ... diff --git a/stubs/sepaxml/utils.pyi b/stubs/sepaxml/utils.pyi new file mode 100644 index 000000000..7fc6509a0 --- /dev/null +++ b/stubs/sepaxml/utils.pyi @@ -0,0 +1,11 @@ +from _typeshed import Incomplete + +using_sysrandom: bool + +def get_rand_string(length: int = 12, allowed_chars: str = '0123456789abcdef'): ... +def make_msg_id(): ... +def make_id(name): ... +def int_to_decimal_str(integer): ... +def decimal_str_to_int(decimal_string): ... + +ADDRESS_MAPPING: Incomplete diff --git a/stubs/sepaxml/validation.pyi b/stubs/sepaxml/validation.pyi new file mode 100644 index 000000000..c2ab88973 --- /dev/null +++ b/stubs/sepaxml/validation.pyi @@ -0,0 +1,3 @@ +class ValidationError(Exception): ... + +def try_valid_xml(xmlout, schema) -> None: ...