summaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/mods/mod_mollie/order_done.phtml14
-rw-r--r--views/mods/mod_mollie/order_view_afterpayment.phtml73
-rw-r--r--views/mods/mod_mollie/settings_edit.phtml8
3 files changed, 95 insertions, 0 deletions
diff --git a/views/mods/mod_mollie/order_done.phtml b/views/mods/mod_mollie/order_done.phtml
index 3e27bf2..5f5a46f 100644
--- a/views/mods/mod_mollie/order_done.phtml
+++ b/views/mods/mod_mollie/order_done.phtml
@@ -13,6 +13,14 @@
<p><?php echo esc_html__('Ihre Zahlung ist bei uns eingegangen. Vielen Dank!', 'wpsg'); ?></p>
+ <?php } else if ($mollie['state'] === 'AUTHORIZED') { ?>
+
+ <p><?php echo esc_html__('Ihre Zahlung wurde erfolgreich autorisiert. Vielen Dank!', 'wpsg'); ?></p>
+
+ <?php } else if ($mollie['state'] === 'RECURRING') { ?>
+
+ <p><?php echo esc_html__('Der Betrag wird automatisch über Mollie eingezogen. Sobald die Zahlung bestätigt ist, erhalten Sie eine E-Mail.', 'wpsg'); ?></p>
+
<?php } else if ($mollie['state'] === 'PENDING') { ?>
<p><?php echo esc_html__('Ihre Zahlung wird noch verarbeitet. Sobald die Bestätigung bei uns eingeht, erhalten Sie eine E-Mail.', 'wpsg'); ?></p>
@@ -21,6 +29,12 @@
<p><?php echo wpsg_translate(esc_html__('Sie bezahlen Ihre Bestellung mit der Nummer #1# in Höhe von #2#.', 'wpsg'), esc_html($this->view['order']['onr']), wpsg_ff($mollie['amount'], $this->get_option('wpsg_currency'))); ?></p>
+ <p class="wpsg_mod_mollie_logo">
+ <a title="<?php echo esc_attr(wpsg_translate(__('Mit #1# bezahlen', 'wpsg'), $mollie['name'])); ?>" href="<?php echo esc_url($mollie['checkout_url']); ?>">
+ <img src="<?php echo esc_url($mollie['logo']); ?>" alt="<?php echo esc_attr($mollie['name']); ?>" style="height:32px; width:auto;" />
+ </a>
+ </p>
+
<p><a class="wpsg_button wpsg_mod_mollie_button" href="<?php echo esc_url($mollie['checkout_url']); ?>"><?php echo esc_html__('Jetzt bezahlen', 'wpsg'); ?></a></p>
<p><?php echo esc_html__('Sie werden in wenigen Sekunden automatisch zur Bezahlseite weitergeleitet.', 'wpsg'); ?></p>
diff --git a/views/mods/mod_mollie/order_view_afterpayment.phtml b/views/mods/mod_mollie/order_view_afterpayment.phtml
index 71177ab..e6d4079 100644
--- a/views/mods/mod_mollie/order_view_afterpayment.phtml
+++ b/views/mods/mod_mollie/order_view_afterpayment.phtml
@@ -5,10 +5,24 @@
*/
$oOrder = $this->view['wpsg_mod_mollie']['oOrder'];
+ $order_id = intval($oOrder->getId());
$payment_id = $oOrder->getMeta('wpsg_mod_mollie_payment_id', false, '');
$payment_status = $oOrder->getMeta('wpsg_mod_mollie_status', false, '');
$payment_method = $oOrder->getMeta('wpsg_mod_mollie_method', false, '');
+ $payment_sequence = $oOrder->getMeta('wpsg_mod_mollie_sequence', false, '');
+ $mandate_id = $oOrder->getMeta('wpsg_mod_mollie_mandate_id', false, '');
+ $capture_before = $oOrder->getMeta('wpsg_mod_mollie_capture_before', false, '');
+ $amount_captured = $oOrder->getMeta('wpsg_mod_mollie_amount_captured', false, '');
+ $amount_refunded = $oOrder->getMeta('wpsg_mod_mollie_amount_refunded', false, '');
+ $amount_remaining = $oOrder->getMeta('wpsg_mod_mollie_amount_remaining', false, '');
+
+ $currency = $this->get_option('wpsg_currency');
+
+ $bAuthorized = ($payment_status === 'authorized');
+ $bRefundable = ($payment_status === 'paid' && doubleval($amount_remaining) > 0);
+
+ $mod = $this->arModule['wpsg_mod_mollie'];
?>
<br />
@@ -24,3 +38,62 @@
<?php if (wpsg_isSizedString($payment_method)) { ?>
<?php echo wpsg_drawForm_Input('', __('Bei Mollie genutzte Methode', 'wpsg'), $payment_method, ['readonly' => true]); ?>
<?php } ?>
+
+<?php if ($payment_sequence === 'first' || $payment_sequence === 'recurring') { ?>
+<?php echo wpsg_drawForm_Input('', __('Mollie Mandat', 'wpsg'), ((wpsg_isSizedString($mandate_id))?$mandate_id:__('noch nicht angelegt', 'wpsg')), ['readonly' => true, 'hint' => (($payment_sequence === 'first')?__('Erste Zahlung eines Abos, Verlängerungen werden über das Mandat eingezogen.', 'wpsg'):__('Folgezahlung eines Abos über das Mandat.', 'wpsg'))]); ?>
+<?php } ?>
+
+<?php if ($bAuthorized && wpsg_isSizedString($capture_before)) { ?>
+<?php echo wpsg_drawForm_Input('', __('Einzug möglich bis', 'wpsg'), wpsg_date('d.m.Y H:i', strtotime($capture_before)), ['readonly' => true]); ?>
+<?php } ?>
+
+<?php if (doubleval($amount_captured) > 0) { ?>
+<?php echo wpsg_drawForm_Input('', __('Eingezogen', 'wpsg'), wpsg_ff($amount_captured, $currency), ['readonly' => true]); ?>
+<?php } ?>
+
+<?php if (doubleval($amount_refunded) > 0) { ?>
+<?php echo wpsg_drawForm_Input('', __('Erstattet', 'wpsg'), wpsg_ff($amount_refunded, $currency), ['readonly' => true]); ?>
+<?php } ?>
+
+<?php if (wpsg_isSizedString($payment_id)) { ?>
+
+<br />
+
+<p>
+
+ <a class="button" href="<?php echo esc_url($mod->getOrderAjaxURL($order_id, 'refresh')); ?>"><?php echo esc_html__('Status aktualisieren', 'wpsg'); ?></a>
+
+ <?php if ($bAuthorized) { ?>
+ <a class="button button-primary" onclick="return confirm('<?php echo esc_js(__('Den autorisierten Betrag jetzt einziehen?', 'wpsg')); ?>');" href="<?php echo esc_url($mod->getOrderAjaxURL($order_id, 'capture')); ?>"><?php echo esc_html__('Zahlung einziehen', 'wpsg'); ?></a>
+ <a class="button" onclick="return confirm('<?php echo esc_js(__('Die Reservierung freigeben? Der Betrag kann danach nicht mehr eingezogen werden.', 'wpsg')); ?>');" href="<?php echo esc_url($mod->getOrderAjaxURL($order_id, 'cancel')); ?>"><?php echo esc_html__('Autorisierung freigeben', 'wpsg'); ?></a>
+ <?php } ?>
+
+</p>
+
+<?php } ?>
+
+<?php if ($bRefundable) { ?>
+
+<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_refund_amount', __('Erstattungsbetrag', 'wpsg'), wpsg_ff($amount_remaining), ['hint' => wpsg_translate(__('Höchstens #1#', 'wpsg'), wpsg_ff($amount_remaining, $currency))]); ?>
+
+<p>
+ <a class="button" id="wpsg_mod_mollie_refund" href="<?php echo esc_url($mod->getOrderAjaxURL($order_id, 'refund')); ?>"><?php echo esc_html__('Betrag erstatten', 'wpsg'); ?></a>
+</p>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+ jQuery('#wpsg_mod_mollie_refund').on('click', function() {
+
+ var amount = jQuery('#wpsg_mod_mollie_refund_amount').val();
+
+ if (!confirm('<?php echo esc_js(__('Den Betrag über Mollie erstatten?', 'wpsg')); ?>')) return false;
+
+ location.href = this.href + '&amount=' + encodeURIComponent(amount);
+
+ return false;
+
+ });
+
+/* ]]> */</script>
+
+<?php } ?>
diff --git a/views/mods/mod_mollie/settings_edit.phtml b/views/mods/mod_mollie/settings_edit.phtml
index 01b0f8e..9917eb5 100644
--- a/views/mods/mod_mollie/settings_edit.phtml
+++ b/views/mods/mod_mollie/settings_edit.phtml
@@ -38,6 +38,14 @@
<br />
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_mollie_autocapture', __('Autorisierte Zahlungen beim Versand einziehen', 'wpsg'), $this->get_option('wpsg_mod_mollie_autocapture'), ['hint' => __('Bei Methoden wie Klarna, Billie, Riverty oder in3 reserviert Mollie den Betrag zunächst nur. Ist die Option aktiv, wird er eingezogen, sobald die Bestellung auf "Ware versendet" wechselt. Sonst erfolgt der Einzug über die Bestellansicht.', 'wpsg')]); ?>
+
+<?php if ($view['hasAbo']) { ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_mollie_recurring', __('Abo-Verlängerungen automatisch einziehen', 'wpsg'), $this->get_option('wpsg_mod_mollie_recurring'), ['hint' => __('Die erste Zahlung eines Abos legt bei Mollie ein Mandat an, über das jede Verlängerung ohne Zutun des Kunden eingezogen wird. Möglich mit Kreditkarte, Apple Pay, Google Pay, PayPal, iDEAL, Bancontact und eps.', 'wpsg')]); ?>
+<?php } ?>
+
+<br />
+
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_mollie_debug', __('Debugmodus', 'wpsg'), $this->get_option('wpsg_mod_mollie_debug'), ['hint' => __('Schreibt die Kommunikation mit Mollie in das Bestellprotokoll.', 'wpsg')]); ?>
<br />