Handling SEPA Direct Payment
This commit is contained in:
@@ -23,6 +23,7 @@ class PaymentMethod extends CommonModel
|
||||
|
||||
public const string PAYMENT_ACCOUNT_TRANSACTION = 'PAYMENT_ACCOUNT_TRANSACTION';
|
||||
public const string PAYMENT_NOT_DEFINED = 'PAYMENT_NOT_DEFINED';
|
||||
public const string PAYMENT_SEPA_DIRECT_DEBIT = 'PAYMENT_SEPA_DIRECT_DEBIT';
|
||||
|
||||
protected $fillable = [
|
||||
'slug',
|
||||
@@ -105,7 +106,7 @@ class PaymentMethod extends CommonModel
|
||||
}
|
||||
|
||||
/**
|
||||
* Prüft, ob alle Pflicht-Optionen eines Slugs in der Konfiguration befüllt (non-empty) sind.
|
||||
* Prüft, ob alle Pflicht-Optionen eines Slugs befüllt (non-empty) und alle Werte gültig sind.
|
||||
* Unbekannte Slugs (kein Modul) gelten als vollständig -- kein Modul, keine Pflichtfelder.
|
||||
*
|
||||
* @param array<string, mixed> $config
|
||||
@@ -114,4 +115,15 @@ class PaymentMethod extends CommonModel
|
||||
{
|
||||
return EventPaymentModuleRegistry::forSlug($slug)?->isConfigurationComplete($config) ?? true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Ungültige Werte einer Konfiguration (Optionsname => Meldung), etwa eine falsche Prüfziffer.
|
||||
*
|
||||
* @param array<string, mixed> $config
|
||||
* @return array<string, string>
|
||||
*/
|
||||
public static function configurationErrors(string $slug, array $config): array
|
||||
{
|
||||
return EventPaymentModuleRegistry::forSlug($slug)?->configurationErrors($config) ?? [];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user