Configurations for payment modules

This commit is contained in:
2026-07-29 12:37:48 +02:00
parent ab3d526217
commit 29db141b84
19 changed files with 436 additions and 19 deletions
+11
View File
@@ -13,6 +13,7 @@ use Illuminate\Database\Eloquent\Relations\BelongsToMany;
* @property string $name
* @property ?string $description
* @property bool $active
* @property ?array $configuration
*/
class AvailablePaymentMethod extends InstancedModel
{
@@ -24,10 +25,12 @@ class AvailablePaymentMethod extends InstancedModel
'name',
'description',
'active',
'configuration',
];
protected $casts = [
'active' => 'boolean',
'configuration' => 'array',
];
public function paymentMethod(): BelongsTo
@@ -35,6 +38,14 @@ class AvailablePaymentMethod extends InstancedModel
return $this->belongsTo(PaymentMethod::class, 'slug', 'slug');
}
/**
* Sind alle Pflicht-Optionen dieses Moduls (siehe PaymentMethod::OPTIONS) befüllt?
*/
public function isComplete(): bool
{
return PaymentMethod::isConfigurationComplete($this->slug, $this->configuration ?? []);
}
public function events(): BelongsToMany
{
// Pivot verknüpft über den Slug -- Event::paymentMethods() greift daher automatisch nur