Automatischer Zahlungsparser
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\EventPaymentModules\DTO;
|
||||
|
||||
use App\Models\EventParticipant;
|
||||
|
||||
/**
|
||||
* Eingabe für {@see \App\EventPaymentModules\EventPaymentModule::getRefundData()}.
|
||||
*
|
||||
* Wie überall in dieser Schicht wird die Konfiguration hereingereicht, statt sie selbst zu holen --
|
||||
* die Module bleiben damit frei von Datenbankzugriffen und ohne DB testbar.
|
||||
*/
|
||||
final class GetRefundDataRequest
|
||||
{
|
||||
/**
|
||||
* @param array<string, mixed> $configuration aufgelöste Konfiguration des Zahlungsmoduls
|
||||
*/
|
||||
public function __construct(
|
||||
public readonly EventParticipant $participant,
|
||||
public readonly array $configuration = [],
|
||||
) {
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace App\EventPaymentModules\DTO;
|
||||
|
||||
use App\Enumerations\RefundAccountSource;
|
||||
|
||||
/**
|
||||
* Auf welches Konto ist zu erstatten -- und woher kommt es?
|
||||
*
|
||||
* `source` ist die eigentliche Auskunft: Kennen wir das Konto bereits (`Known`), gab es eines, das wir
|
||||
* erfragen müssen (`Origin`), oder gab es nie eines (`None`, Barzahlung)? Davon hängt ab, was die
|
||||
* Erstattungsseite fragt und welche Erklärung der Teili unterschreibt.
|
||||
*
|
||||
* Konto und Inhaber sind nur bei `Known` gefüllt -- und dann auch nur, wenn beide vorliegen und die
|
||||
* IBAN die Prüfziffer besteht. Eine ungültige IBAN würde ungeprüft übernommen und das Geld ginge im
|
||||
* Zweifel an eine fremde Person; lieber wie bisher nachfragen.
|
||||
*/
|
||||
final class GetRefundDataResponse
|
||||
{
|
||||
public RefundAccountSource $source = RefundAccountSource::Origin;
|
||||
|
||||
public ?string $accountOwner = null;
|
||||
public ?string $accountIban = null;
|
||||
|
||||
/** Woher die Angaben stammen -- Klartext für die Anzeige in der Aktionsleitung. */
|
||||
public ?string $sourceNote = null;
|
||||
|
||||
/** Kurzform für „das Konto steht fest": nur dann sind accountOwner/accountIban gefüllt. */
|
||||
public function hasAccount(): bool
|
||||
{
|
||||
return $this->source === RefundAccountSource::Known;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user