Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 16 additions & 1 deletion src/Protocol/BPD.php
Original file line number Diff line number Diff line change
Expand Up @@ -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() >= $minVersion) {
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
Expand Down Expand Up @@ -180,7 +195,7 @@ public function vopRequiredForRequest(array $requestSegments): ?string
*/
public function supportsPsd2(): bool
{
return $this->supportsParameters('HITANS', 6);
return $this->supportsParametersOrNewer('HITANS', 6);
}

/**
Expand Down
Loading