Handling SEPA Direct Payment
This commit is contained in:
@@ -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],
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user