Subversion Repositories wpShopGermany4

Rev

Rev 8420 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4671 daniel 1
<?php
4655 daniel 2
 
4671 daniel 3
	/**
4
	 * Template für die Einstellungen des PayPal API Moduls
5
	 */
4655 daniel 6
 
4671 daniel 7
?>
4655 daniel 8
 
7706 daniel 9
<?php echo wpsg_drawForm_Select('wpsg_mod_paypalapi_version', __('API Version', 'wpsg'), ['v1' => 'V1', 'v2' => 'V2'], $this->get_option('wpsg_mod_paypalapi_version'), []); ?>
7874 daniel 10
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_clientid', __('Client ID', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_clientid'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_clientid', 'hint' => wpsg_translate(__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
11
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_secret', __('Secret', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_secret'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_secret', 'hint' => wpsg_translate(__('Erhalten Sie im <a target="_blank" href="#1#">PayPal Developer Interface</a>.', 'wpsg'), 'https://developer.paypal.com/'))); ?>
4855 daniel 12
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_sandbox', __('Sandbox', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_sandbox'), array('help' => 'wpsg_mod_paypal_sandbox')); ?>
4655 daniel 13
 
4998 daniel 14
<div class="wpsg_mod_sandbox_layer" style="display:none;">
15
 
5003 daniel 16
	<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_sandbox_clientid', __('Client ID (Sandbox)', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_sandbox_clientid'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_clientid')); ?>
17
	<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_sandbox_secret', __('Secret (Sandbox)', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_sandbox_secret'), array('hint' => __('Erhalten Sie im PayPal Account.', 'wpsg'), 'help' => 'wpsg_mod_paypal_secret')); ?>
4998 daniel 18
 
5003 daniel 19
	<br />
20
 
4998 daniel 21
</div>
22
 
4740 daniel 23
<br />
4695 daniel 24
 
5731 daniel 25
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_currency', __('Währungscode (Standard: EUR)'), $this->get_option('wpsg_mod_paypalapi_currency'), array('help' => 'wpsg_mod_paypal_currency')); ?>
26
 
27
<br />
28
 
4855 daniel 29
<?php echo wpsg_drawForm_Input('', __('WebHook URL', 'wpsg'), $this->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypalapi', 'webHook', array(), true), array('readonly' => true, 'help' => 'wpsg_mod_paypal_webhook_url')); ?>
30
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_create',  __('Beim speichern versuchen den WebHook anzumelden.', 'wpsg'), 0, array('labelright' => true, 'noDoubleDot' => true, 'help' => 'wpsg_mod_paypal_createwebhook')); ?>
5227 daniel 31
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_webhook_log', __('WebHook Anfragen protokollieren', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_webhook_log'), array('labelright' => true)); ?>
32
<div class="layer_wpsg_mod_paypalapi_webhook_log layer_wpsg_mod_paypalapi_webhook_log_1">
33
	<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_webhook_logfile', '', $this->get_option('wpsg_mod_paypalapi_webhook_logfile'), array('hint' => __('Absoluter Pfad zur Protokolldatei, Schreibrechte beachten.', 'wpsg'))); ?>
34
</div>
4740 daniel 35
 
4671 daniel 36
<br />
37
 
7066 daniel 38
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_gebuehr', __('Gebühr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_paypalapi_gebuehr')), array('unit' => $this->get_option('wpsg_currency').' / %', 'help' => 'wpsg_shippay_gebuehr')); ?>
4743 daniel 39
<?php echo wpsg_drawForm_Select('wpsg_mod_paypalapi_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_paypalapi_mwst'), array('help' => 'wpsg_shippay_mwst')); ?>
40
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
4671 daniel 41
 
42
<br />
43
 
5922 hartmut 44
<?php echo wpsg_drawForm_Link('wpsg_mod_paypalapi_link', __('Stornierung bei Statuswechsel', 'wpsg'),
45
		__('Bearbeiten', 'wpsg'), array('help' => 'wpsg_mod_paypalapi_link', 'class' => 'wpsg_mod_paypalapi_stornostate')); ?>
46
 
47
 
4718 daniel 48
<div class="wpsg_mod_paypalapi_stornostate_layer" style="display:none;">
4719 daniel 49
 
4774 thomas 50
	<?php foreach ($this->arStatus as $status_id => $status_label) { $arStornoStatus = (array)$this->get_option('wpsg_mod_paypalapi_stornostate'); ?>
5922 hartmut 51
	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_stornostate['.$status_id.']', __($status_label, 'wpsg'), wpsg_getInt($arStornoStatus[$status_id]), array('labelright' => true)); ?>
4718 daniel 52
	<?php } ?>
53
 
54
	<br />
55
 
56
</div>
57
 
58
<br />
59
 
