28 lines
821 B
PHP
28 lines
821 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Repositories;
|
|
|
|
use App\Models\AvailablePaymentMethod;
|
|
|
|
/**
|
|
* Zugriff auf die Zahlungsmethoden-Instanzen des Mandanten.
|
|
*
|
|
* Existiert, damit die Zahlungsmodule DB-frei bleiben können: Sie bekommen ihre Konfiguration als
|
|
* Array hereingereicht ({@see \App\EventPaymentModules\ProvidesStatementRuleset}) und holen sie sich
|
|
* nicht selbst -- sonst bräuchte jeder Modul-Unit-Test eine Datenbank.
|
|
*/
|
|
class PaymentMethodRepository
|
|
{
|
|
/**
|
|
* Konfiguration einer Zahlungsart beim aktuellen Mandanten. Der Tenant-Filter kommt vom SiteScope.
|
|
*
|
|
* @return array<string, mixed>
|
|
*/
|
|
public function tenantConfiguration(string $slug): array
|
|
{
|
|
return (array) (AvailablePaymentMethod::where('slug', $slug)->first()?->configuration ?? []);
|
|
}
|
|
}
|