Index: /controller/wpsg_AdminController.class.php
===================================================================
--- /controller/wpsg_AdminController.class.php	(revision 5867)
+++ /controller/wpsg_AdminController.class.php	(revision 5873)
@@ -145,5 +145,9 @@
 				'Menutext' => __('Seitenkonfiguration', 'wpsg'),
 				'subTemplate' => WPSG_PATH_VIEW.'/admin/seiten.phtml'
-			); 
+			);
+			$this->shop->view['arSubAction']['customerpreset'] = array(
+				'Menutext' => __('Kundenvoreinstellungen', 'wpsg'),
+				'subTemplate' => WPSG_PATH_VIEW.'/admin/customerpreset.phtml'
+			);
 			$this->shop->view['arSubAction']['kundendaten'] = array(
 				'Menutext' => __('Kundendaten', 'wpsg'),
Index: /controller/wpsg_BasketController.class.php
===================================================================
--- /controller/wpsg_BasketController.class.php	(revision 5867)
+++ /controller/wpsg_BasketController.class.php	(revision 5873)
@@ -414,5 +414,5 @@
 
 				// Ein Produktformular wurde abgeschickt
-				
+
 				parent::dispatch();
 				  		
@@ -426,10 +426,10 @@
 				// Produkt hinzufÃŒgen
 				$bOK = $this->shop->basket->addProduktToSession($_REQUEST['wpsg']['produkt_id'], $_REQUEST['wpsg']['menge']);
-				
+
 				if ($this->shop->get_option('wpsg_afterinsert') == '2') die();
 				
 				if ($this->shop->get_option('wpsg_afterinsert') == '3')
 				{
-				
+
 					$this->shop->view['product_data'] = $product_data;
 					$this->shop->view['product_key'] = $_REQUEST['wpsg']['produkt_id'];
@@ -444,7 +444,7 @@
 						
 					$this->redirect($_REQUEST['myReferer']);
-				
-				}
-				
+
+				}
+
 				// Erfolgsmeldung hinzufÃŒgen
 				if ($bOK === true) $this->shop->addFrontendMessage(__('Produkt erfolgreich in den Warenkorb gefÃŒgt.', 'wpsg'));
Index: /controller/wpsg_OrderController.class.php
===================================================================
--- /controller/wpsg_OrderController.class.php	(revision 5867)
+++ /controller/wpsg_OrderController.class.php	(revision 5873)
@@ -469,9 +469,9 @@
 						// Neuer Status
 						$_REQUEST['wpsg_rechnungen_status_neu'] = '110';
-
+						
 						// FuÃtext
 						if ($this->shop->get_option('wpsg_rechnungen_foottext_standard') !== false)
 						{
-
+							
 							$wpsg_rechnungen_footer = $this->get_option("wpsg_rechnungen_footer");
  							if (!is_array($wpsg_rechnungen_footer)) $wpsg_rechnungen_footer = unserialize($this->get_option("wpsg_rechnungen_footer"));
@@ -513,5 +513,5 @@
 								try
 								{
-									
+								
 									$this->shop->callMod('wpsg_mod_rechnungen', 'writeRechnung', array($k, false, false));
 									$arIDs[] = $k;
@@ -525,5 +525,5 @@
 									
 								}
-
+								
 							}
 
Index: /controller/wpsg_ShopController.class.php
===================================================================
--- /controller/wpsg_ShopController.class.php	(revision 5867)
+++ /controller/wpsg_ShopController.class.php	(revision 5873)
@@ -387,5 +387,5 @@
 		 * ÃberprÃŒft ob der Kunde $customer_id das Produkt $product_id schon gekauft hat
 		 * Wenn $customer_id = false ist, wird nach dem eingeloggten Benutzer geschaut. 
-		 * Ist kein Benutzer eingelogt wird false zurÃŒckgegeben
+		 * Ist kein Benutzer eingeloggt wird false zurÃŒckgegeben
 		 * 
 		 * Keine BerÃŒcksichtigung auf Bestellstatus
@@ -1077,5 +1077,5 @@
 		public function renderProdukt($produkt_id, $force_template = false, $force_locale = false)
 		{
-						
+			
 			global $locale, $l10n;
 
@@ -1197,5 +1197,5 @@
 		public function shortcode_basket($atts, $content = '')
 		{
-				
+			
 			$product_id = wpsg_getStr($atts['product']);
 			$title = wpsg_getStr($atts['title']);
@@ -1520,8 +1520,8 @@
 								
 			}
-				 
+			
 			if ($this->getFrontendTaxview() == WPSG_BRUTTO) $produkt['preis'] = $produkt['preis_brutto'];
 			else $produkt['preis'] = $produkt['preis_netto'];
-				 
+			
 			$produkt['min_preis'] = wpsg_tf($produkt['preis']);
 			$produkt['max_preis'] = wpsg_tf($produkt['preis']);
@@ -1546,8 +1546,8 @@
 						
 			global $wp_rewrite;
-			
+
 			if (is_object($wp_rewrite))
 			{
-			
+
 				$produkt['url'] = $this->getProduktLink($produkt['id']);
 				
@@ -1768,5 +1768,5 @@
 			{
 				return preg_replace('/(vp_)|(\/(.*))/', '', $produkt_key);
-			}			
+			}
 			else if (preg_match('/abo_\d+_\d+/', $produkt_key))
 			{
@@ -2161,5 +2161,5 @@
 			
 			$arLanguage = $this->getStoreLanguages();
-			
+
 			foreach ((array)$arLanguage as $locale => $lang)
 			{
@@ -2176,5 +2176,5 @@
 		public function getCurrentLanguage()
 		{
-			
+
 			if (!$this->force_locale) return get_locale();
 			else return $this->force_locale;
@@ -2334,9 +2334,9 @@
 						"lang" => $lang
 					);	
-					 
-				} 
-				
-			}
-			
+
+				}
+				
+			}
+
 			return $arLang;
 			
