summaryrefslogtreecommitdiff
path: root/views/mods/mod_mollie/settings_edit.phtml
blob: 01b0f8e2137e7156d2b25ea7d9aff9481ab115b1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php

	/**
	 * Template für die Einstellungen des Mollie Moduls
	 */

	$view = $this->view['wpsg_mod_mollie'];

?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_mollie_testmode', __('Testmodus', 'wpsg'), $this->get_option('wpsg_mod_mollie_testmode'), ['hint' => __('Im Testmodus wird der Test-API-Schlüssel verwendet. Mollie unterscheidet Test- und Livebetrieb allein über den Schlüssel.', 'wpsg')]); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_apikey_test', __('API-Schlüssel (Test)', 'wpsg'), $this->get_option('wpsg_mod_mollie_apikey_test'), ['hint' => __('Beginnt mit test_', 'wpsg')]); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_apikey_live', __('API-Schlüssel (Live)', 'wpsg'), $this->get_option('wpsg_mod_mollie_apikey_live'), ['hint' => __('Beginnt mit live_', 'wpsg')]); ?>
<?php echo wpsg_drawForm_Input('', __('Webhook URL', 'wpsg'), $view['webhookURL'], ['readonly' => true, 'hint' => __('Mollie ruft diese URL bei jeder Statusänderung auf. Sie wird bei jeder Zahlung automatisch mitgesendet und muss von außen erreichbar sein.', 'wpsg')]); ?>

<br />

<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_currency', __('Währung', 'wpsg'), $this->get_option('wpsg_mod_mollie_currency'), ['hint' => __('ISO-4217-Code, z.B. EUR', 'wpsg')]); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_mollie_locale', __('Sprache der Bezahlseite', 'wpsg'), [
	'auto' => __('Automatisch (Sprache von WordPress)', 'wpsg'),
	'de_DE' => __('Deutsch (Deutschland)', 'wpsg'),
	'de_AT' => __('Deutsch (Österreich)', 'wpsg'),
	'de_CH' => __('Deutsch (Schweiz)', 'wpsg'),
	'en_GB' => __('Englisch (Großbritannien)', 'wpsg'),
	'en_US' => __('Englisch (USA)', 'wpsg'),
	'nl_NL' => __('Niederländisch', 'wpsg'),
	'fr_FR' => __('Französisch', 'wpsg'),
	'it_IT' => __('Italienisch', 'wpsg'),
	'es_ES' => __('Spanisch', 'wpsg'),
	'pl_PL' => __('Polnisch', 'wpsg')
], $this->get_option('wpsg_mod_mollie_locale')); ?>
<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_description', __('Beschreibung der Zahlung', 'wpsg'), $this->get_option('wpsg_mod_mollie_description'), ['hint' => __('Erscheint auf dem Kontoauszug des Kunden, maximal 255 Zeichen. Platzhalter wie %order_id% oder %kunde_id% sind möglich.', 'wpsg')]); ?>
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_mollie_notaxcountry', __('Keine MwSt. auf die Gebühr, wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_mollie_notaxcountry'), ['help' => 'wpsg_shippay_mwstland']); ?>

<br />

<?php echo wpsg_drawForm_Select('wpsg_mod_mollie_successPage', __('Seite nach erfolgreicher Zahlung', 'wpsg'), $view['arPages'], $this->get_option('wpsg_mod_mollie_successPage')); ?>
<?php echo wpsg_drawForm_Select('wpsg_mod_mollie_errorPage', __('Seite nach fehlgeschlagener Zahlung', 'wpsg'), $view['arPages'], $this->get_option('wpsg_mod_mollie_errorPage')); ?>

<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 />

<?php if (!$view['hasApiKey']) { ?>
<div class="wpsg_hinweis"><?php echo esc_html__('Es ist kein gültiger API-Schlüssel für die aktive Umgebung hinterlegt. Speichern Sie zuerst den Schlüssel, danach werden hier die bei Mollie freigeschalteten Zahlungsmethoden angezeigt.', 'wpsg'); ?></div>
<?php } else if (!wpsg_isSizedArray($view['arMollieMethods'])) { ?>
<div class="wpsg_hinweis"><?php echo esc_html__('Mollie hat keine freigeschalteten Zahlungsmethoden gemeldet. Prüfen Sie den API-Schlüssel und die Freischaltung im Mollie Dashboard.', 'wpsg'); ?></div>
<?php } ?>

<br />

<?php foreach ($view['arMethods'] as $index => $arMethod) { ?>

	<?php

		$key_active = 'wpsg_mod_mollie_m'.$index.'_active';
		$bActive = ($this->get_option($key_active) === '1');

		$method_id = (string)$arMethod['id'];
		$method_min = (string)($view['arMollieMethods'][$method_id]['min'] ?? '');

		// Methoden, die Mollie für dieses Konto nicht freigeschaltet hat, werden gekennzeichnet
		$bAtMollie = (($method_id === '') || array_key_exists($method_id, (array)$view['arMollieMethods']));

		$title = $arMethod['name'];

		if (!$bAtMollie) $title .= ' <span style="color:#a00;">('.esc_html__('bei Mollie nicht freigeschaltet', 'wpsg').')</span>';

	?>

	<?php echo wpsg_drawForm_AdminboxStart($title, 'wpsg_mod_mollie_m'.$index, ['collapsable' => true, 'collapsed' => !$bActive]); ?>

		<?php echo wpsg_drawForm_Checkbox($key_active, __('Zahlungsart aktiv', 'wpsg'), $this->get_option($key_active)); ?>
		<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_m'.$index.'_name', __('Bezeichnung', 'wpsg'), $this->get_option('wpsg_mod_mollie_m'.$index.'_name'), ['placeholder' => $arMethod['name']]); ?>
		<?php echo wpsg_drawForm_Textarea('wpsg_mod_mollie_m'.$index.'_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_mollie_m'.$index.'_hint')); ?>
		<?php echo wpsg_drawForm_Input('wpsg_mod_mollie_m'.$index.'_fee', __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_mollie_m'.$index.'_fee'), true), ['unit' => $this->get_option('wpsg_currency').' / %', 'help' => 'wpsg_shippay_gebuehr']); ?>
		<?php echo wpsg_drawForm_Select('wpsg_mod_mollie_m'.$index.'_tax_key', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_mollie_m'.$index.'_tax_key')); ?>

		<?php if ($method_min !== '') { ?>
		<div class="wpsg_hinweis"><?php echo wpsg_translate(esc_html__('Mollie erlaubt diese Methode ab #1#.', 'wpsg'), esc_html($method_min).' '.esc_html($this->get_option('wpsg_mod_mollie_currency'))); ?></div>
		<?php } ?>

	<?php echo wpsg_drawForm_AdminboxEnd(); ?>

<?php } ?>

<div class="wpsg_hinweis"><?php echo esc_html__('Welche Methoden Ihnen zur Verfügung stehen, entscheidet Ihr Mollie Dashboard. Logos und Betragsgrenzen werden bei jedem Speichern neu von Mollie gelesen.', 'wpsg'); ?></div>