summaryrefslogtreecommitdiff
path: root/views/mods/mod_girocheckout/settings_edit.phtml
diff options
context:
space:
mode:
Diffstat (limited to 'views/mods/mod_girocheckout/settings_edit.phtml')
-rw-r--r--views/mods/mod_girocheckout/settings_edit.phtml87
1 files changed, 87 insertions, 0 deletions
diff --git a/views/mods/mod_girocheckout/settings_edit.phtml b/views/mods/mod_girocheckout/settings_edit.phtml
new file mode 100644
index 0000000..576bba9
--- /dev/null
+++ b/views/mods/mod_girocheckout/settings_edit.phtml
@@ -0,0 +1,87 @@
+<?php
+
+ /**
+ * Einstellungen des Moduls GiroCheckout
+ */
+
+ if (!defined('ABSPATH')) exit;
+
+ $arView = $this->view['wpsg_mod_girocheckout'];
+ $arStatus = (array)($arView['arStatus']??[]);
+ $arStornoStatus = (array)$this->get_option('wpsg_mod_girocheckout_stornostate');
+ $oMod = $this->arModule['wpsg_mod_girocheckout'];
+
+ $strBadge = '<span class="label label-%s" style="font-size:12px;">%s</span>';
+
+?>
+
+<?php wpsg_drawForm_AdminboxStart(__('Zugang zu GiroCheckout', 'wpsg'), 'wpsg_mod_girocheckout_access'); ?>
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_girocheckout_merchantid', __('Händler-ID', 'wpsg'), $this->get_option('wpsg_mod_girocheckout_merchantid'), ['help' => 'wpsg_mod_girocheckout_merchantid', 'hint' => wpsg_translate(__('Händler-ID, Projekt-IDs und Projektkennwörter stehen im <a target="_blank" href="#1#">GiroCockpit</a>. Jede Zahlart ist dort ein eigenes Projekt.', 'wpsg'), 'https://www.girocockpit.de/')]); ?>
+
+<?php wpsg_drawForm_AdminboxEnd(); ?>
+
+<?php foreach ($arView['arMethods'] as $index => $arMethod) { ?>
+
+ <?php
+
+ $bCredentials = ((string)$this->get_option('wpsg_mod_girocheckout_merchantid') !== '' && (string)$this->get_option($oMod->getMethodOptionKey($index, 'projectid')) !== '' && (string)$this->get_option($oMod->getMethodOptionKey($index, 'projectpw')) !== '');
+ $arMethodStatus = ($arStatus['methods'][$index]??null);
+
+ if (!$bCredentials) {
+
+ $strConnection = sprintf($strBadge, 'default', esc_html__('Keine Zugangsdaten hinterlegt', 'wpsg'));
+
+ } else if (!is_array($arMethodStatus)) {
+
+ $strConnection = sprintf($strBadge, 'default', esc_html__('Noch nicht geprüft, bitte speichern', 'wpsg'));
+
+ } else if ($arMethodStatus['ok'] === true) {
+
+ $strConnection = sprintf($strBadge, 'success', esc_html__('Verbindung erfolgreich', 'wpsg')).' <small class="text-muted">'.esc_html(wpsg_formatTimestamp($arStatus['time'])).'</small>';
+
+ } else {
+
+ $strConnection = sprintf($strBadge, 'danger', esc_html__('Anmeldung fehlgeschlagen', 'wpsg')).'<br /><small class="text-danger">'.esc_html($arMethodStatus['message']).'</small>';
+
+ }
+
+ $strPwHint = (((string)$this->get_option($oMod->getMethodOptionKey($index, 'projectpw')) !== '')?__('Gespeichert. Zum Ändern neu eingeben, sonst leer lassen.', 'wpsg'):'');
+
+ ?>
+
+ <?php wpsg_drawForm_AdminboxStart($arMethod['name'], 'wpsg_mod_girocheckout_method_'.$index); ?>
+
+ <?php echo wpsg_drawForm_Checkbox($oMod->getMethodOptionKey($index, 'active'), __('Aktiv', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'active')), ['help' => 'wpsg_shippay_activ']); ?>
+ <?php echo wpsg_drawForm_Text(__('Verbindung', 'wpsg'), $strConnection); ?>
+ <?php echo wpsg_drawForm_Input($oMod->getMethodOptionKey($index, 'projectid'), __('Projekt-ID', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'projectid')), ['help' => 'wpsg_mod_girocheckout_projectid']); ?>
+ <?php echo wpsg_drawForm_Input($oMod->getMethodOptionKey($index, 'projectpw'), __('Projektkennwort', 'wpsg'), '', ['type' => 'password', 'help' => 'wpsg_mod_girocheckout_projectpw', 'hint' => esc_html($strPwHint)]); ?>
+ <?php echo wpsg_drawForm_Input($oMod->getMethodOptionKey($index, 'name'), __('Bezeichnung', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'name')), ['help' => 'wpsg_shippay_name']); ?>
+ <?php echo wpsg_drawForm_Textarea($oMod->getMethodOptionKey($index, 'hint'), __('Hinweistext', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'hint')), ['help' => 'wpsg_shippay_hint']); ?>
+ <?php echo wpsg_drawForm_Input($oMod->getMethodOptionKey($index, 'fee'), __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option($oMod->getMethodOptionKey($index, 'fee')), true), ['help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %']); ?>
+ <?php echo wpsg_drawForm_Select($oMod->getMethodOptionKey($index, 'tax_key'), __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option($oMod->getMethodOptionKey($index, 'tax_key')), ['help' => 'wpsg_shippay_mwst']); ?>
+
+ <?php wpsg_drawForm_AdminboxEnd(); ?>
+
+<?php } ?>
+
+<?php wpsg_drawForm_AdminboxStart(__('Zahlungsablauf', 'wpsg'), 'wpsg_mod_girocheckout_process'); ?>
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_girocheckout_subject', __('Verwendungszweck', 'wpsg'), $this->get_option('wpsg_mod_girocheckout_subject'), ['help' => 'wpsg_mod_girocheckout_subject', 'hint' => esc_html__('Höchstens 27 Zeichen, längere werden gekürzt.', 'wpsg')]); ?>
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_girocheckout_autostart', __('Zahlung sofort starten', 'wpsg'), $this->get_option('wpsg_mod_girocheckout_autostart'), ['help' => 'wpsg_shippay_paystart']); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_girocheckout_successPage', __('Erfolgsseite', 'wpsg'), $arView['arPages'], $this->get_option('wpsg_mod_girocheckout_successPage'), ['help' => 'wpsg_mod_girocheckout_successPage']); ?>
+ <?php echo wpsg_drawForm_Select('wpsg_mod_girocheckout_errorPage', __('Fehlerseite', 'wpsg'), $arView['arPages'], $this->get_option('wpsg_mod_girocheckout_errorPage'), ['help' => 'wpsg_mod_girocheckout_errorPage']); ?>
+
+<?php wpsg_drawForm_AdminboxEnd(); ?>
+
+<?php wpsg_drawForm_AdminboxStart(__('Erstattung bei Statuswechsel', 'wpsg'), 'wpsg_mod_girocheckout_storno'); ?>
+
+ <p class="text-muted"><?php echo esc_html__('Wechselt eine über GiroCheckout bezahlte Bestellung in einen der markierten Status, wird der noch nicht erstattete Betrag automatisch erstattet.', 'wpsg'); ?></p>
+
+ <?php foreach ($this->arStatus as $status_id => $status_label) { ?>
+
+ <?php echo wpsg_drawForm_Checkbox('wpsg_mod_girocheckout_stornostate['.$status_id.']', __($status_label, 'wpsg'), ($arStornoStatus[$status_id]??'0')); ?>
+
+ <?php } ?>
+
+<?php wpsg_drawForm_AdminboxEnd(); ?>