Files
mareike/app/EventPaymentModules/Modules/UndefinedPaymentModule.php
T

51 lines
1.5 KiB
PHP

<?php
namespace App\EventPaymentModules\Modules;
use App\EventPaymentModules\AbstractEventPaymentModule;
use App\EventPaymentModules\DTO\CreateInvoiceRequest;
use App\EventPaymentModules\DTO\RegistrationSummaryRequest;
use App\EventPaymentModules\DTO\RegistrationSummaryResponse;
use App\Models\PaymentMethod;
/**
* Sonstiges (Barzahlung, Zahlung vor Ort) -- die anzuzeigende Zahlungsinformation ist nutzerdefiniert
* (mehrzeiliger Freitext) und wird als Option gepflegt.
*/
class UndefinedPaymentModule extends AbstractEventPaymentModule
{
public static function slug(): string
{
return PaymentMethod::PAYMENT_NOT_DEFINED;
}
public function defaultName(): string
{
return 'Sonstiges (Barzahlung, Zahlung vor Ort)';
}
public function getOptions(): array
{
return [
['name' => 'payment_information', 'label' => 'Zahlungsinformationen', 'type' => 'richtext', 'required' => true],
];
}
public function registrationSummary(RegistrationSummaryRequest $request): RegistrationSummaryResponse
{
$html = (string)($request->configuration['payment_information'] ?? '');
$response = new RegistrationSummaryResponse();
$response->hasPaymentInformation = trim($html) !== '';
$response->html = $html;
$response->showGiroCode = false;
return $response;
}
protected function invoiceClosingStatement(CreateInvoiceRequest $request): string
{
return '';
}
}