- Add multi-invoice payment support (link one bank transaction to multiple invoices) - Add payment unlinking feature to correct wrong matches - Show linked payments, invoices and bank entries in transaction detail view - Allow linking already paid invoices to bank transactions - Update README with new features - Add CHANGELOG.md Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
52 lines
1.4 KiB
PHP
Executable file
52 lines
1.4 KiB
PHP
Executable file
<?php
|
|
|
|
namespace Fhp\Protocol;
|
|
|
|
use Fhp\BaseAction;
|
|
use Fhp\Segment\TAB\HITAB;
|
|
use Fhp\Segment\TAB\HKTABv4;
|
|
use Fhp\Segment\TAB\HKTABv5;
|
|
use Fhp\Segment\TAB\TanMediumListe;
|
|
use Fhp\UnsupportedException;
|
|
|
|
/**
|
|
* Fetches the TAN media (e.g. different mobile phones or iTAN lists) that are available to the user (HTKAB).
|
|
*/
|
|
class GetTanMedia extends BaseAction
|
|
{
|
|
/** @var TanMediumListe[]|null */
|
|
private $tanMedia;
|
|
|
|
/** {@inheritdoc} */
|
|
protected function createRequest(BPD $bpd, ?UPD $upd)
|
|
{
|
|
// Prepare the HKTAB request.
|
|
$hitabs = $bpd->requireLatestSupportedParameters('HITABS');
|
|
switch ($hitabs->getVersion()) {
|
|
case 4:
|
|
return HKTABv4::createEmpty();
|
|
case 5:
|
|
return HKTABv5::createEmpty();
|
|
default:
|
|
throw new UnsupportedException('Unsupported HKTAB version: ' . $hitabs->getVersion());
|
|
}
|
|
}
|
|
|
|
/** {@inheritdoc} */
|
|
public function processResponse(Message $response)
|
|
{
|
|
parent::processResponse($response);
|
|
/** @var HITAB $hitab */
|
|
$hitab = $response->requireSegment(HITAB::class);
|
|
$this->tanMedia = $hitab->getTanMediumListe() === null ? [] : $hitab->getTanMediumListe();
|
|
}
|
|
|
|
/**
|
|
* @return TanMediumListe[]|null
|
|
*/
|
|
public function getTanMedia(): ?array
|
|
{
|
|
$this->ensureDone();
|
|
return $this->tanMedia;
|
|
}
|
|
}
|