From bb89d9157876894220f4d7f7fde6f61f2c5a1b8b Mon Sep 17 00:00:00 2001 From: yniverz <88168412+yniverz@users.noreply.github.com> Date: Thu, 27 Nov 2025 13:41:01 +0100 Subject: [PATCH] Add pain message version 001.001.09 to simple instant payment method (#189) * add support for new pain message version 001.001.09 to simple instant payment method (requires merge #59 in sepaxml repo) * Make dest. bic optional in simple sepa transfer * Update sepaxml * remove pain.001.003 * Fix sepaxml version for tests --------- Co-authored-by: Raphael Michel --- fints/client.py | 12 +++++++++--- pyproject.toml | 2 +- requirements.txt | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/fints/client.py b/fints/client.py index 3fcb3b7..25cbd65 100644 --- a/fints/client.py +++ b/fints/client.py @@ -811,7 +811,7 @@ class FinTS3Client: :param account: SEPAAccount to start the transfer from. :param iban: Recipient's IBAN - :param bic: Recipient's BIC + :param bic: Recipient's BIC (Can be None if domestic) :param recipient_name: Recipient name :param amount: Amount as a ``Decimal`` :param account_name: Sender account name @@ -827,17 +827,23 @@ class FinTS3Client: "batch": False, "currency": "EUR", } - version = self._find_supported_sepa_version(['pain.001.001.03', 'pain.001.003.03']) + + version = self._find_supported_sepa_version([ + 'pain.001.001.09', + 'pain.001.001.03' + ]) + sepa = SepaTransfer(config, version) payment = { "name": recipient_name, "IBAN": iban, - "BIC": bic, "amount": round(Decimal(amount) * 100), # in cents "execution_date": datetime.date(1999, 1, 1), "description": reason, "endtoend_id": endtoend_id, } + if bic: + payment["BIC"] = bic sepa.add_payment(payment) xml = sepa.export().decode() return self.sepa_transfer(account, xml, pain_descriptor="urn:iso:std:iso:20022:tech:xsd:"+version, instant_payment=instant_payment) diff --git a/pyproject.toml b/pyproject.toml index 708fb6a..3315def 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,7 +28,7 @@ dependencies = [ "bleach", "mt-940", "requests", - "sepaxml~=2.1", + "sepaxml~=2.7", "enum-tools~=0.12.0", ] dynamic = ["version"] diff --git a/requirements.txt b/requirements.txt index c3c2949..89dc6bd 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ requests mt-940 -sepaxml==2.1.* +sepaxml==2.7.* enum-tools~=0.12.0 bleach -- 2.47.3