Zahlungsparser
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?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 ?? []);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user