4993 daniel 60
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_aktiv', __('PayPal für neue Bestellungen erlauben', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_aktiv'), array('help' => 'wpsg_shippay_activ')); ?>
5382 daniel 61
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_plus_aktiv', __('PayPal Plus aktivieren', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_plus_aktiv'), array('help' => 'wpsg_mod_paypalapi_plus_aktiv')); ?>
8444 daniel 62
<?php /*
8420 daniel 63
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_giropay_aktiv', __('GiroPay aktivieren', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_giropay_aktiv'), array('help' => 'wpsg_mod_paypalapi_giropay_aktiv ')); ?>
7214 daniel 64
 
8420 daniel 65
<div id="wpsg_mod_paypalapi_giropay_aktiv_layer">
66
	<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_giropay_name', __('Bezeichnung (GiroPay)', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_giropay_name'), array('help' => 'wpsg_shippay_name')); ?>
67
	<?php echo wpsg_drawForm_Textarea('wpsg_mod_paypalapi_giropay_hint', __('Hinweistext (GiroPay)', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_giropay_hint'), array('help' => 'wpsg_shippay_hint')); ?>
68
</div>
8444 daniel 69
*/ ?>
8420 daniel 70
 
7214 daniel 71
<div class="wpsg_mod_paypalapi_plus_aktiv_layer wpsg_mod_paypalapi_plus_aktiv_layer_1">
72
	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_plus_basket', __('Zahlungsauswahl im Warenkorb', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_plus_basket'), array('help' => 'wpsg_mod_paypalapi_plus_basket')); ?>
73
</div>
74
 
4993 daniel 75
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_paypalexpress', __('PayPal Express aktivieren (Button im Warenkorb)', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress'), array('help' => 'wpsg_mod_paypalapi_paypalexpress')); ?>
5382 daniel 76
<div class="wpsg_mod_paypalapi_plus_aktiv">
77
	<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_paypalexpress_forceSSL', __('SSL für ReturnURL erzwingen', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress_forceSSL'), array('help' => 'wpsg_mod_paypalapi_paypalexpress_forceSSL')); ?>
78
	<?php echo wpsg_drawForm_Input('', __('Return URL', 'wpsg'), $this->getUrl(
79
		wpsg_ShopController::URL_BASKET,
80
		'wpsg_mod_paypalapi',
81
		'startPayPalExpress',
82
		array(),
83
		((wpsg_isSizedInt($this->get_option('wpsg_mod_paypalapi_paypalexpress_forceSSL')))?true:false)
84
	), array('readonly' => true, 'help' => 'wpsg_mod_paypalapi_paypalexpress_returnurl')); ?>
85
	<br />
86
</div>
87
 
5731 daniel 88
<div class="wpsg_mod_paypalapi_plus_inaktiv">
8444 daniel 89
    <?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_autostart', __('Zahlung sofort starten', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_autostart'), array('help' => 'wpsg_shippay_paystart')); ?>
90
</div>
5731 daniel 91
 
4993 daniel 92
<?php echo wpsg_drawForm_Checkbox('wpsg_mod_paypalapi_paypalexpress_details', __('Warenkorbdetails übertragen', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress_details'), array('help' => 'wpsg_mod_paypalapi_paypalexpress_details')); ?>
5007 daniel 93
 
94
<br />
8420 daniel 95
 
5007 daniel 96
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_experience_label', __('Bezeichnung im PayPal Zahlungsinterface', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_experience_label'), array('help' => 'wpsg_mod_paypalapi_experience_label', 'hint' => __('Max. 127 Zeichen', 'wpsg'))); ?>
8420 daniel 97
 
5007 daniel 98
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_experience_logo', __('URL für ein Logo im PayPal Zahlungsinterface', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_experience_logo'), array('help' => 'wpsg_mod_paypalapi_experience_logo', 'hint' => __('gif|png|jpg, Max. 190x60', 'wpsg'))); ?>
99
<?php echo wpsg_drawForm_Select('wpsg_mod_paypalapi_experience_locale_code', __('Sprache im PayPal Zahlungsinterface', 'wpsg'), array(
100
	'DE' => __('Deutsch', 'wpsg'),
101
	'GB' => __('Englisch', 'wpsg'),
102
	'FR' => __('Französisch', 'wpsg')
103
), $this->get_option('wpsg_mod_paypalapi_experience_locale_code'), array('help' => 'wpsg_mod_paypalapi_experience_locale_code')); ?>
104
<br />
105
 
106
 
