Handling SEPA Direct Payment

This commit is contained in:
2026-10-04 16:47:15 +02:00
parent 9e9ea0cfd5
commit d511dbdd66
25 changed files with 801 additions and 43 deletions
+35
View File
@@ -0,0 +1,35 @@
<?php
namespace Tests\Concerns;
use App\Models\AvailablePaymentMethod;
use App\Models\Event;
use App\Models\PaymentMethod;
use App\RelationModels\EventPaymentMethods;
use App\Scopes\SiteScope;
/**
* Bietet bei einer Veranstaltung die Überweisung an -- aktiv beim Mandanten und vollständig konfiguriert.
*
* Der SignUpCommand nimmt nur eine Zahlungsart an, die der Veranstaltung zugewiesen ist; ein Test, der
* eine Anmeldung durchspielt, muss sie deshalb so anlegen, wie es der Betrieb tut. Wiederholte Aufrufe
* schaden nicht. Die Zeile in `payment_methods` legt der Test selbst an.
*/
trait OffersAccountTransfer
{
protected function offerAccountTransfer(Event $event): void
{
$slug = PaymentMethod::PAYMENT_ACCOUNT_TRANSACTION;
$configuration = ['account_owner' => 'Kasse', 'iban' => 'DE02120300000000202051'];
AvailablePaymentMethod::withoutGlobalScope(SiteScope::class)->firstOrCreate(
['tenant' => $event->tenant, 'slug' => $slug],
['name' => 'Überweisung', 'active' => true, 'configuration' => $configuration],
);
EventPaymentMethods::firstOrCreate(
['event_id' => $event->id, 'slug' => $slug],
['configuration' => $configuration],
);
}
}