From 6dee1fb5b8ebf57f68d8549f15022f6b540dd366 Mon Sep 17 00:00:00 2001 From: Roger Rehnelt Date: Thu, 1 Oct 2026 10:00:34 +0200 Subject: Neues Modul GiroCheckout (API v2) mit Wero Zahlung, Teil- und automatische Erstattung, Statusabfrage. Co-Authored-By: Claude Opus 5.5 --- views/mods/mod_girocheckout/order_done.phtml | 42 +++++++++++ .../mod_girocheckout/order_view_afterpayment.phtml | 71 ++++++++++++++++++ views/mods/mod_girocheckout/settings_edit.phtml | 87 ++++++++++++++++++++++ 3 files changed, 200 insertions(+) create mode 100644 views/mods/mod_girocheckout/order_done.phtml create mode 100644 views/mods/mod_girocheckout/order_view_afterpayment.phtml create mode 100644 views/mods/mod_girocheckout/settings_edit.phtml 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 @@ +view['wpsg_mod_girocheckout']; + $bDone = (($arView['done']??'') === '1'); + $strLink = (string)($arView['link']??''); + $strName = (string)($arView['name']??''); + +?> + + + +

+ +

+ +

+ + get_option('wpsg_mod_girocheckout_autostart') == '1') { ?> + + + + + + + +

+ + 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 @@ +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 = ''.esc_html($oMod->getResultLabel(4000)).''; + + } else if ($strResult !== '') { + + $strState = ''.esc_html($oMod->getResultLabel(intval($strResult))).''; + + } else { + + $strState = ''.esc_html__('noch nicht bezahlt', 'wpsg').''; + + } + +?> + + + + '.esc_html__('Status aktualisieren', 'wpsg').''); ?> + '.esc_html($strReference).''); ?> + + getMeta(wpsg_mod_girocheckout::META_BACKEND_ID) !== '') { ?> + + '.esc_html($oOrder->getMeta(wpsg_mod_girocheckout::META_BACKEND_ID)).''); ?> + + + + 0) { ?> + + + + + + 0) { ?> + + + + + + 0) { ?> + +
+ + esc_html(wpsg_translate(__('Höchstens #1#', 'wpsg'), wpsg_ff($nRefundable / 100, wpsg_mod_girocheckout::CURRENCY)))]); ?> + +

+ +
+ + + + 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 @@ +view['wpsg_mod_girocheckout']; + $arStatus = (array)($arView['arStatus']??[]); + $arStornoStatus = (array)$this->get_option('wpsg_mod_girocheckout_stornostate'); + $oMod = $this->arModule['wpsg_mod_girocheckout']; + + $strBadge = '%s'; + +?> + + + + get_option('wpsg_mod_girocheckout_merchantid'), ['help' => 'wpsg_mod_girocheckout_merchantid', 'hint' => wpsg_translate(__('Händler-ID, Projekt-IDs und Projektkennwörter stehen im GiroCockpit. Jede Zahlart ist dort ein eigenes Projekt.', 'wpsg'), 'https://www.girocockpit.de/')]); ?> + + + + $arMethod) { ?> + + 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')).' '.esc_html(wpsg_formatTimestamp($arStatus['time'])).''; + + } else { + + $strConnection = sprintf($strBadge, 'danger', esc_html__('Anmeldung fehlgeschlagen', 'wpsg')).'
'.esc_html($arMethodStatus['message']).''; + + } + + $strPwHint = (((string)$this->get_option($oMod->getMethodOptionKey($index, 'projectpw')) !== '')?__('Gespeichert. Zum Ändern neu eingeben, sonst leer lassen.', 'wpsg'):''); + + ?> + + + + getMethodOptionKey($index, 'active'), __('Aktiv', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'active')), ['help' => 'wpsg_shippay_activ']); ?> + + getMethodOptionKey($index, 'projectid'), __('Projekt-ID', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'projectid')), ['help' => 'wpsg_mod_girocheckout_projectid']); ?> + getMethodOptionKey($index, 'projectpw'), __('Projektkennwort', 'wpsg'), '', ['type' => 'password', 'help' => 'wpsg_mod_girocheckout_projectpw', 'hint' => esc_html($strPwHint)]); ?> + getMethodOptionKey($index, 'name'), __('Bezeichnung', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'name')), ['help' => 'wpsg_shippay_name']); ?> + getMethodOptionKey($index, 'hint'), __('Hinweistext', 'wpsg'), $this->get_option($oMod->getMethodOptionKey($index, 'hint')), ['help' => 'wpsg_shippay_hint']); ?> + 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').' / %']); ?> + getMethodOptionKey($index, 'tax_key'), __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option($oMod->getMethodOptionKey($index, 'tax_key')), ['help' => 'wpsg_shippay_mwst']); ?> + + + + + + + + get_option('wpsg_mod_girocheckout_subject'), ['help' => 'wpsg_mod_girocheckout_subject', 'hint' => esc_html__('Höchstens 27 Zeichen, längere werden gekürzt.', 'wpsg')]); ?> + get_option('wpsg_mod_girocheckout_autostart'), ['help' => 'wpsg_shippay_paystart']); ?> + get_option('wpsg_mod_girocheckout_successPage'), ['help' => 'wpsg_mod_girocheckout_successPage']); ?> + get_option('wpsg_mod_girocheckout_errorPage'), ['help' => 'wpsg_mod_girocheckout_errorPage']); ?> + + + + + +

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