Handling SEPA Direct Payment
This commit is contained in:
+7
-2
@@ -20,10 +20,15 @@ class UpdateAvailablePaymentMethodAction
|
||||
// Nur bekannte Options-Keys übernehmen -- das Options-Schema des Zahlungsmoduls ist die Autorität.
|
||||
$configuration = PaymentMethod::sanitizeConfiguration($paymentMethod->slug, $this->request->configuration);
|
||||
|
||||
// Guard: Aktivierung nur erlaubt, wenn alle Pflicht-Optionen befüllt sind.
|
||||
// Guard: Aktivierung nur erlaubt, wenn alle Pflicht-Optionen befüllt und gültig sind. Inaktiv
|
||||
// gespeichert werden darf auch eine unfertige Konfiguration -- als Entwurf.
|
||||
if ($this->request->active && !PaymentMethod::isConfigurationComplete($paymentMethod->slug, $configuration)) {
|
||||
$errors = PaymentMethod::configurationErrors($paymentMethod->slug, $configuration);
|
||||
|
||||
$response->success = false;
|
||||
$response->message = 'Bitte zuerst alle Pflichtfelder ausfüllen, bevor die Zahlungsmethode aktiviert wird.';
|
||||
$response->message = $errors !== []
|
||||
? implode(' ', $errors) . ' Die Zahlungsmethode kann so nicht aktiviert werden.'
|
||||
: 'Bitte zuerst alle Pflichtfelder ausfüllen, bevor die Zahlungsmethode aktiviert wird.';
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user