]> git.ipfire.org Git - thirdparty/python-fints.git/commitdiff
Add pain message version 001.001.09 to simple instant payment method (#189)
authoryniverz <88168412+yniverz@users.noreply.github.com>
Thu, 27 Nov 2025 12:41:01 +0000 (13:41 +0100)
committerGitHub <noreply@github.com>
Thu, 27 Nov 2025 12:41:01 +0000 (13:41 +0100)
* 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 <michel@rami.io>
fints/client.py
pyproject.toml
requirements.txt

index 3fcb3b78780894c3b4242f96ffef47702639d6f5..25cbd65746d93d99545d66864ced71a5aa97337c 100644 (file)
@@ -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)
index 708fb6ad81246d08ca9d7cbff9807e22166634b6..3315defa2520c9378dfb7b5fbecfda26e3123d7e 100644 (file)
@@ -28,7 +28,7 @@ dependencies = [
   "bleach",
   "mt-940",
   "requests",
-  "sepaxml~=2.1",
+  "sepaxml~=2.7",
   "enum-tools~=0.12.0",
 ]
 dynamic = ["version"]
index c3c294910b72f4763408a1381162c9ff9b6e9bd6..89dc6bd4f904c4c70969a62670f820fd63d0d882 100644 (file)
@@ -1,5 +1,5 @@
 requests
 mt-940
-sepaxml==2.1.*
+sepaxml==2.7.*
 enum-tools~=0.12.0
 bleach