From 746710e69e13073b6b906e17919220f8fb32f2d0 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Tue, 28 Apr 2026 21:55:11 +0200 Subject: [PATCH 1/2] Assume PSD2 is supported for any HITANS newer than v6 The logic was written when HITANSv6 was the newest version and also the only one that supported PSD2. Nowadays we have even newer versions and some banks support _only_ those (not anymore v6), so we need to be more lenient here. --- src/Protocol/BPD.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/Protocol/BPD.php b/src/Protocol/BPD.php index fc18f5a3..048ac3be 100644 --- a/src/Protocol/BPD.php +++ b/src/Protocol/BPD.php @@ -138,6 +138,21 @@ public function supportsParameters(string $type, int $version): bool return false; } + /** + * @param string $type A business transaction type, see above. + * @param int $minVersion The minimum segment version of the business transaction. + * @return bool If that version of the given transaction type or a newer one is supported by the bank. + */ + public function supportsParametersOrNewer(string $type, int $minVersion): bool + { + foreach ($this->parameters[$type] as $segment) { + if ($segment->getVersion() >= $version) { + return true; + } + } + return false; + } + /** * @param SegmentInterface[] $requestSegments The segments that shall be sent to the bank. * @return string|null Identifier of the (first) segment that requires a TAN according to HIPINS, or null if none of @@ -180,7 +195,7 @@ public function vopRequiredForRequest(array $requestSegments): ?string */ public function supportsPsd2(): bool { - return $this->supportsParameters('HITANS', 6); + return $this->supportsParametersOrNewer('HITANS', 6); } /** From 328416a96542736db83713a48c62f211bae42d95 Mon Sep 17 00:00:00 2001 From: Philipp Keck Date: Tue, 28 Apr 2026 21:57:02 +0200 Subject: [PATCH 2/2] Typo fix --- src/Protocol/BPD.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/BPD.php b/src/Protocol/BPD.php index 048ac3be..ec9fbd30 100644 --- a/src/Protocol/BPD.php +++ b/src/Protocol/BPD.php @@ -146,7 +146,7 @@ public function supportsParameters(string $type, int $version): bool public function supportsParametersOrNewer(string $type, int $minVersion): bool { foreach ($this->parameters[$type] as $segment) { - if ($segment->getVersion() >= $version) { + if ($segment->getVersion() >= $minVersion) { return true; } }