4993 daniel 107
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_paypalexpress_name', __('Bezeichnung', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress_name'), array('help' => 'wpsg_shippay_name')); ?>
108
<?php echo wpsg_drawForm_Input('wpsg_mod_paypalapi_paypalexpress_subject', __('Betreff für Zahlung', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_paypalexpress_subject'), array('help' => 'wpsg_mod_paypal_subject')); ?>
109
<?php echo wpsg_drawForm_Textarea('wpsg_mod_paypalapi_plus_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_paypalapi_plus_hint'), array('help' => 'wpsg_shippay_hint')); ?>
4833 daniel 110
 
7706 daniel 111
<script>
4718 daniel 112
 
113
	jQuery(document).ready(function() {
4993 daniel 114
 
7706 daniel 115
	    var wpsg_mod_paypalapi_version = jQuery('#wpsg_mod_paypalapi_version').val();
116
 
117
	    jQuery('#wpsg_mod_paypalapi_version').on('change', function() {
118
 
119
	        if (jQuery(this).val() === 'v2' && wpsg_mod_paypalapi_version === 'v1') {
120
 
121
	            alert('<?php echo __('Beim Wechseln von V1 auf V2 sollte eine neue App im PayPal Developer Intervace angelegt werden.', 'wpsg'); ?>');
122
 
123
            }
124
 
125
        });
126
 
7214 daniel 127
		jQuery('#wpsg_mod_paypalapi_plus_aktiv').on('change', function() {
128
 
129
			jQuery('.wpsg_mod_paypalapi_plus_aktiv_layer').hide();
130
			jQuery('.wpsg_mod_paypalapi_plus_aktiv_layer_' + jQuery(this).val()).show();
131
 
132
		} ).change();
133
 
5227 daniel 134
		jQuery('#wpsg_mod_paypalapi_webhook_log').bind('change', function() {
135
 
136
			jQuery('.layer_wpsg_mod_paypalapi_webhook_log').hide();
137
 
138
			if (jQuery(this).is(':checked'))
139
			{
140
 
141
				jQuery('.layer_wpsg_mod_paypalapi_webhook_log_1').show();
142
 
143
			}
144
 
145
		} ).change();
146
 
4998 daniel 147
		jQuery('#wpsg_mod_paypalapi_sandbox').bind('change', function() {
148
 
149
			if (jQuery(this).is(':checked')) jQuery('.wpsg_mod_sandbox_layer').show();
150
			else jQuery('.wpsg_mod_sandbox_layer').hide();
151
 
152
		} ).change();
153
 
4993 daniel 154
		jQuery('#wpsg_mod_paypalapi_plus_aktiv').bind('change', function() {
155
 
5731 daniel 156
			if (jQuery(this).is(':checked'))
5922 hartmut 157
            {
158
 
159
                jQuery('.wpsg_mod_paypalapi_plus_aktiv').show();
160
                jQuery('.wpsg_mod_paypalapi_plus_inaktiv').hide();
161
 
162
            }
163
			else
164
            {
165
 
166
                jQuery('.wpsg_mod_paypalapi_plus_aktiv').hide();
167
                jQuery('.wpsg_mod_paypalapi_plus_inaktiv').show();
168
 
169
            }
4993 daniel 170
 
171
		} ).change();
4740 daniel 172
 
4718 daniel 173
		jQuery('.wpsg_mod_paypalapi_stornostate').bind('click', function() {
174
 
175
			jQuery('.wpsg_mod_paypalapi_stornostate_layer').toggle();
176
 
177
			if (jQuery('.wpsg_mod_paypalapi_stornostate_layer').is(':visible')) jQuery(this).html('<?php echo __('Ausblenden', 'wpsg'); ?>');
178
			else jQuery(this).html('<?php echo __('Bearbeiten', 'wpsg'); ?>');
179
 
180
			return false;
181
 
182
		} );
183
 
184
	} );
185
 
8420 daniel 186
	const el_wpsg_mod_paypalapi_plus_aktiv = document.getElementById('wpsg_mod_paypalapi_plus_aktiv');
8444 daniel 187
	//const el_wpsg_mod_paypalapi_giropay_aktiv = document.getElementById('wpsg_mod_paypalapi_giropay_aktiv');
188
	//const el_wpsg_mod_paypalapi_giropay_aktiv_layer = document.getElementById('wpsg_mod_paypalapi_giropay_aktiv_layer');
8420 daniel 189
 
190
	el_wpsg_mod_paypalapi_plus_aktiv.addEventListener('change', event => {
191
 
192
		if (el_wpsg_mod_paypalapi_plus_aktiv.checked) {
193
 
8444 daniel 194
			//el_wpsg_mod_paypalapi_giropay_aktiv.disabled = true;
195
			//el_wpsg_mod_paypalapi_giropay_aktiv.checked = false;
8420 daniel 196
 
197
		} else {
198
 
8444 daniel 199
			//el_wpsg_mod_paypalapi_giropay_aktiv.disabled = false;
8420 daniel 200
 
201
		}
202
 
203
	});
8444 daniel 204
 
205
	/*
8420 daniel 206
	el_wpsg_mod_paypalapi_giropay_aktiv.addEventListener('change', event => {
207
 
208
		if (el_wpsg_mod_paypalapi_giropay_aktiv.checked) {
209
 
210
			el_wpsg_mod_paypalapi_giropay_aktiv_layer.style.display = 'block';
211
 
212
		} else {
213
 
214
			el_wpsg_mod_paypalapi_giropay_aktiv_layer.style.display = 'none';
215
 
216
		}
217
 
8444 daniel 218
	});*/
8420 daniel 219
 
220
	el_wpsg_mod_paypalapi_plus_aktiv.dispatchEvent(new Event('change'));
8444 daniel 221
	//el_wpsg_mod_paypalapi_giropay_aktiv.dispatchEvent(new Event('change'));
8420 daniel 222
 
7706 daniel 223
</script>