diff --git a/lib/Fhp/Action/SendSEPADirectDebit.php b/lib/Fhp/Action/SendSEPADirectDebit.php
index 6452c508..b4ea99cb 100644
--- a/lib/Fhp/Action/SendSEPADirectDebit.php
+++ b/lib/Fhp/Action/SendSEPADirectDebit.php
@@ -148,7 +148,16 @@ protected function createRequest(BPD $bpd, ?UPD $upd)
$supportedPainNamespaces = $hispas->getParameter()->getUnterstuetzteSepaDatenformate();
}
- if (!in_array($this->painNamespace, $supportedPainNamespaces)) {
+ // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix.
+ // GIBC_X stands for German Banking Industry Committee and a version counter.
+ $xmlSchema = $this->painNamespace;
+ $matchingSchemas = array_filter($supportedPainNamespaces, function($value) use ($xmlSchema) {
+ // For example urn:iso:std:iso:20022:tech:xsd:pain.008.001.08 from the xml matches
+ // urn:iso:std:iso:20022:tech:xsd:pain.008.001.08_GBIC_4
+ return str_starts_with($value, $xmlSchema);
+ });
+
+ if (count($matchingSchemas) === 0) {
throw new UnsupportedException("The bank does not support the XML schema $this->painNamespace, but only "
. implode(', ', $supportedPainNamespaces));
}
diff --git a/lib/Fhp/Action/SendSEPARealtimeTransfer.php b/lib/Fhp/Action/SendSEPARealtimeTransfer.php
index 1180124f..1dafb8b2 100644
--- a/lib/Fhp/Action/SendSEPARealtimeTransfer.php
+++ b/lib/Fhp/Action/SendSEPARealtimeTransfer.php
@@ -58,10 +58,25 @@ protected function createRequest(BPD $bpd, ?UPD $upd)
/** @var HIIPZSv1|HIIPZSv2 $hiipzs */
$hiipzs = $bpd->requireLatestSupportedParameters('HIIPZS');
- /** @var HISPAS $hispas */
- $hispas = $bpd->requireLatestSupportedParameters('HISPAS');
- $supportedSchemas = $hispas->getParameter()->getUnterstuetzteSepaDatenformate();
- if (!in_array($this->xmlSchema, $supportedSchemas)) {
+ $supportedSchemas = $hiipzs->parameter->unterstuetzteSEPADatenformate;
+
+ // If there are no SEPA formats available in the HIIPZS Parameters, we look to the general formats
+ if (is_null($supportedSchemas)) {
+ /** @var HISPAS $hispas */
+ $hispas = $bpd->requireLatestSupportedParameters('HISPAS');
+ $supportedSchemas = $hispas->getParameter()->getUnterstuetzteSepaDatenformate();
+ }
+
+ // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix.
+ // GIBC_X stands for German Banking Industry Committee and a version counter.
+ $xmlSchema = $this->xmlSchema;
+ $matchingSchemas = array_filter($supportedSchemas, function($value) use ($xmlSchema) {
+ // For example urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 from the xml matches
+ // urn:iso:std:iso:20022:tech:xsd:pain.001.001.09_GBIC_4
+ return str_starts_with($value, $xmlSchema);
+ });
+
+ if (count($matchingSchemas) === 0) {
throw new UnsupportedException("The bank does not support the XML schema $this->xmlSchema, but only "
. implode(', ', $supportedSchemas));
}
diff --git a/lib/Fhp/Action/SendSEPATransfer.php b/lib/Fhp/Action/SendSEPATransfer.php
index 463379d1..477bcbeb 100644
--- a/lib/Fhp/Action/SendSEPATransfer.php
+++ b/lib/Fhp/Action/SendSEPATransfer.php
@@ -52,13 +52,13 @@ protected function createRequest(BPD $bpd, ?UPD $upd)
$numberOfTransactions = $xmlAsObject->CstmrCdtTrfInitn->GrpHdr->NbOfTxs;
$hasReqdExDates = false;
foreach ($xmlAsObject->CstmrCdtTrfInitn?->PmtInf as $pmtInfo) {
- if (isset($pmtInfo->ReqdExctnDt) && $pmtInfo->ReqdExctnDt != '1999-01-01') {
+ // Checks for both, 1999-01-01 and 1999-01-01
+ if (isset($pmtInfo->ReqdExctnDt) && ($pmtInfo->ReqdExctnDt->Dt ?? $pmtInfo->ReqdExctnDt) != '1999-01-01') {
$hasReqdExDates = true;
break;
}
}
-
//NOW READ OUT, WICH SEGMENT SHOULD BE USED:
if ($numberOfTransactions > 1 && $hasReqdExDates) {
@@ -89,7 +89,17 @@ protected function createRequest(BPD $bpd, ?UPD $upd)
/** @var HISPAS $hispas */
$parameters = $bpd->requireLatestSupportedParameters('HISPAS');
$supportedSchemas = $parameters->getParameter()->getUnterstuetzteSepaDatenformate();
- if (!in_array($this->xmlSchema, $supportedSchemas)) {
+
+ // Sometimes the Bank reports supported schemas with a "_GBIC_X" postfix.
+ // GIBC_X stands for German Banking Industry Committee and a version counter.
+ $xmlSchema = $this->xmlSchema;
+ $matchingSchemas = array_filter($supportedSchemas, function($value) use ($xmlSchema) {
+ // For example urn:iso:std:iso:20022:tech:xsd:pain.001.001.09 from the xml matches
+ // urn:iso:std:iso:20022:tech:xsd:pain.001.001.09_GBIC_4
+ return str_starts_with($value, $xmlSchema);
+ });
+
+ if (count($matchingSchemas) === 0) {
throw new UnsupportedException("The bank does not support the XML schema $this->xmlSchema, but only "
. implode(', ', $supportedSchemas));
}