From be200df7d3e9b0fb65043627b35037eaf0046e6b Mon Sep 17 00:00:00 2001 From: daniel Date: Fri, 25 Sep 2026 11:48:39 +0200 Subject: - Module überarbeitet (PayPal, Gewicht) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- views/mods/mod_paypal/settings_edit.phtml | 194 +++++++++++++++++++----------- 1 file changed, 124 insertions(+), 70 deletions(-) (limited to 'views/mods/mod_paypal/settings_edit.phtml') diff --git a/views/mods/mod_paypal/settings_edit.phtml b/views/mods/mod_paypal/settings_edit.phtml index a366dff..daedb77 100644 --- a/views/mods/mod_paypal/settings_edit.phtml +++ b/views/mods/mod_paypal/settings_edit.phtml @@ -1,77 +1,131 @@ -view['wpsg_mod_paypal']; + $arStatus = (array)($arView['arStatus']??[]); + $bSandbox = (bool)$arView['bSandbox']; + + $arStornoStatus = (array)$this->get_option('wpsg_mod_paypal_stornostate'); + $strDeveloperURL = 'https://developer.paypal.com/dashboard/applications/'.(($bSandbox)?'sandbox':'live'); + + // Das gespeicherte Prüfergebnis gilt nur für den aktuell eingestellten Modus + $bChecked = (isset($arStatus['time']) && (bool)($arStatus['sandbox']??false) === $bSandbox); + + $strBadge = '%s'; + + if ($bSandbox) { + + $strMode = sprintf($strBadge, 'warning', esc_html__('Sandbox (Testbetrieb)', 'wpsg')); + + } else { + + $strMode = sprintf($strBadge, 'success', esc_html__('Live', 'wpsg')); + + } + + if (!$arView['bCredentials']) { + + $strConnection = sprintf($strBadge, 'default', esc_html__('Keine Zugangsdaten hinterlegt', 'wpsg')); + + } else if (!$bChecked) { + + $strConnection = sprintf($strBadge, 'default', esc_html__('Noch nicht geprüft, bitte speichern', 'wpsg')); + + } else if ($arStatus['connected'] === true) { + + $strConnection = sprintf($strBadge, 'success', esc_html__('Verbindung erfolgreich', 'wpsg')); + + } else { + + $strConnection = sprintf($strBadge, 'danger', esc_html__('Anmeldung fehlgeschlagen', 'wpsg')); + + if ((string)($arStatus['message']??'') !== '') $strConnection .= '
'.esc_html($arStatus['message']).''; + + } + + if ($bChecked && $arStatus['connected'] === true) { + + $strWebHook = sprintf($strBadge, (($arStatus['webhook'] === true)?'success':'warning'), (($arStatus['webhook'] === true)?esc_html__('Angemeldet', 'wpsg'):esc_html__('Nicht angemeldet', 'wpsg'))); + + } else { + + $strWebHook = sprintf($strBadge, 'default', esc_html__('Unbekannt', 'wpsg')); + + } + ?> -get_option('wpsg_mod_paypal_bezeichnung'), array('help' => 'wpsg_shippay_name')); ?> -get_option('wpsg_mod_paypal_aktiv'), array('help' => 'wpsg_shippay_activ')); ?> -get_option('wpsg_mod_paypal_hint'), array('help' => 'wpsg_shippay_hint')); ?> - -
- -get_option('wpsg_mod_paypal_clientid'), array('hint' => wpsg_translate(__('Erhalten Sie im PayPal Developer Interface.', 'wpsg'), 'https://developer.paypal.com/'), 'help' => 'wpsg_mod_paypal_clientid')); ?> -get_option('wpsg_mod_paypal_secret'), array('hint' => wpsg_translate(__('Erhalten Sie im PayPal Developer Interface.', 'wpsg'), 'https://developer.paypal.com/'), 'help' => 'wpsg_mod_paypal_secret')); ?> - -
-
- -
-
- -
-
-
- - -getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypal', 'webHook', array(), true), array('readonly' => true, 'help' => 'wpsg_mod_paypal_webhook_url')); ?> - true, 'noDoubleDot' => true, 'help' => 'wpsg_mod_paypal_createwebhook')); ?> - - - -
- -get_option('wpsg_mod_paypal_sandbox'), array('help' => 'wpsg_mod_paypal_sandbox')); ?> -get_option('wpsg_mod_paypal_subject'), array('help' => 'wpsg_mod_paypal_subject')); ?> -get_option('wpsg_mod_paypal_invoicenumber'), array('help' => 'wpsg_mod_paypal_invoicenumber')); ?> - -
- -get_option('wpsg_mod_paypal_gebuehr'), true), array('help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %')); ?> -get_option('wpsg_mod_paypal_mwst'), array('help' => 'wpsg_shippay_mwst')); ?> -get_option('wpsg_mod_paypal_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?> - -
- -get_option('wpsg_mod_paypal_currency'), array('help' => 'wpsg_mod_paypal_currency')); ?> - __('Deutsch', 'wpsg'), 'US' => __('Englisch', 'wpsg'), 'FR' => __('Französisch', 'wpsg')), $this->get_option('wpsg_mod_paypal_language'), array('help' => 'wpsg_mod_paypal_language')); ?> -get_option('wpsg_mod_paypal_autostart'), array('help' => 'wpsg_shippay_paystart')); ?> -view['pages'], $this->get_option('wpsg_page_mod_paypal_success'), array('help' => 'wpsg_page_mod_paypal_success')); ?> -view['pages'], $this->get_option('wpsg_page_mod_paypal_error'), array('help' => 'wpsg_page_mod_paypal_error')); ?> + + + + + + + + + + + + + + +
+ + + + + + + + get_option('wpsg_mod_paypal_bezeichnung'), ['help' => 'wpsg_shippay_name']); ?> + get_option('wpsg_mod_paypal_aktiv'), ['help' => 'wpsg_shippay_activ']); ?> + get_option('wpsg_mod_paypal_hint'), ['help' => 'wpsg_shippay_hint']); ?> + get_option('wpsg_mod_paypal_gebuehr'), true), ['help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %']); ?> + get_option('wpsg_mod_paypal_mwst'), ['help' => 'wpsg_shippay_mwst']); ?> + get_option('wpsg_mod_paypal_mwstland'), ['help' => 'wpsg_shippay_mwstland']); ?> + + + + + + get_option('wpsg_mod_paypal_sandbox'), ['help' => 'wpsg_mod_paypal_sandbox', 'hint' => esc_html__('Im Sandbox Modus werden keine echten Zahlungen ausgeführt. Sandbox und Live haben eigene Zugangsdaten.', 'wpsg')]); ?> + get_option('wpsg_mod_paypal_clientid'), ['help' => 'wpsg_mod_paypal_clientid']); ?> + get_option('wpsg_mod_paypal_secret'), ['help' => 'wpsg_mod_paypal_secret', 'hint' => wpsg_translate(__('Client ID und Secret erhalten Sie im PayPal Developer Dashboard unter "Apps & Credentials".', 'wpsg'), esc_url($strDeveloperURL))]); ?> + + + + + + true, 'help' => 'wpsg_mod_paypal_webhook_url', 'hint' => esc_html__('Über den WebHook meldet PayPal den Zahlungseingang an den Shop. Die URL muss per HTTPS von außen erreichbar sein.', 'wpsg')]); ?> + 'wpsg_mod_paypal_createwebhook']); ?> + + + + + + get_option('wpsg_mod_paypal_subject'), ['help' => 'wpsg_mod_paypal_subject']); ?> + get_option('wpsg_mod_paypal_invoicenumber'), ['help' => 'wpsg_mod_paypal_invoicenumber']); ?> + get_option('wpsg_mod_paypal_currency'), ['help' => 'wpsg_mod_paypal_currency']); ?> + __('Deutsch', 'wpsg'), 'US' => __('Englisch', 'wpsg'), 'FR' => __('Französisch', 'wpsg')], $this->get_option('wpsg_mod_paypal_language'), ['help' => 'wpsg_mod_paypal_language']); ?> + get_option('wpsg_mod_paypal_autostart'), ['help' => 'wpsg_shippay_paystart']); ?> + view['pages'], $this->get_option('wpsg_page_mod_paypal_success'), ['help' => 'wpsg_page_mod_paypal_success']); ?> + view['pages'], $this->get_option('wpsg_page_mod_paypal_error'), ['help' => 'wpsg_page_mod_paypal_error']); ?> + + + + + +

+ + arStatus as $status_id => $status_label) { ?> + + + + + + -- cgit v1.2.3