summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/mods/mod_girocheckout/order_done.phtml42
-rw-r--r--views/mods/mod_girocheckout/order_view_afterpayment.phtml71
-rw-r--r--views/mods/mod_girocheckout/settings_edit.phtml87
3 files changed, 200 insertions, 0 deletions
diff --git a/views/mods/mod_girocheckout/order_done.phtml b/views/mods/mod_girocheckout/order_done.phtml
new file mode 100644
index 0000000..aad5a6d
--- /dev/null
+++ b/views/mods/mod_girocheckout/order_done.phtml
@@ -0,0 +1,42 @@
+<?php
+
+ /**
+ * Nach dem Bestellabschluss mit einer Zahlart von GiroCheckout
+ */
+
+ if (!defined('ABSPATH')) exit;
+
+ $arView = $this->view['wpsg_mod_girocheckout'];
+ $bDone = (($arView['done']??'') === '1');
+ $strLink = (string)($arView['link']??'');
+ $strName = (string)($arView['name']??'');
+
+?>
+
+<?php if (!$bDone) { ?>
+
+ <p><?php echo esc_html(wpsg_translate(__('Bitte bezahlen Sie den Betrag jetzt mit #1#.', 'wpsg'), $strName)); ?></p>
+
+ <p>
+ <a class="wpsg_button" href="<?php echo esc_url($strLink); ?>"><?php echo esc_html(wpsg_translate(__('Jetzt mit #1# bezahlen', 'wpsg'), $strName)); ?></a>
+ </p>
+
+ <?php if ($this->get_option('wpsg_mod_girocheckout_autostart') == '1') { ?>
+
+ <script>
+
+ window.setTimeout(function() {
+
+ location.href = <?php echo wp_json_encode($strLink); ?>;
+
+ }, 1000);
+
+ </script>
+
+ <?php } ?>
+
+<?php } else { ?>
+
+ <p><?php echo esc_html(wpsg_translate(__('Die Zahlung mit #1# ist eingegangen.', 'wpsg'), $strName)); ?></p>
+
+<?php } ?>
diff --git a/views/mods/mod_girocheckout/order_view_afterpayment.phtml b/views/mods/mod_girocheckout/order_view_afterpayment.phtml
new file mode 100644
index 0000000..cefa4c3
--- /dev/null
+++ b/views/mods/mod_girocheckout/order_view_afterpayment.phtml
@@ -0,0 +1,71 @@
+<?php
+
+ /**
+ * GiroCheckout-Daten in der Bestellansicht
+ */
+
+ if (!defined('ABSPATH')) exit;
+
+ $arView = $this->view['wpsg_mod_girocheckout'];
+ $oOrder = $arView['oOrder'];
+ $oMod = $this->arModule['wpsg_mod_girocheckout'];
+
+ $strPaid = (string)$oOrder->getMeta(wpsg_mod_girocheckout::META_PAID);
+ $strReference = (($strPaid !== '')?$strPaid:(string)$oOrder->getMeta(wpsg_mod_girocheckout::META_REFERENCE));
+ $strResult = (string)$oOrder->getMeta(wpsg_mod_girocheckout::META_RESULT);
+ $nAmount = intval($oOrder->getMeta(wpsg_mod_girocheckout::META_AMOUNT));
+ $nRefunded = intval($oOrder->getMeta(wpsg_mod_girocheckout::META_REFUNDED));
+ $nRefundable = intval($arView['nRefundable']);
+
+ if ($strPaid !== '') {
+
+ $strState = '<span class="label label-success" style="font-size:12px;">'.esc_html($oMod->getResultLabel(4000)).'</span>';
+
+ } else if ($strResult !== '') {
+
+ $strState = '<span class="label label-warning" style="font-size:12px;">'.esc_html($oMod->getResultLabel(intval($strResult))).'</span>';
+
+ } else {
+
+ $strState = '<span class="label label-default" style="font-size:12px;">'.esc_html__('noch nicht bezahlt', 'wpsg').'</span>';
+
+ }
+
+?>
+
+<?php if ($strReference !== '') { ?>
+
+ <?php echo wpsg_drawForm_Text(__('GiroCheckout Status', 'wpsg'), $strState.' &nbsp;<a class="btn btn-default btn-xs" href="'.esc_url($arView['refreshURL']).'"><span class="glyphicon glyphicon-refresh" aria-hidden="true"></span> '.esc_html__('Status aktualisieren', 'wpsg').'</a>'); ?>
+ <?php echo wpsg_drawForm_Text(__('GiroCheckout Referenz', 'wpsg'), '<code>'.esc_html($strReference).'</code>'); ?>
+
+ <?php if ((string)$oOrder->getMeta(wpsg_mod_girocheckout::META_BACKEND_ID) !== '') { ?>
+
+ <?php echo wpsg_drawForm_Text(__('Transaktions-ID', 'wpsg'), '<code>'.esc_html($oOrder->getMeta(wpsg_mod_girocheckout::META_BACKEND_ID)).'</code>'); ?>
+
+ <?php } ?>
+
+ <?php if ($nAmount > 0) { ?>
+
+ <?php echo wpsg_drawForm_Text(__('Bezahlt', 'wpsg'), esc_html(wpsg_ff($nAmount / 100, wpsg_mod_girocheckout::CURRENCY))); ?>
+
+ <?php } ?>
+
+ <?php if ($nRefunded > 0) { ?>
+
+ <?php echo wpsg_drawForm_Text(__('Erstattet', 'wpsg'), esc_html(wpsg_ff($nRefunded / 100, wpsg_mod_girocheckout::CURRENCY))); ?>
+
+ <?php } ?>
+
+ <?php if ($nRefundable > 0) { ?>
+
+ <form method="post" action="<?php echo esc_url($arView['refundURL']); ?>" onsubmit="return confirm(<?php echo esc_attr(wp_json_encode(__('Den Betrag über GiroCheckout erstatten?', 'wpsg'))); ?>);">
+
+ <?php echo wpsg_drawForm_Input('wpsg_mod_girocheckout_refund_amount', __('Erstattungsbetrag', 'wpsg'), wpsg_ff($nRefundable / 100), ['hint' => esc_html(wpsg_translate(__('Höchstens #1#', 'wpsg'), wpsg_ff($nRefundable / 100, wpsg_mod_girocheckout::CURRENCY)))]); ?>
+
+ <p><button type="submit" class="button"><?php echo esc_html__('Betrag erstatten', 'wpsg'); ?></button></p>
+
+ </form>
+
+ <?php } ?>
+
+<?php } ?>
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(); ?>