@@ -3690,5 +3690,5 @@
 		public function getProductName($product_id, $detailname = false)
 		{
-						
+			
 			$oProduct = wpsg_product::getInstance($product_id);
 			
@@ -3710,8 +3710,8 @@
 			if (wpsg_isSizedArray($this->view['basket']['produkte']) && !$this->bShippingMerged)
 			{
-
+				
 				$arSystemShippingAllowed = array_keys($this->arShipping);				
 				$arProductShippingAllowd = $arSystemShippingAllowed;
-
+				
 				$bDontMerge130 = wpsg_isSizedInt($this->get_option('wpsg_mod_willcollect_dontMerge'));
 				$bMerge130 = false;
@@ -3737,5 +3737,5 @@
 					
 				}
-				  
+				 
 				if ($bMoreThen130Allowed === true && (!wpsg_isSizedArray($arProductShippingAllowd) || (sizeof($arProductShippingAllowd) == 1 && in_array('130', $arProductShippingAllowd))))
 				{
@@ -3745,5 +3745,5 @@
 					// SofortÃŒberweisung rausnehmen
 					$arSystemShippingAllowedMerged = $arSystemShippingAllowed;
-					
+					 
 					if (in_array('130', $arSystemShippingAllowed) && $bDontMerge130) unset($arSystemShippingAllowedMerged[array_search('130', $arSystemShippingAllowedMerged)]);
 					
@@ -3802,5 +3802,5 @@
 			
 				//$arSystemShippingAllowedMerged = wpsg_trim($arSystemShippingAllowedMerged);			
-
+			
 				foreach ($arSystemShippingAllowedMerged as $shipping)
 				{
Index: /mods/mod_addressvalidation/addressvalidation.js
===================================================================
--- /mods/mod_addressvalidation/addressvalidation.js	(revision 5873)
+++ /mods/mod_addressvalidation/addressvalidation.js	(revision 5873)
@@ -0,0 +1,82 @@
+/**
+ * Globale Funktionen zur Adressvalidation
+ */
+
+function validateAddressBind(data) {
+	jQuery(data.PLZ).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Ort).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Strasse).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Land).on("input", function () {
+		validateAddress(data);
+	});
+}
+
+// Adress-Validation
+function validateAddress(data) {
+	var
+		plz,
+		ort,
+		strasse,
+		astr1,
+		land = 'de',
+		rw;
+	plz = jQuery(data.PLZ).val();
+	ort = jQuery(data.Ort).val();
+	strasse = jQuery(data.Strasse).val();
+	nr = jQuery(data.Nr).val();
+	if (nr !== undefined) {
+		strasse = strasse + ' ' + nr;
+	}
+	land = jQuery(data.Land + ' option:selected').val();
+	land = jQuery(data.Land + ' option:selected').attr('data-land');
+
+	astr1 = localStorage.getItem(data.StorageKey);
+	if ((plz.length > 3) && (ort.length > 3) && (strasse.length > 3) &&
+		(astr1 != (strasse + plz + ort + land))) 
+	{
+
+		astr1 = strasse + plz + ort + land;
+		localStorage.setItem(data.StorageKey, astr1);
+	    jQuery.ajax({
+	        url: 'http://api.address-validator.net/api/verify',
+	        type: 'POST',
+	        data: { StreetAddress: strasse,
+	                City: ort,
+	                PostalCode: plz,
+	                //State: State,
+	                CountryCode: land,
+	                //Locale: land,
+	                APIKey: data.Key},
+	        dataType: 'json',
+	        success: function (json) {
+	            // check API result
+	            if (typeof(json.status) != "undefined") {
+	                status = json.status;
+	                formattedaddress = json.formattedaddress;
+	                if (json.status === 'VALID') {
+
+
+	                } else if ((json.status === 'INVALID') || (json.status === 'SUSPECT')) {
+
+	                	alert(data.MsgTeil1 + '-Validation fehlerhaft. Bitte StraÃe, Hausnummer, PLZ, Ort und Land ÃŒberprÃŒfen.');
+		                
+	                } else {
+
+						alert('Adress-Validation Serverproblem: ' + json.status);
+						
+	                }
+	            }
+
+	        }
+	    });
+		
+	}
+
+}
+
Index: /mods/mod_addressvalidation/settings_edit.phtml
===================================================================
--- /mods/mod_addressvalidation/settings_edit.phtml	(revision 5873)
+++ /mods/mod_addressvalidation/settings_edit.phtml	(revision 5873)
@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Einstellungen des Moduls "Adressvalidation"
+	 */
+
+?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), array('help' => 'wpsg_mod_addressvalidation_apikey')); ?>
+
+<a class="button-primary" id="button-google" target="popup" href="http://www.address-validator.net/address-online-verification-api.html" onclick="window.open('', 'popup', 'width=500;height=200,resizable=yes,menubar=yes')">
+	<?php echo __('SchlÃŒssel anfordern', 'wpsg'); ?>
+</a>
Index: /mods/wpsg_mod_addressvalidation.class.php
===================================================================
--- /mods/wpsg_mod_addressvalidation.class.php	(revision 5873)
+++ /mods/wpsg_mod_addressvalidation.class.php	(revision 5873)
@@ -0,0 +1,259 @@
+<?php
+
+	/**
+	 * Dieses Modul erlaubt die Adressvalidation
+	 * @author hartmut
+	 */
+	class wpsg_mod_addressvalidation extends wpsg_mod_basic
+	{
+	
+		var $lizenz = 2;
+		var $id = 3250;
+		var $hilfeURL = 'http://wpshopgermany.de/?p=4670347';
+	
+		/**
+		 * Constructor
+		 */
+		public function __construct()
+		{
+			
+			global $wpdb;
+			
+			parent::__construct();
+				
+			$this->name = __('Adressvalidation', 'wpsg');
+			$this->group = __('Sonstiges', 'wpsg');
+			$this->desc = __('ErmÃ¶glicht die PrÃŒfung der Adresse.', 'wpsg');
+					
+		} // public function __construct()
+		
+		public function install()
+		{
+		
+			require_once(WPSG_PATH_WP.'/wp-admin/includes/upgrade.php');
+				
+			$this->shop->checkDefault('wpsg_mod_addressvalidation_apikey', '', false, true);
+				
+		} // public function install()
+		
+		public function settings_edit()
+		{
+				
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_addressvalidation/settings_edit.phtml');
+				
+		}
+		
+		public function settings_save()
+		{
+				
+			$this->shop->update_option('wpsg_mod_addressvalidation_apikey', $_REQUEST['wpsg_mod_addressvalidation_apikey']);
+		
+		} // public function settings_save()
+		
+		public function wpsg_enqueue_scripts()
+		{
+	
+			if (!is_admin() && wpsg_isSizedInt(get_the_ID()) && (
+					get_the_ID() == $this->shop->get_option('wpsg_page_basket') ||
+					get_the_ID() == $this->shop->get_option('wpsg_page_mod_kundenverwaltung_profil') || 
+					get_the_ID() == $this->shop->get_option('wpsg_page_mod_kundenverwaltung_registrierung') 
+				))
+			{
+				
+				$gurl = $this->shop->getRessourceURL('mods/mod_addressvalidation/addressvalidation.js');
+				
+				wp_register_script('wpsg-mod_addressvalidation-valid', $gurl, array(), null);
+				wp_enqueue_script('wpsg-mod_addressvalidation-valid');
+		
+			}
+				
+		} // public wpsg_enqueue_scripts()
+
+		/**
+		 * Varlidierung durchfÃŒhren
+		 * KÃ¶nnte man vielleicht ÃŒber die Funktion wpsg_SystemController->get_url_post_content durchfÃŒhren
+		 * @param $state
+		 * @param $error
+		 * @param $arCheckout
+		 */
+		public function checkCheckout(&$state, &$error, &$arCheckout)
+		{
+	 
+			if (
+				($state == 1) ||
+				($state >= 1 && $this->shop->hasMod('wpsg_mod_onepagecheckout'))
+				)
+			{
+				 
+				// $arCheckout['strasse']  (plz, ort, land, nr)
+				$strasse = $arCheckout['strasse'];
+				$ort = $arCheckout['ort'];
+				$plz = $arCheckout['plz'];
+				$nr = $arCheckout['nr'];
+				$land = $arCheckout['land'];
+				
+				if (wpsg_isSizedInt($land))
+				{
+				
+					$oCountry = wpsg_country::getInstance($land);
+					$land = strtolower($oCountry->getShorttext());
+					
+				} else $land = '';
+				
+				$astr = $strasse.$nr.$plz.$ort.$land;
+				
+				$key = $this->shop->get_option('wpsg_mod_addressvalidation_apikey');
+					
+				if (wpsg_isSizedInt($this->shop->get_option('wpsg_showNr'))) {
+						
+					$strasse = $strasse.' '.$nr;
+				
+				}
+					
+				if ($astr != $_SESSION['wpsg']['Adressstring1'])
+				{
+					$_SESSION['wpsg']['Adressstring1'] = $astr;
+					
+					// build API request
+					$APIUrl = 'http://api.address-validator.net/api/verify';
+					$Params = array('StreetAddress' => $strasse,
+							'City' => $ort,
+							'PostalCode' => $plz,
+							//'State' => $State,
+							'CountryCode' => $land,
+							//'Locale' => $Locale,
+							'APIKey' => $key);
+					$Request = http_build_query($Params, '', '&');
+					$ctxData = array(
+							'method'=>"POST",
+							'header'=>"Connection: close\r\n".
+							"Content-Type: application/x-www-form-urlencoded\r\n".
+							"Content-Length: ".strlen($Request)."\r\n",
+							'content'=>$Request);
+					$ctx = stream_context_create(array('http' => $ctxData));
+					
+					// send API request
+					$result = json_decode(file_get_contents($APIUrl, false, $ctx));
+					
+					// check API result
+					if ($result && $result->{'status'} == 'VALID') {
+						$formattedaddress = $result->{'formattedaddress'};
+					} else {
+						//echo $result->{'info'};
+						if (($result->{'status'} == 'SUSPECT') || ($result->{'status'} == 'INVALID'))
+						{
+							
+							$_SESSION['wpsg']['errorFields'][] = 'strasse';
+							$_SESSION['wpsg']['errorFields'][] = 'nr';
+							$_SESSION['wpsg']['errorFields'][] = 'ort';
+							$_SESSION['wpsg']['errorFields'][] = 'plz';
+							$_SESSION['wpsg']['errorFields'][] = 'land';
+							$_SESSION['wpsg']['errorFields'][] = 'ort';
+							$this->shop->addFrontendError(__('Bitte die Kundenadresse (StraÃe, Hausnummer, PLZ, Ort und Land kontrollieren (Adressvalidation)', 'wpsg'));
+							$error = true;
+							
+						}
+						else
+						{
+							
+							$this->shop->addFrontendError(wpsg_translate(__('Probleme mit dem Server der Adressvalidation (#1#)', 'wpsg'), $result->{'status'}));
+							$error = true;
+							
+						}
+							
+					}
+				
+				}			
+				
+				if (array_key_exists('diff_shippingadress', $arCheckout))
+				{
+					// $arCheckout['diff_shippingadress'], shipping_(strasse, plz, ort, land)
+					$strasse = $arCheckout['shipping_strasse'];
+					$ort = $arCheckout['shipping_ort'];
+					$plz = $arCheckout['shipping_plz'];
+					$nr = $arCheckout['shipping_nr'];
+					$land = $arCheckout['shipping_land'];
+					
+					if (wpsg_isSizedInt($land))
+					{
+					
+						$oCountry = wpsg_country::getInstance($land);
+						$land = strtolower($oCountry->getShorttext());
+						
+					} else $land = '';
+					
+					
+					$astr = $strasse.$nr.$plz.$ort.$land;
+						
+					$key = $this->shop->get_option('wpsg_mod_addressvalidation_apikey');
+						
+					if (wpsg_isSizedInt($this->shop->get_option('wpsg_showNr'))) {
+					
+						$strasse = $strasse.' '.$nr;
+					
+					}
+						
+					if ($astr != $_SESSION['wpsg']['Adressstring2'])
+					{
+						$_SESSION['wpsg']['Adressstring2'] = $astr;
+							
+						// build API request
+						$APIUrl = 'http://api.address-validator.net/api/verify';
+						$Params = array('StreetAddress' => $strasse,
+								'City' => $ort,
+								'PostalCode' => $plz,
+								//'State' => $State,
+								'CountryCode' => $land,
+								//'Locale' => $Locale,
+								'APIKey' => $key);
+						$Request = http_build_query($Params, '', '&');
+						$ctxData = array(
+								'method'=>"POST",
+								'header'=>"Connection: close\r\n".
+								"Content-Type: application/x-www-form-urlencoded\r\n".
+								"Content-Length: ".strlen($Request)."\r\n",
+								'content'=>$Request);
+						$ctx = stream_context_create(array('http' => $ctxData));
+						
+						// send API request
+						$result = json_decode(file_get_contents($APIUrl, false, $ctx));
+						
+						// check API result
+						if ($result && $result->{'status'} == 'VALID') {
+							$formattedaddress = $result->{'formattedaddress'};
+						} else {
+							//echo $result->{'info'};
+							if (($result->{'status'} == 'SUSPECT') || ($result->{'status'} == 'INVALID'))
+							{
+						
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_strasse';
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_nr';
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_ort';
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_plz';
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_land';
+								$_SESSION['wpsg']['errorFields'][] = 'shipping_ort';
+								$this->shop->addFrontendError(__('Bitte die Lieferadresse (StraÃe, Hausnummer, PLZ, Ort und Land kontrollieren (Adressvalidation)', 'wpsg'));
+								$error = true;
+						
+							}
+							else
+							{
+						
+								$this->shop->addFrontendError(__('Probleme mit dem Server (Adressvalidation)'.' ('.$result->{'status'}.')', 'wpsg'));
+								$error = true;
+						
+							}
+						
+						}
+					
+					}
+					
+				}
+					
+			}
+				
+		} // public function checkCheckout(&$state, &$error, &$arCheckout)
+		
+	}
+
+?>
Index: /mods/wpsg_mod_basic.class.php
===================================================================
--- /mods/wpsg_mod_basic.class.php	(revision 5867)
+++ /mods/wpsg_mod_basic.class.php	(revision 5873)
@@ -31,4 +31,5 @@
 			15 		=> 'wpsg_mod_produktartikel',
 			16		=> 'wpsg_mod_creditcard',
