Index: /donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationAddFormPayPalListener.class.php
===================================================================
--- /donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationAddFormPayPalListener.class.php (revision 255)
+++ /donation/optionals/de.easy-coding.wcf.donation.paypal/files/lib/system/event/listener/DonationAddFormPayPalListener.class.php (revision 259)
@@ -15,8 +15,8 @@
 	
 	//data
-	protected $arr = array('paypal_enable','paypal_code');
+	protected $arr = array('paypal_enable','paypal_business', 'paypal_auth_token', 'paypal_item_name', 'paypal_amount_type', 'paypal_amount_default', 'paypal_amount_select', 'paypal_currency', 'paypal_img');
 	
 	/**
-	 *
+	 * paypal check
 	 */
 	protected function validatePaypal() {
@@ -25,5 +25,5 @@
 
 		$tx_token = $_GET['tx'];
-		$auth_token = "GX_sTf5bW3wxRfFEbgofs88nQxvMQ7nsI8m21rzNESnl_79ccFTWj2aPgQ0";
+		$auth_token = $this->data['paypal_auth_token'];
 		$req .= "&tx=$tx_token&at=$auth_token";
 
@@ -68,20 +68,23 @@
 				// check that txn_id has not been previously processed
 				// check that receiver_email is your Primary PayPal email
+				if($keyarray['business'] != $this->data['paypal_business']) {
+					return false;
+				}
 				// check that payment_amount/payment_currency are correct
+				if($keyarray['payment_gross'] <= 0) {
+					return false;
+				}
 				// process payment
-				$firstname = $keyarray['first_name'];
-				$lastname = $keyarray['last_name'];
 				$itemname = $keyarray['item_name'];
-				$amount = $keyarray['payment_gross'];
-				$currency = $keyarray['mc_currency'];
-				$text = urldecode($keyarray['custom']);
 
-				echo ("<p><h3>Thank you for your purchase!</h3></p>");
-
-				echo ("<b>Payment Details</b><br>\n");
-				echo ("<li>Name: $firstname $lastname</li>\n");
-				echo ("<li>Item: $itemname</li>\n");
-				echo ("<li>Amount: $amount</li>\n");
-				echo ("");
+				$this->username = $keyarray['last_name'].', '.$keyarray['first_name'];
+				$this->present['amount'] = $keyarray['payment_gross'];
+				$this->present['currency'] = $keyarray['mc_currency'];
+				$this->present['mail'] = $keyarray['payer_email'];
+				$this->message = urldecode($keyarray['custom']);
+				
+				WCF::getTPL()->assign(array(
+					'pageurl'=>WCF::getLanguage()->get('wcf.donation.paypal.thanks')
+				));
 
 				fclose ($fp);		
@@ -97,10 +100,13 @@
 		return false;
 	}
-
+	
 	/**
-	 * @see Form::readFormParameters()
+	 * @see Form::assignVariables()
 	 */
-	protected function readFormParameters() {
-		//TODO: get information from paypal
+	protected function assignVariables() {
+		WCF::getTPL()->assign(array(
+			'pageurl'=>FileUtil::addTrailingSlash(PAGE_URL)
+		));
+		parent::assignVariables();
 	}
 	
@@ -109,9 +115,9 @@
 	 */
 	protected function validate() {
-		//TODO: did we get an answer from paypal? submission finished?
+		// did we get an answer from paypal? submission finished?
 		switch($this->eventObj->step) {
 			case 10: // return page
 				if($this->validatePaypal()) {
-					EventListener::fireEvent($this->eventObj, 'save'); //TODO: EventListener
+					$this->save();
 				}
 				
Index: /donation/optionals/de.easy-coding.wcf.donation.paypal/eventlistener.xml
===================================================================
--- /donation/optionals/de.easy-coding.wcf.donation.paypal/eventlistener.xml (revision 255)
+++ /donation/optionals/de.easy-coding.wcf.donation.paypal/eventlistener.xml (revision 259)
@@ -18,14 +18,4 @@
 			<listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile>
 		</eventlistener>
-		<eventlistener>
-			<eventclassname>DonationAddForm</eventclassname>
-			<eventname>readFormParameters</eventname>
-			<listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile>
-		</eventlistener>
-		<eventlistener>
-			<eventclassname>DonationAddForm</eventclassname>
-			<eventname>save</eventname>
-			<listenerclassfile>lib/system/event/listener/DonationAddFormPayPalListener.class.php</listenerclassfile>
-		</eventlistener>
 		<!-- admin -->
 		<eventlistener>
Index: /donation/optionals/de.easy-coding.wcf.donation.paypal/templates/donationPayPal.tpl
===================================================================
--- /donation/optionals/de.easy-coding.wcf.donation.paypal/templates/donationPayPal.tpl (revision 257)
+++ /donation/optionals/de.easy-coding.wcf.donation.paypal/templates/donationPayPal.tpl (revision 259)
@@ -14,11 +14,11 @@
 		<input type="hidden" name="tax" value="0"/>
 		<input type="hidden" name="bn" value="PP-DonationsBF"/>
-		{if paypal_amount_type == "hidden"}
+		{if $paypal_amount_type == "hidden"}
 		<input type="hidden" name="amount" value="{$paypal_amount_default}"/>
-		{elseif paypal_amount_type == "default"}
+		{elseif $paypal_amount_type == "default"}
 		<input type="text" name="amount" value="{$paypal_amount_default}"/> {$paypal_currency}
-		{elseif paypal_amount_type == "select"}
+		{elseif $paypal_amount_type == "select"}
 		<select name="amount">
-			{foreach $paypal_amount_select item=amount}
+			{foreach from=$paypal_amount_select item=amount}
 			<option value=""{if $paypal_amount_default == $amount} selected="selected"{/if}>{$amount} {$paypal_currency}</option>
 			{/foreach}