+			17		=> 'wpsg_mod_targo',
 			20 		=> 'wpsg_mod_autodebit',
 			30		=> 'wpsg_mod_productindex',
@@ -95,4 +96,5 @@
 			4000	=> 'wpsg_mod_crefopay', /* Sollte die letzte Zahlungsart bleiben, da sie die anderen ausblendet */
 			3150	=> 'wpsg_mod_request',
+			3250	=> 'wpsg_mod_addressvalidation',
 			5000	=> 'wpsg_mod_trustedshops', // Sollte nach den Zahlungsanbietern kommen wegen order_done
 			5100    => 'wpsg_mod_productview', 
Index: /mods/wpsg_mod_targo.class.php
===================================================================
--- /mods/wpsg_mod_targo.class.php	(revision 5873)
+++ /mods/wpsg_mod_targo.class.php	(revision 5873)
@@ -0,0 +1,807 @@
+<?php
+
+	/**
+	 * Dieses Modul ermÃ¶glicht die Zahlungsart "Targo"
+	 */
+	class wpsg_mod_targo extends wpsg_mod_basic
+	{
+		
+		var $lizenz = 1;
+		var $id = 17;		
+		var $hilfeURL = 'http://wpshopgermany.de/?p=4693700';
+
+		var $url = false; // URL zum Targo Endpunkt, wird von der init() Methode gesetzt
+		var $apiContext = false;
+		
+		const STATUS_CREDIT_ACCEPTED = 350;
+		
+		/**
+		 * Constructor
+		 */
+		public function __construct()
+		{
+			
+			parent::__construct();
+			
+			$this->name = __('Targobank', 'wpsg');
+			$this->group = __('Zahlungsarten', 'wpsg');
+			$this->desc = __('ErmÃ¶glicht die Zahlungsart Targobank.', 'wpsg');
+						
+		} // public function __construct()
+		
+		public function install()
+		{
+
+			$this->shop->checkDefault('wpsg_mod_targo_aktiv', '1');
+			$this->shop->checkDefault('wpsg_mod_targo_autostart', '1');
+			$this->shop->checkDefault('wpsg_mod_targo_summe_min', '99.00');
+			$this->shop->checkDefault('wpsg_mod_targo_summe_max', '12500.00');
+			$this->shop->checkDefault('wpsg_mod_targo_laufzeit_min', '6');
+			$this->shop->checkDefault('wpsg_mod_targo_laufzeit_max', '60');
+			$this->shop->checkDefault('wpsg_mod_targo_rate_min', '10.00');
+			$this->shop->checkDefault('wpsg_mod_targo_url', '');
+			$this->shop->checkDefault('wpsg_mod_targo_koop_id', '');
+			$this->shop->checkDefault('wpsg_mod_targo_dealerid', '');
+			$this->shop->checkDefault('wpsg_mod_targo_hashkey', '');
+			$this->shop->checkDefault('wpsg_mod_targo_success', '');
+			$this->shop->checkDefault('wpsg_mod_targo_error', '');
+			
+			$this->shop->checkDefault('wpsg_mod_targo_bezeichnung', '');
+			$this->shop->checkDefault('wpsg_mod_targo_hint', '');
+			$this->shop->checkDefault('wpsg_mod_targo_createwebhook', '');
+			$this->shop->checkDefault('wpsg_mod_targo_gebuehr', '');
+			$this->shop->checkDefault('wpsg_mod_targo_mwst', '');
+			$this->shop->checkDefault('wpsg_mod_targo_mwstland', '');
+				
+		} // public function install()
+		
+		public function init() 
+		{
+			
+			spl_autoload_register(array($this, 'spl_autoload'));
+			
+			
+		} // public function init()
+		
+		public function settings_edit()
+		{
+			 
+			$pages = get_pages();
+			
+			$arPages = array(
+				'-1' => __('Neu anlegen und zuordnen', 'wpsg')
+			);
+			
+			foreach ($pages as $k => $v)
+			{
+				$arPages[$v->ID] = $v->post_title.' (ID:'.$v->ID.')';
+			}
+			
+			$this->shop->view['pages'] = $arPages;
+			
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_targo/settings_edit.phtml');
+			
+		} // public function settings_edit()
+				
+		public function settings_save()
+		{
+			
+			$this->shop->update_option('wpsg_mod_targo_aktiv', $_REQUEST['wpsg_mod_targo_aktiv']);
+			$this->shop->update_option('wpsg_mod_targo_autostart', $_REQUEST['wpsg_mod_targo_autostart']);
+			$this->shop->update_option('wpsg_mod_targo_summe_min', $_REQUEST['wpsg_mod_targo_summe_min']);
+			$this->shop->update_option('wpsg_mod_targo_summe_max', $_REQUEST['wpsg_mod_targo_summe_max']);
+			$this->shop->update_option('wpsg_mod_targo_laufzeit_min', $_REQUEST['wpsg_mod_targo_laufzeit_min']);
+			$this->shop->update_option('wpsg_mod_targo_laufzeit_max', $_REQUEST['wpsg_mod_targo_laufzeit_max']);
+			$this->shop->update_option('wpsg_mod_targo_rate_min', $_REQUEST['wpsg_mod_targo_rate_min']);
+			$this->shop->update_option('wpsg_mod_targo_url', $_REQUEST['wpsg_mod_targo_url']);
+			$this->shop->update_option('wpsg_mod_targo_koop_id', $_REQUEST['wpsg_mod_targo_koop_id']);
+			$this->shop->update_option('wpsg_mod_targo_dealerid', $_REQUEST['wpsg_mod_targo_dealerid']);
+			$this->shop->update_option('wpsg_mod_targo_hashkey', $_REQUEST['wpsg_mod_targo_hashkey']);
+		
+			$this->shop->update_option('wpsg_mod_targo_bezeichnung', $_REQUEST['wpsg_mod_targo_bezeichnung']);
+			$this->shop->update_option('wpsg_mod_targo_hint', $_REQUEST['wpsg_mod_targo_hint']);
+			$this->shop->update_option('wpsg_mod_targo_createwebhook', $_REQUEST['wpsg_mod_targo_createwebhook']);
+			$this->shop->update_option('wpsg_mod_targo_gebuehr', $_REQUEST['wpsg_mod_targo_gebuehr']);
+			$this->shop->update_option('wpsg_mod_targo_mwst', $_REQUEST['wpsg_mod_targo_mwst']);
+			$this->shop->update_option('wpsg_mod_targo_mwstland', $_REQUEST['wpsg_mod_targo_mwstland']);
+			
+			$this->shop->createPage(__('Erfolgreiche Targo Finanzierung', 'wpsg'), 'wpsg_mod_targo_success', $_REQUEST['wpsg_mod_targo_success']);
+			$this->shop->createPage(__('Fehlgeschlagene Targo Finanzierung', 'wpsg'), 'wpsg_mod_targo_error', $_REQUEST['wpsg_mod_targo_error']);
+			
+		} // public function settings_save()
+				
+		public function order_ajax()
+		{
+				
+			if (wpsg_isSizedString($_REQUEST['do'], 'refresh'))
+			{
+		
+				$state = $this->getPaymentState($_REQUEST['edit_id']);
+		
+				$this->shop->addBackendMessage(wpsg_translate(__('Status der Zahlung (#1#) erfolgreich abgefragt.', 'wpsg'), $state));
+		
+				$this->shop->redirect(WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Order&action=view&edit_id='.$_REQUEST['edit_id']);
+		
+			}
+				
+		} // public function order_ajax()
+		
+		public function checkGeneralBackendError()
+		{
+		//TODO
+			if ($this->shop->get_option('wpsg_mod_targo_mode') == '1')
+			{
+				
+				if (!wpsg_isSizedString($this->shop->get_option('wpsg_mod_targo_clientid')) && !wpsg_isSizedString($this->shop->get_option('wpsg_mod_targo_secret')))
+				{
+					
+					$this->shop->addBackendError('nohspc_'.wpsg_translate(
+						wpsg_translate(
+							__('Das Modul "Targo" ist aktiviert und es wurden keine API Zugangsdatenhinterlegt. Gehen Sie in die <a href="#1#">Einstellungen</a> des Moduls um die API Daten zu hinterlegen.', 'wpsg'),
+							WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&action=module&modul=wpsg_mod_targo'
+						)
+					));
+					
+				}
+				
+			}
+			
+		} // public function checkGeneralBackendError()
+		
+		public function addPayment(&$arPayment) 
+		{ 
+			
+			$this->shop->arStatus[self::STATUS_CREDIT_ACCEPTED] = __('Kreditvertrag angenommen', 'wpsg');
+			
+			if (!is_admin() && $this->shop->get_option('wpsg_mod_targo_aktiv') != '1') return;
+
+			$arBasket = $this->shop->basket->toArray();
+				
+			// Bestellungen auÃerhalb der Targo-Bestimmungen geben nix aus
+			$gesamt = $arBasket['sum']['preis_gesamt_brutto'];
+			$min = $this->shop->get_option('wpsg_mod_targo_summe_min');
+			$max = $this->shop->get_option('wpsg_mod_targo_summe_max');
+			if (($gesamt <= $min) || ($gesamt >= $max)) return;
+				
+			$mwst_value = $this->getTaxValue($this->shop->get_option('wpsg_mod_targo_mwst'), $this->shop->getDefaultCountry());
+					
+			// Array umsortieren Targo als erstes
+			// bei Land != DE Targobank ausblenden
+			$land = $arBasket['land']['kuerzel'];
+			if ($land == "DE")
+			{
+			
+				$arPaymentTB[$this->id] = array(
+						'id' => $this->id,
+						'name' => __($this->shop->get_option('wpsg_mod_targo_bezeichnung'), 'wpsg'),
+						'preis' => $this->shop->get_option('wpsg_mod_targo_gebuehr'),
+						'mwst' => $this->shop->get_option('wpsg_mod_targo_mwst'),
+						'mwst_value' => $mwst_value,
+						'mwst_null' => $this->shop->get_option('wpsg_mod_targo_mwstland'),
+						'hint' => __($this->shop->get_option('wpsg_mod_targo_hint')),
+						'logo' => $this->shop->getRessourceURL('gfx/targologo.png')
+				);
+				$arPayment = wpsg_array_merge($arPaymentTB, $arPayment);
+				
+			}
+			/*
+			$arPayment[$this->id] = array(
+				'id' => $this->id,
+ 				'name' => __($this->shop->get_option('wpsg_mod_targo_bezeichnung'), 'wpsg'),
+				'preis' => $this->shop->get_option('wpsg_mod_targo_gebuehr'),
+				'mwst' => $this->shop->get_option('wpsg_mod_targo_mwst'),
+				'mwst_value' => $mwst_value,
+				'mwst_null' => $this->shop->get_option('wpsg_mod_targo_mwstland'),
+				'hint' => __($this->shop->get_option('wpsg_mod_targo_hint')),
+				'logo' => $this->shop->getRessourceURL('gfx/targologo.png')
+			);
+			*/
+			if (isset($_REQUEST['wpsg_checkout2']) || ($this->shop->hasMod('wpsg_mod_onepagecheckout') && isset($_REQUEST['wpsg_checkout'])))
+			{
+
+				if ($this->shop->get_option('wpsg_preisangaben') == WPSG_NETTO || $arBasket['noMwSt'])
+				{
+						
+					$payment_netto = $this->getPreis($this->shop->get_option('wpsg_mod_targo_gebuehr'), $arBasket['sum']['preis']);
+					$payment_brutto = wpsg_calculatePreis($payment_netto, WPSG_BRUTTO, $mwst_value);
+						
+				}
+				else
+				{
+												
+					$payment_brutto = $this->getPreis($this->shop->get_option('wpsg_mod_targo_gebuehr'), $arBasket['sum']['preis']);																								
+					$payment_netto = wpsg_calculatePreis($payment_brutto, WPSG_NETTO, $mwst_value);						
+						
+				}
+				
+				// Entsprechenden Preis anzeigen
+				if ($this->shop->getFrontendTaxview() == WPSG_NETTO)
+				{
+					
+					$arPayment[$this->id]['price'] = $payment_netto;
+					
+				}
+				else 
+				{
+					
+					$arPayment[$this->id]['price'] = $payment_brutto;
+					
+				}
+				
+			}
+			
+		} // public function addPayment(&$arPayment)
+		
+		public function calcPayment(&$arBasket) 
+		{ 
+			
+			if ($arBasket['checkout']['payment'] == $this->id)
+			{
+			 
+				$payment_price = $this->getPreis($this->shop->get_option('wpsg_mod_targo_gebuehr'), $arBasket['sum']['preis']);
+				
+				if ($this->shop->get_option('wpsg_mod_targo_mwstland') == '1' && $arBasket['noMwSt'])
+				{
+					
+					// Keine MwSt. berechnen !
+					$arBasket['sum']['preis_payment'] = $payment_price;
+					$arBasket['sum']['preis_payment_brutto'] = $payment_price;
+					$arBasket['sum']['preis_payment_netto'] = $payment_price;
+					
+					$arBasket['payment']['mwst'] = 0;
+					$this->shop->arPayment[$arBasket['checkout']['payment']]['mwst_value'] = 0;
+						
+					$arBasket['payment']['tax_rata'] = false;
+					
+				}
+				else
+				{
+					
+					// MwSt berechnen (Angaben im Backend sind immer Brutto)
+					$this->setPaymentKosten($arBasket, $payment_price, $this->shop->get_option('wpsg_mod_targo_mwst'));
+
+				}
+								
+			}
+			
+		} // public function calcPayment(&$arBasket) 
+		
+		public function setOrderStatus($order_id, $status_id, $inform)
+		{
+		//TODO
+			$oOrder = wpsg_order::getInstance($order_id);
+				
+			if ($oOrder->getPaymentID() == $this->id)
+			{
+		
+				$arStornoState = (array)$this->shop->get_option('wpsg_mod_paypal_stornostate');
+					
+				if (array_key_exists($status_id, $arStornoState) && $arStornoState[$status_id] == '1')
+				{
+						
+					if (wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypal_saleid')))
+					{
+							
+						$bStorno = $this->stornoOrder($order_id);
+		
+						if ($bStorno === true) $this->shop->addBackendMessage(__('Zahlung erfolgreich ÃŒber die PayPal API storniert.', 'wpsg'));
+						else $this->shop->addBackendError(__('Es gab ein Problem bei der Stornierung der Zahlung ÃŒber die PayPal API. Bitte Bestellprotokoll beachten.', 'wpsg'));
+		
+					}
+						
+				}
+		
+			}
+		
+		}
+		
+		public function order_view_afterpayment(&$order_id)
+		{
+		
+			$this->shop->render(WPSG_PATH_VIEW.'/mods/mod_targo/order_view_afterpayment.phtml');
+		
+		} // public function order_view_sidebar(&$order_id)
+		
+		public function order_done(&$order_id, &$done_view) 
+		{ 
+ 
+			// Bestellungen mit 0 geben nix aus
+			if ($done_view['basket']['sum']['preis_gesamt_brutto'] <= 0 || $this->shop->view['basket']['checkout']['payment'] != $this->id) return;
+			
+			$oOrder = wpsg_order::getInstance($order_id);
+			//KundenID: echo $oOrder->k_id;
+				
+			$this->shop->view['targoLink'] = $this->getTargoLink($order_id);
+			$this->shop->view['o_id'] = $order_id;
+			$kid = $oOrder->k_id;
+			$this->shop->view['k_id'] = $oOrder->k_id;
+			
+			echo $this->shop->render(WPSG_PATH_VIEW.'/mods/mod_targo/order_done.phtml', false);
+						
+		} // public function order_done(&$order_id)
+
+		public function wp_loaded() { 
+			
+			if (wpsg_isSizedString($_REQUEST['wpsg_plugin'], 'wpsg_mod_targo') && wpsg_isSizedString($_REQUEST['confirm'], 'pp'))			
+			{
+			//TODO
+				$this->shop->checkEscape();
+				
+				// IPN Zahlungsbenachrichtigung
+				$req = 'cmd=_notify-validate';
+				
+				foreach ($_POST as $key => $value)
+				{ 
+					 			
+					$req .= "&".$key."=".urlencode($value);
+					
+				}
+
+				$header = "";
+				$header .= "POST /cgi-bin/webscr HTTP/1.1\r\n";
+				$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
+								
+				if ($this->shop->get_option('wpsg_mod_paypal_sandbox') == 1)
+				{
+					
+					$header .= "Host: www.sandbox.paypal.com\r\n";
+					$fp = fsockopen ('tls://www.sandbox.paypal.com', 443, $errno, $errstr, 30);
+					
+				}
+				else	
+				{	
+							
+					$header .= "Host: www.paypal.com\r\n";
+					$fp = fsockopen ('tls://www.paypal.com', 443, $errno, $errstr, 30);
+					
+				}
+ 
+				$header .= "Connection: Close\r\n";
+				$header .= "Content-Length: ".strlen($req)."\r\n\r\n";
+				
+				if (!$fp) 
+				{
+					
+					
+					
+				} 
+				else 
+				{
+												
+					fputs ($fp, $header.$req);
+					
+					while (!feof($fp)) 
+					{
+						
+						$res = fgets ($fp, 1024);
+						
+						if (strcmp(trim($res), "VERIFIED") == 0) 
+						{
+							
+							if (strtolower($_REQUEST['payment_status']) == "completed")
+							{
+								
+								// Wir haben hier nicht wpsg_hspc (htmlspecialchars) verwendet da es ein Problem mit seltsammen (Steuerzeichen?) gab
+								// Wenn mann sich den Request so angeschaut hat war alles in Ordnung konnte mit gleichen Daten auch nicht nachgestellt werden
+								// Problem trat nur bei den Requests von PayPal auf.
+								// Nicht zentral gelÃ¶st, da im Manual ein Hinweis auf ein mÃ¶gliches Sicherheitsproblem existiert
+								
+								$this->db->ImportQuery(WPSG_TBL_OL, array(
+									"title" => __("PayPal VERIFIED", "wpsg"),
+									"cdate" => "NOW()",
+									"o_id" => wpsg_q($_REQUEST['custom']),
+									"mailtext" => wpsg_q(htmlentities(print_r($_REQUEST, 1), ENT_IGNORE))
+								));
+							
+								if ($this->shop->setPayMent($_REQUEST['custom'], $_REQUEST['mc_gross']))
+								{
+									
+									$this->shop->setOrderStatus($_REQUEST['custom'], 100, true);
+									
+								}
+															
+							}
+							
+						}
+						else if (strcmp(trim($res), "INVALID") == 0) 
+						{
+
+							$this->db->ImportQuery(WPSG_TBL_OL, array(
+								"title" => __("Targo FAILED", "wpsg"),
+								"cdate" => "NOW()",
+								"o_id" => wpsg_q($_REQUEST['custom']),
+								"mailtext" => wpsg_q(wpsg_hspc(print_r($_REQUEST, 1)))
+							));
+										
+						}
+						
+					}
+					
+					fclose($fp);
+				
+				}
+				
+				die();
+					
+			}
+			
+		} // public function wp_loaded()
+		
+		public function mail_payment() 
+		{ 
+
+			if ($this->shop->view['basket']['checkout']['payment'] != $this->id) return;			
+			
+			if ($this->shop->htmlMail === true)
+			{
+				
+				echo '<a href="'.$this->shop->getDoneURL($this->shop->view['o_id']).'">'.__('Zahlungslink', 'wpsg').'</a>'.__(', um die Zahlung durchzufÃŒhren', 'wpsg');
+				
+			}
+			else
+			{
+			
+				echo wpsg_pad_right(__('Zahlungslink', 'wpsg').':', 35).$this->shop->getDoneURL($this->shop->view['o_id']);
+				
+			}
+			
+		} // public function mail_payment()
+		
+		/* Modulfunktionen */
+		
+		/* Classic API */
+		
+		/**
+		 * Gibt den Link fÃŒr die Bezahlung per Targo anhand der BestellID zurÃŒck
+		 */
+		public function getTargoLink($order_id)
+		{
+
+			return	$wh_url = $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_targo', 'dealerText', array('order_id' => $order_id, 'wert' => $order_id), false);
+		
+		} // public function getTargoLink($order_id)
+		
+		
+		/**
+		 * Startet die Zahlungsabwicklung ÃŒber PayPal mittels der API
+		 */
+		public function startPayPalPaymentRedirect()
+		{
+				
+			if (!wpsg_isSizedInt($_REQUEST['order_id'])) $this->shop->throwErrorCode('2_1');
+				
+			$oOrder = wpsg_order::getInstance($_REQUEST['order_id']);
+			$paymentId = $oOrder->getMeta('wpsg_mod_paypal_paymentid');
+				
+			if (wpsg_isSizedString($paymentId))
+			{
+		
+				try
+				{
+		
+					$payment = \PayPal\Api\Payment::get($oOrder->getMeta('wpsg_mod_paypal_paymentid'), $this->getApiContext());
+					$approvalLink = $payment->getApprovalLink();
+						
+					if (!wpsg_isSizedString($approvalLink))
+					{
+		
+						$oOrder->log(__('PayPal Fehler: Zahlung konnte nicht erneut ausgefÃŒhrt werden', 'wpsg'), 'PaymentStatus: '.$payment->getState());
+						$this->shop->redirect($this->shop->getDoneURL($oOrder->id));
+		
+					}
+					else
+					{
+							
+						$this->shop->redirect($payment->getApprovalLink());
+		
+					}
+						
+				}
+				catch (Exception $ex)
+				{
+		
+					$data = json_decode($ex->getData(), true);
+						
+					ob_start();
+					var_dump($ex);
+					$dump = ob_get_contents();
+					ob_end_clean();
+						
+					$oOrder->log(wpsg_translate(__('PayPal Fehler: #1#', 'wpsg'), $data['message']), print_r($data, 1)."\r\n".$dump);
+						
+					$this->shop->addFrontendError(__('PayPal Fehler, bitte Shop Betreiber kontaktieren.', 'wpsg'));
+					$this->shop->redirect(get_permalink($this->shop->get_option('wpsg_page_mod_paypal_error')));
+						
+				}
+		
+			}
+				
+			if ($this->id != $oOrder->getPaymentID()) $this->shop->throwErrorCode('2_2');
+			//TODO
+			$payer = new \PayPal\Api\Payer();
+			$payer->setPaymentMethod("paypal");
+				
+			$billing_address = new \PayPal\Api\Address();
+			$billing_address->setCity($oOrder->getInvoiceCity());
+			$billing_address->setPostalCode($oOrder->getInvoiceZip());
+			$billing_address->setLine1($oOrder->getInvoiceStreet());
+			$billing_address->setCountryCode($oOrder->getInvoiceCountryKuerzel());
+		
+			$shipping_address = new \PayPal\Api\Address();
+			$shipping_address->setCity($oOrder->getShippingCity());
+			$shipping_address->setPostalCode($oOrder->getShippingZip());
+			$shipping_address->setLine1($oOrder->getShippingStreet());
+			$shipping_address->setCountryCode($oOrder->getShippingCountryKuerzel());
+		
+			$payer_info = new \PayPal\Api\PayerInfo();
+			$payer_info->setFirstName($oOrder->getInvoiceFirstName());
+			$payer_info->setLastName($oOrder->getInvoiceName());
+			$payer_info->setBillingAddress($billing_address);
+			//$payer_info->setShippingAddress($shipping_address);
+		
+			$payer->setPayerInfo($payer_info);
+				
+				
+			$amount = new \PayPal\Api\Amount();
+			$amount->setCurrency($this->shop->get_option('wpsg_mod_paypal_currency'));
+			$amount->setTotal($oOrder->getAmount(WPSG_BRUTTO));
+			//$amount->setDetails($details);
+				
+			$transaction = new \PayPal\Api\Transaction();
+			$transaction->setAmount($amount);
+			//$transaction->setItemList($itemList);
+			$transaction->setDescription($this->shop->replaceUniversalPlatzhalter(__($this->shop->get_option('wpsg_mod_paypal_subject'), 'wpsg'), $oOrder->id));
+			$transaction->setInvoiceNumber($oOrder->id);
+				
+			$redirectUrls = new \PayPal\Api\RedirectUrls();
+			$redirectUrls->setReturnUrl($this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_paypal', 'executePayment'));
+			$redirectUrls->setCancelUrl(get_permalink($this->shop->get_option('wpsg_page_mod_paypal_error')));
+				
+			$payment = new \PayPal\Api\Payment();
+			$payment->setIntent("sale");
+			$payment->setPayer($payer);
+			$payment->setRedirectUrls($redirectUrls);
+			$payment->setTransactions(array($transaction));
+				
+			try
+			{
+					
+				$response = $payment->create($this->getApiContext());
+		
+				$oOrder->setMeta('wpsg_mod_paypal_paymentid', $response->getId());
+		
+			}
+			catch (Exception $ex)
+			{
+					
+				$data = json_decode($ex->getData(), true);
+		
+				ob_start();
+				var_dump($ex);
+				$dump = ob_get_contents();
+				ob_end_clean();
+		
+				$oOrder->log(wpsg_translate(__('PayPal Fehler: #1#', 'wpsg'), $data['message']), print_r($data, 1)."\r\n".$dump);
+		
+				$this->shop->addFrontendError(__('PayPal Fehler, bitte Shop Betreiber kontaktieren.', 'wpsg'));
+				$this->shop->redirect($this->shop->getDoneURL($oOrder->id));
+		
+			}
+				
+			$this->getPaymentState($oOrder->id);
+				
+			$this->shop->redirect($payment->getApprovalLink());
+		
+		} // public function startPayPalPaymentRedirect()
+		
+		/**
+		 * FÃŒhrt eine Zahlung aus wird von startPayPalPaymentRedirect aufgerufen
+		 */
+		public function executePaymentRedirect()
+		{
+		
+			$payment = \PayPal\Api\Payment::get($_REQUEST['paymentId'], $this->getApiContext());
+		
+			$execution = new \PayPal\Api\PaymentExecution();
+			$execution->setPayerId($_REQUEST['PayerID']);
+		
+			try
+			{
+		
+				$result = $payment->execute($execution, $this->getApiContext());
+		
+			}
+			catch (Exception $ex)
+			{
+					
+				$this->shop->redirect(get_permalink($this->shop->get_option('wpsg_mod_targo_error')));
+					
+			}
+		
+			$this->shop->redirect(get_permalink($this->shop->get_option('wpsg_mod_targo_success')));
+				
+		} // public fucntion executePaymentRedirect()
+		
+		private function getPaymentState($order_id)
+		{
+			//TODO
+			$oOrder = wpsg_order::getInstance($order_id);
+				
+			if (!wpsg_isSizedString($oOrder->getMeta('wpsg_mod_paypal_paymentid'))) return false;
+				
+			try
+			{
+					
+				$payment = \PayPal\Api\Payment::get($oOrder->getMeta('wpsg_mod_paypal_paymentid'), $this->getApiContext());
+					
+				$oOrder->setMeta('wpsg_mod_paypal_paymentstate', $payment->getState());
+		
+				return $payment->getState();
+		
+			}
+			catch (Exception $e)
+			{
+		
+				return false;
+					
+			}
+				
+		}
+		
+		
+		/**
+		 * Wird optional beim speichern ausgelÃ¶st, versucht den WebHook anzulegen und setzt die BackendMeldungen
+		 */
+		private function createWebHook()
+		{
+		
+			$create_webhook = false;
+			$wh_url = $this->shop->getUrl(wpsg_ShopController::URL_BASKET, 'wpsg_mod_targoapi', 'webHook', array(), true);
+				
+			$arWH = $this->api_getWebHooks();
+				
+			if (wpsg_isSizedArray($arWH))
+			{
+		
+				foreach ($arWH as $wh)
+				{
+		
+					if ($wh['url'] === $wh_url)
+					{
+		
+						$nExists = true;
+						break;
+		
+					}
+		
+				}
+		
+				if ($nExists === false) $create_webhook = true;
+				else
+				{
+		
+					$this->shop->addBackendError(__('WebHook ist bereits registriert.', 'wpsg'));
+		
+				}
+		
+			}
+			else $create_webhook = true;
+				
+			if ($create_webhook === true)
+			{
+		
+				$bOK = $this->api_createWebHook($wh_url);
+		
+				if ($bOK === true) $this->shop->addBackendMessage(__('WebHook erfolgreich angelegt.', 'wpsg'));
+				else $this->shop->addBackendError(__('WebHook konnte nicht angelegt werden.', 'wpsg'));
+		
+			}
+		
+		} // private function createWebHook();
+					
+		public function dealerTextRedirect()
+		{
+			//die("dealerTextRedirekt");
+/*
+			$empfaenger = "hartmut@maennchen1.de";
+			$betreff = "Mail-Funktion";
+			$from = "From: Name <hartmut@maennchen1.de>\n";
+			$from .= "Reply-To: hartmut@maennchen1.de\n";
+			$from .= "Content-Type: text/html\n";
+			$text = "Mail von dealerTextRedirect:_  ".print_r($_REQUEST, 1);
+			
+			mail($empfaenger, $betreff, $text, $from);
+*/						
+			//$url = "https://onlineapplication.uat.targobank.de/microsites/statustool/interface/request.asp" 
+			
+		} // public function webHookRedirect()
+		
+		private function stornoOrder($order_id)
+		{
+			//TODO	
+			$oOrder = wpsg_order::getInstance($order_id);
+			if ($oOrder === false) $this->shop->throwErrorCode('2_3');
+				
+			$sale_id = $oOrder->getMeta('wpsg_mod_targo_saleid');
+		
+			$amount = new \PayPal\Api\Amount();
+			$amount->setCurrency($this->shop->get_option('wpsg_mod_paypal_currency'));
+			$amount->setTotal($oOrder->getAmount(WPSG_BRUTTO));
+				
+			$refund = new \PayPal\Api\Refund();
+			$refund->setAmount($amount);
+				
+			$sale = new \PayPal\Api\Sale();
+			$sale->setId($sale_id);
+				
+			try
+			{
+						 
+				$refundedSale = $sale->refund($refund, $this->getApiContext());
+				
+				$oOrder->setMeta('wpsg_mod_paypal_saleid', null);
+				$oOrder->setMeta('wpsg_mod_paypal_paymentid', null);
+				
+				return true;
+		
+			}
+			catch (Exception $ex)
+			{
+		
+				$oOrder->log(wpsg_translate(__('Targo Fehler: #1#', 'wpsg'), $ex->getMessage()));
+				return false;
+		
+			}
+				
+		} // public function stornoOrder($order_id)
+		
+		/**
+		 * Gibt den API Context fÃŒr alle API Anfragen zurÃŒck
+		 */
+		private function getApiContext()
+		{
+			//TODO
+			if ($this->apiContext === false)
+			{
+		
+				$this->apiContext = new \PayPal\Rest\ApiContext(new PayPal\Auth\OAuthTokenCredential(
+					$this->shop->get_option('wpsg_mod_paypal_clientid'),
+					$this->shop->get_option('wpsg_mod_paypal_secret')
+				));
+		
+				if (!$this->isSandbox())
+				{
+						
+					$this->apiContext->setConfig(array(
+						'mode' => 'live'
+					));
+						
+				}
+		
+			}
+				
+			return $this->apiContext;
+				
+		} // public function getApiContext()
+		
+		
+		/**
+		 * Autoloader fÃŒr die Targo Klassen
+		 */
+		function spl_autoload($class)
+		{
+				
+			if (substr($class, 0, 6) == "Targo\\" || substr($class, 0, 4) == "Psr\\")
+			{
+					
+				$path = WPSG_PATH_LIB.str_replace("\\", DIRECTORY_SEPARATOR, $class).'.php';
+		
+				if (file_exists($path)) require_once($path);
+					
+			}
+							
+		} // function spl_autoload($class)
+		
+	} // class wpsg_mod_targo extends wpsg_mod_basic
+
+?>
Index: /system/conf.php
===================================================================
--- /system/conf.php	(revision 5867)
+++ /system/conf.php	(revision 5873)
@@ -6,4 +6,6 @@
 	$arExclude = array(
 		"mod_keygen", "wpsg_mod_keygen.class.php",
+		"mod_addressvalidation", "wpsg_mod_addressvalidation.class.php",
+		"mod_creditcard", "wpsg_mod_creditcard.class.php",
 		"mod_paypalapi", "wpsg_mod_paypalapi.class.php",
 		"mod_amazon", "wpsg_mod_amazon.class.php", "wpsg_mod_amazon",	
@@ -33,4 +35,5 @@
 		"mod_voucherproduct", "wpsg_mod_voucherproduct.class.php",
 		"mod_klarna", "wpsg_mod_klarna.class.php",
+		"mod_si", "wpsg_mod_si.class.php", "wpsg_mod_si",
 		"mod_test", "wpsg_mod_test.class.php",
 		"mod_haendlerbund", "wpsg_mod_haendlerbund.class.php",
@@ -54,5 +57,5 @@
 		'mod_customergroup', 'wpsg_mod_customergroup.class.php', 'wpsg_mod_customergroup',
 		"mod_rechnungen", "wpsg_mod_rechnungen.class.php",
-		"kex.txt"
+		"key.txt"
 	);
 	
Index: /views/admin/customerpreset.phtml
===================================================================
--- /views/admin/customerpreset.phtml	(revision 5873)
+++ /views/admin/customerpreset.phtml	(revision 5873)
@@ -0,0 +1,43 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Kundenvoreinstellungen im Backend
+	 */
+
+?>
+<div class="wpsg_admin_submenu">
+	
+	<div class="head">
+		<div class="title"><?php echo __("Einstellungen", "wpsg"); ?></div>			
+		<div style="clear:both;"></div>
+	</div>
+
+	<ul>		
+		<?php foreach ($this->view['arSubAction'] as $k => $v) { ?>		
+		<li class="<?php echo (($k == $this->view['subAction'])?'current':''); ?>"><a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;subaction=<?php echo $k; ?>"><?php echo $v['Menutext']; ?></a></li>
+		<?php } ?>
+	</ul>
+			
+</div>
+
+<div class="wpsg_admin_content">
+	
+	<form name="form1" method="post" enctype="multipart/form-data" action="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Admin&amp;noheader=1&amp;subaction=<?php echo $_REQUEST['subaction']; ?>">
+
+		<?php echo wpsg_drawForm_Select('wpsg_customerpreset_shipping', __('Standard Versandart', 'wpsg'), $this->view['arShipping'], $this->get_option('wpsg_customerpreset_shipping'), array('help' => 'wpsg_customerpreset_shipping')); ?>
+		<?php echo wpsg_drawForm_Select('wpsg_customerpreset_payment', __('Standard Zahlungsart', 'wpsg'), $this->view['arPayment'], $this->get_option('wpsg_customerpreset_payment'), array('help' => 'wpsg_customerpreset_payment')); ?>
+		<?php echo wpsg_drawForm_Select('wpsg_defaultland', __('Standardland', 'wpsg'), $this->view['arLander'], $this->get_option('wpsg_defaultland'), array('help' => 'wpsg_defaultland', 'hint' => 
+			'nohspc_'.wpsg_translate(__('Die LÃ€nder kÃ¶nnen in der <a href="#1#">LÃ€nderverwaltung</a> definiert werden.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=laender')		
+		)); ?>
+		<?php echo wpsg_drawForm_Select('wpsg_customerpreset_title', __('Standardanrede', 'wpsg'), $this->view['arTitle'], $this->get_option('wpsg_customerpreset_title'), array( 'help' => 'wpsg_customerpreset_title',
+			'hint' => 'nohspc_'.wpsg_translate(__('Die Auswahl kann in den <a href="#1#">Kundendaten</a> definiert werden.', 'wpsg'), WPSG_URL_WP.'wp-admin/admin.php?page=wpsg-Admin&subaction=kundendaten'),
+			'noIndex' => true 
+		)); ?>
+		
+		<br />
+				
+		<input class="button-primary" type="submit" name="wpsg-submit" value="<?php echo __('Speichern', 'wpsg'); ?>" />
+	
+	</form>
+	
+</div>
Index: /views/mods/mod_addressvalidation/addressvalidation.js
===================================================================
--- /views/mods/mod_addressvalidation/addressvalidation.js	(revision 5873)
+++ /views/mods/mod_addressvalidation/addressvalidation.js	(revision 5873)
@@ -0,0 +1,82 @@
+/**
+ * Globale Funktionen zur Adressvalidation
+ */
+
+function validateAddressBind(data) {
+	jQuery(data.PLZ).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Ort).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Strasse).on("input", function () {
+		validateAddress(data);
+	});
+	jQuery(data.Land).on("input", function () {
+		validateAddress(data);
+	});
+}
+
+// Adress-Validation
+function validateAddress(data) {
+	var
+		plz,
+		ort,
+		strasse,
+		astr1,
+		land = 'de',
+		rw;
+	plz = jQuery(data.PLZ).val();
+	ort = jQuery(data.Ort).val();
+	strasse = jQuery(data.Strasse).val();
+	nr = jQuery(data.Nr).val();
+	if (nr !== undefined) {
+		strasse = strasse + ' ' + nr;
+	}
+	land = jQuery(data.Land + ' option:selected').val();
+	land = jQuery(data.Land + ' option:selected').attr('data-land');
+
+	astr1 = localStorage.getItem(data.StorageKey);
+	if ((plz.length > 3) && (ort.length > 3) && (strasse.length > 3) &&
+		(astr1 != (strasse + plz + ort + land))) 
+	{
+
+		astr1 = strasse + plz + ort + land;
+		localStorage.setItem(data.StorageKey, astr1);
+	    jQuery.ajax({
+	        url: 'http://api.address-validator.net/api/verify',
+	        type: 'POST',
+	        data: { StreetAddress: strasse,
+	                City: ort,
+	                PostalCode: plz,
+	                //State: State,
+	                CountryCode: land,
+	                //Locale: land,
+	                APIKey: data.Key},
+	        dataType: 'json',
+	        success: function (json) {
+	            // check API result
+	            if (typeof(json.status) != "undefined") {
+	                status = json.status;
+	                formattedaddress = json.formattedaddress;
+	                if (json.status === 'VALID') {
+
+
+	                } else if ((json.status === 'INVALID') || (json.status === 'SUSPECT')) {
+
+	                	alert(data.MsgTeil1 + '-Validation fehlerhaft. Bitte StraÃe, Hausnummer, PLZ, Ort und Land ÃŒberprÃŒfen.');
+		                
+	                } else {
+
+						alert('Adress-Validation Serverproblem: ' + json.status);
+						
+	                }
+	            }
+
+	        }
+	    });
+		
+	}
+
+}
+
Index: /views/mods/mod_addressvalidation/settings_edit.phtml
===================================================================
--- /views/mods/mod_addressvalidation/settings_edit.phtml	(revision 5873)
+++ /views/mods/mod_addressvalidation/settings_edit.phtml	(revision 5873)
@@ -0,0 +1,12 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Einstellungen des Moduls "Adressvalidation"
+	 */
+
+?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_addressvalidation_apikey', __('API-Key', 'wpsg'), $this->get_option('wpsg_mod_addressvalidation_apikey'), array('help' => 'wpsg_mod_addressvalidation_apikey')); ?>
+
+<a class="button-primary" id="button-google" target="popup" href="http://www.address-validator.net/address-online-verification-api.html" onclick="window.open('', 'popup', 'width=500;height=200,resizable=yes,menubar=yes')">
+	<?php echo __('SchlÃŒssel anfordern', 'wpsg'); ?>
+</a>
Index: /views/mods/mod_creditcard/settings_edit.phtml
===================================================================
--- /views/mods/mod_creditcard/settings_edit.phtml	(revision 5867)
+++ /views/mods/mod_creditcard/settings_edit.phtml	(revision 5873)
@@ -15,3 +15,3 @@
 <?php echo wpsg_drawForm_Checkbox('wpsg_mod_creditcard_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_creditcard_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
 <?php echo wpsg_drawForm_Checkbox('wpsg_mod_creditcard_iban', __('IBAN/BIC statt Kontonummer/BLZ verwenden', 'wpsg'), $this->get_option('wpsg_mod_creditcard_iban'), array('help' => 'wpsg_mod_creditcard_iban')); ?>
-<?php echo wpsg_drawForm_Input('wpsg_mod_creditcard_schluessel', __('Schluessel', 'wpsg'), $this->get_option('wpsg_mod_creditcard_schluessel'), array('help' => 'wpsg_shippay_name')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_creditcard_schluessel', __('AES-256 Passwort', 'wpsg'), $this->get_option('wpsg_mod_creditcard_schluessel'), array('help' => 'wpsg_mod_creditcard_schluessel')); ?>
Index: /views/mods/mod_targo/order_done.phtml
===================================================================
--- /views/mods/mod_targo/order_done.phtml	(revision 5873)
+++ /views/mods/mod_targo/order_done.phtml	(revision 5873)
@@ -0,0 +1,91 @@
+<?php
+
+/**
+ * Dieses Template wird nach einer Targo Zahlung angezeigt
+*/
+
+$url = $this->get_option('wpsg_mod_targo_url');
+?>
+
+<p><?php echo __('Um den Betrag mit Targo zu bezahlen klicken Sie bitte auf folgendes Logo.', 'wpsg'); ?></p> 
+<p>
+	<a title="<?php echo __('Mit Targo bezahlen', 'wpsg'); ?>" href="<?php echo $this->get_option('wpsg_mod_targo_url'); ?>">
+		<img src="<?php echo $this->getRessourceURL('gfx/targologo.png'); ?>" align="left" alt="<?php echo __('Mit Targo bezahlen', 'wpsg'); ?>" style="margin-right:7px;">
+	 
+	</a>
+</p>
+
+<form hidden class="wpsg_productform" id="wpsg_produktform" method="post" action="<?php echo $this->get_option('wpsg_mod_targo_url'); ?>">
+<?php $o_id = $this->view['o_id'];
+	  $k_id = $this->view['k_id'];
+	  $oOrder = wpsg_order::getInstance($o_id);
+	  $brutto = $oOrder->getAmount(WPSG_BRUTTO);
+	  $brutto = wpsg_round($brutto, 2);
+	  /** @var wpsg_customer */
+	  $oCustomer = wpsg_customer::getInstance($k_id);
+	  /*
+	  $geb1 = $oCustomer->getBirthdate("Y-m-d");
+	  $geb2 = $oCustomer->getBirthdate();
+	  $geb3 = $oCustomer->data["geb"];
+	  $geb4 = wpsg_date("Y-m-d", strtotime($geb3));
+	  $geb5 = strtotime($geb3);
+	  $geb6 = strtotime("0000-00-00");
+	  $geb6 = strtotime("1901-12-13");
+	  $geb6 = strtotime("1901-12-14");
+	  */ 
+	  $dl = $this->view['targoLink'];
+	  
+	  $street = $oOrder-> getInvoiceStreetClear(true);
+	  $nr = $oOrder-> getInvoiceStreetNr();
+	  
+	   
+?>
+<?php ?>
+<?php ?>
+
+<br /><br />
+<b>Obligatorische Daten fÃŒr Targobank</b><br />
+<input type="text" id="koop_id" name="koop_id" value="<?php echo $this->get_option('wpsg_mod_targo_koop_id');?>" placeholder="koop_id"><br />
+<input type="text" id="SessionID" name="sessionID" value="<?php echo session_id();?>" placeholder="sessionID"><br />
+<input type="text" id="amount" name="amount" value="<?php echo $brutto;?>" placeholder="amount"><br />
+<input type="text" id="dealerID" name="dealerID" value="<?php echo $this->get_option('wpsg_mod_targo_dealerid');?>" placeholder="dealerID"><br />
+<input type="text" id="dealerText" name="dealerText" value="<?php echo $this->view['targoLink'];?>" placeholder="dealerText"><br />
+<input type="text" id="documentno" name="documentno" value="" placeholder="documentno"><br />
+
+
+<b>Optionale Daten fÃŒr Targobank</b><br />
+<input type="text" id="dealerShopURL" name="dealerShopURL" value="" placeholder="dealerShopURL"><br />
+<input type="text" id="dealerAbortURL" name="dealerAbortURL" value="" placeholder="dealerAbortURL"><br />
+<input type="text" id="hash" name="hash" value="" placeholder="hash">(hashkey)<br />
+<input type="text" id="" name="" value="" placeholder=""><br />
+
+
+<b>Adressdaten aus Kundendaten</b><br />
+<input type="text" id="surname" name="surname" value="<?php echo $oCustomer->getName();?>" placeholder="surname"><br />
+<input type="text" id="firstname" name="firstname" value="<?php echo $oCustomer->getFirstname();?>" placeholder="firstname"><br />
+<input type="text" id="street" name="street" value="<?php echo $oOrder->getInvoiceStreetClear(true);?>" placeholder="street"><br />
+<input type="text" id="streetnumber" name="streetnumber" value="<?php echo $oOrder->getInvoiceStreetNr();?>" placeholder="streetnumber"><br />
+<input type="text" id="zip" name="zip" value="<?php echo $oCustomer->getZip();?>" placeholder="zip"><br />
+<input type="text" id="city" name="city" value="<?php echo $oCustomer->getCity();?>" placeholder="city"><br />
+<input type="text" id="telnocode" name="telnocode" value="" placeholder="vorwahl"><br />
+<input type="text" id="telno" name="telno" value="<?php echo $oCustomer->getPhone();?>" placeholder="telno"><br />
+<input type="text" id="birthday" name="birthday" value="<?php echo $oCustomer->getBirthdate("Y-m-d");?>" placeholder="birthday"><br />
+<input type="text" id="email" name="email" value="<?php echo $oCustomer->getEMail();?>"  placeholder="email"><br />
+
+<input type="submit" id="submit" name="submit" value="submit" >
+
+</form>
+
+
+<?php if ($this->get_option('wpsg_mod_targo_autostart') == '1') { ?>
+<script type="text/javascript">/* <![CDATA[ */
+ 
+	jQuery(document).ready(function() { 
+		window.setTimeout(function() {
+    		//location.href = "<?php echo $this->view['targoLink']; ?>";
+			location.href = "<?php echo $this->get_option('wpsg_mod_targo_url');?>";
+		}, 1000);
+	} );
+	
+/* ]]> */</script>
+<?php } ?>
Index: /views/mods/mod_targo/order_view_afterpayment.phtml
===================================================================
--- /views/mods/mod_targo/order_view_afterpayment.phtml	(revision 5873)
+++ /views/mods/mod_targo/order_view_afterpayment.phtml	(revision 5873)
@@ -0,0 +1,27 @@
+<?php
+
+	/**
+	 * Template fÃŒr die Integration der PayPal Zahlungsart in die Bestellverwaltung
+	 */
+
+?>
+
+<?php if (wpsg_isSizedString($this->view['oOrder']->getMeta('wpsg_mod_paypal_paymentid'))) { ?>
+	
+	<div class="wpsg_form_field ">
+		<div class="wpsg_form_left">
+			<label for=""><?php echo __('PaymentID', 'wpsg'); ?>: [<a href="<?php echo WPSG_URL_WP; ?>wp-admin/admin.php?page=wpsg-Order&action=ajax&noheader=1&mod=wpsg_mod_paypal&do=refresh&edit_id=<?php echo $this->view['oOrder']->id; ?>"><?php echo __('Status Aktualisieren', 'wpsg'); ?></a>]</label>
+		</div>
+		<div class="wpsg_form_right">
+			<p class="" id=""><?php echo wpsg_translate(__('#1# (#2#)', 'wpsg'), $this->view['oOrder']->getMeta('wpsg_mod_paypal_paymentid'), $this->view['oOrder']->getMeta('wpsg_mod_paypal_paymentstate')); ?></p>
+		</div>
+		<div class="wpsg_clear"></div>
+	</div>
+		
+<?php } ?>
+
+<?php if (wpsg_isSizedString($this->view['oOrder']->getMeta('wpsg_mod_paypal_saleid'))) { ?>
+
+	<?php echo wpsg_drawForm_Input('', __('SaleID', 'wpsg'), $this->view['oOrder']->getMeta('wpsg_mod_paypal_saleid'), array('text' => true)); ?>
+		
+<?php } ?>
Index: /views/mods/mod_targo/settings_edit.phtml
===================================================================
--- /views/mods/mod_targo/settings_edit.phtml	(revision 5873)
+++ /views/mods/mod_targo/settings_edit.phtml	(revision 5873)
@@ -0,0 +1,55 @@
+<?php 
+
+	/**
+	 * Templatedatei fÃŒr die Einstellungen des Targo Moduls
+	 */
+
+?>
+
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_bezeichnung', __('Bezeichnung', 'wpsg'), $this->get_option('wpsg_mod_targo_bezeichnung'), array('help' => 'wpsg_shippay_name')); ?>
+<?php echo wpsg_drawForm_Textarea('wpsg_mod_targo_hint', __('Hinweistext', 'wpsg'), $this->get_option('wpsg_mod_targo_hint'), array('help' => 'wpsg_shippay_hint')); ?>
+
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_targo_aktiv', __('Aktiv', 'wpsg'), $this->get_option('wpsg_mod_targo_aktiv'), array('help' => 'wpsg_mod_targo_activ')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_targo_autostart', __('Autostart', 'wpsg'), $this->get_option('wpsg_mod_targo_autostart'), array('help' => 'wpsg_mod_targo_autostart')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_summe_min', __('Mindestfinanzierungssumme', 'wpsg'), $this->get_option('wpsg_mod_targo_summe_min'), array('help' => 'wpsg_mod_targo_summe_min')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_summe_max', __('Maximale Finanzierungssumme', 'wpsg'), $this->get_option('wpsg_mod_targo_summe_max'), array('help' => 'wpsg_mod_targo_summe_max')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_laufzeit_min', __('Mindestlaufzeit (Monate)', 'wpsg'), $this->get_option('wpsg_mod_targo_laufzeit_min'), array('help' => 'wpsg_mod_targo_laufzeit_min')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_laufzeit_max', __('Maximale Laufzeit (Monate)', 'wpsg'), $this->get_option('wpsg_mod_targo_laufzeit_max'), array('help' => 'wpsg_mod_targo_laufzeit_max')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_rate_min', __('Mindestrate', 'wpsg'), $this->get_option('wpsg_mod_targo_rate_min'), array('help' => 'wpsg_mod_targo_rate_min')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_url', __('Targo-URL', 'wpsg'), $this->get_option('wpsg_mod_targo_url'), array('help' => 'wpsg_mod_targo_url')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_koop_id', __('Targo-Koop-ID', 'wpsg'), $this->get_option('wpsg_mod_targo_koop_id'), array('help' => 'wpsg_mod_targo_koop_id')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_dealerid', __('Targo-Dealer-ID', 'wpsg'), $this->get_option('wpsg_mod_targo_dealerid'), array('help' => 'wpsg_mod_targo_dealerid')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_hashkey', __('Targo-Hash-Key', 'wpsg'), $this->get_option('wpsg_mod_targo_hashkey'), array('help' => 'wpsg_mod_targo_hashkey')); ?>
+
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_targo_createwebhook',  __('Beim speichern versuchen den WebHook anzumelden.', 'wpsg'), 0, array('labelright' => true, 'noDoubleDot' => true, 'help' => 'wpsg_mod_targo_createwebhook')); ?>
+<?php echo wpsg_drawForm_Input('wpsg_mod_targo_gebuehr', __('GebÃŒhr/Rabatt', 'wpsg'), wpsg_ff($this->get_option('wpsg_mod_targo_gebuehr'), true), array('help' => 'wpsg_shippay_gebuehr', 'unit' => $this->get_option('wpsg_currency').' / %')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_targo_mwst', __('Mehrwertsteuersatz', 'wpsg'), wpsg_tax_groups(), $this->get_option('wpsg_mod_targo_mwst'), array('help' => 'wpsg_shippay_mwst')); ?>
+<?php echo wpsg_drawForm_Checkbox('wpsg_mod_targo_mwstland', __('Keine MwSt. wenn Land steuerfrei', 'wpsg'), $this->get_option('wpsg_mod_targo_mwstland'), array('help' => 'wpsg_shippay_mwstland')); ?>
+
+<?php echo wpsg_drawForm_Select('wpsg_mod_targo_success', __('Erfolgsseite', 'wpsg'), $this->view['pages'], $this->get_option('wpsg_mod_targo_success'), array('help' => 'wpsg_mod_targo_success')); ?>
+<?php echo wpsg_drawForm_Select('wpsg_mod_targo_error', __('Fehlerseite', 'wpsg'), $this->view['pages'], $this->get_option('wpsg_mod_targo_error'), array('help' => 'wpsg_mod_targo_error')); ?>
+
+<br />
+
+<div class="wpsg_mod_targo_mode_layer wpsg_mod_targo_mode_1">
+	
+</div>
+
+<script type="text/javascript">/* <![CDATA[ */
+
+	jQuery(document).ready(function() {
+ 
+		jQuery('#wpsg_mod_targo_mode').bind('change', function() {
+
+			jQuery('.wpsg_mod_targo_mode_layer').hide();
+			jQuery('.wpsg_mod_targo_mode_' + jQuery(this).val()).show();
+			
+		}).change();
+
+		
+	});
+
+/* ]]> */</script>
+
+
+<br />
Index: /wpshopgermany.php
===================================================================
--- /wpshopgermany.php	(revision 5867)
+++ /wpshopgermany.php	(revision 5873)
@@ -206,5 +206,5 @@
 		add_action('wp_footer', array($GLOBALS['wpsg_sc'], 'wp_foot'));
 		add_action('template_redirect', array($GLOBALS['wpsg_sc'], 'template_redirect'));
-			
+					
 		if ($GLOBALS['wpsg_sc']->get_option('wpsg_removeWpTrimExcerpt') == '1') remove_filter('get_the_excerpt', 'wp_trim_excerpt');
 		if ($GLOBALS['wpsg_sc']->get_option('wpsg_removeWpAutoOp') == '1') remove_filter('the_content', 'wpautop');
