View | Details | Raw Unified | Return to bug 6596
Collapse All | Expand All

(-)a/plugins/paymethod/paypal/PayPalPlugin.inc.php (-12 / +13 lines)
 Lines 28-37   class PayPalPlugin extends PaymethodPlugin { Link Here 
28
28
29
	function getDescription() {
29
	function getDescription() {
30
		return Locale::translate('plugins.paymethod.paypal.description');
30
		return Locale::translate('plugins.paymethod.paypal.description');
31
	}   
31
	}
32
32
33
	function register($category, $path) {
33
	function register($category, $path) {
34
		if (parent::register($category, $path)) {			
34
		if (parent::register($category, $path)) {
35
			$this->addLocaleData();
35
			$this->addLocaleData();
36
			$this->import('PayPalDAO');
36
			$this->import('PayPalDAO');
37
			$payPalDao = new PayPalDAO();
37
			$payPalDao = new PayPalDAO();
 Lines 82-93   class PayPalPlugin extends PaymethodPlugin { Link Here 
82
			'no_note' => 1,
82
			'no_note' => 1,
83
			'no_shipping' => 1,
83
			'no_shipping' => 1,
84
			'currency_code' => $queuedPayment->getCurrencyCode(),
84
			'currency_code' => $queuedPayment->getCurrencyCode(),
85
			'lc' => String::substr(Locale::getLocale(), 3), 
85
			'lc' => String::substr(Locale::getLocale(), 3),
86
			'custom' => $queuedPaymentId,
86
			'custom' => $queuedPaymentId,
87
			'notify_url' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'ipn')),  
87
			'notify_url' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'ipn')),
88
			'return' => $queuedPayment->getRequestUrl(),
88
			'return' => $queuedPayment->getRequestUrl(),
89
			'cancel_return' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'cancel')),
89
			'cancel_return' => Request::url(null, null, 'payment', 'plugin', array($this->getName(), 'cancel')),
90
			'first_name' => ($user)?$user->getFirstName():'',  
90
			'first_name' => ($user)?$user->getFirstName():'',
91
			'last_name' => ($user)?$user->getLastname():'',
91
			'last_name' => ($user)?$user->getLastname():'',
92
			'item_number' => 1,
92
			'item_number' => 1,
93
			'cmd' => '_xclick'
93
			'cmd' => '_xclick'
 Lines 124-130   class PayPalPlugin extends PaymethodPlugin { Link Here 
124
				if (get_magic_quotes_gpc()) {
124
				if (get_magic_quotes_gpc()) {
125
					foreach ($_POST as $key => $value) $req .= '&' . urlencode(stripslashes($key)) . '=' . urlencode(stripslashes($value));
125
					foreach ($_POST as $key => $value) $req .= '&' . urlencode(stripslashes($key)) . '=' . urlencode(stripslashes($value));
126
				} else {
126
				} else {
127
					foreach ($_POST as $key => $value) $req .= '&' . urlencode($key) . '=' . urlencode($value);	
127
					foreach ($_POST as $key => $value) $req .= '&' . urlencode($key) . '=' . urlencode($value);
128
				}
128
				}
129
129
130
				// Create POST response
130
				// Create POST response
 Lines 209-241   class PayPalPlugin extends PaymethodPlugin { Link Here 
209
							if ($ocsPaymentManager->fulfillQueuedPayment($queuedPaymentId, $queuedPayment)) {
209
							if ($ocsPaymentManager->fulfillQueuedPayment($queuedPaymentId, $queuedPayment)) {
210
								// Send the registrant a notification that their payment was received
210
								// Send the registrant a notification that their payment was received
211
								$schedConfSettingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
211
								$schedConfSettingsDao =& DAORegistry::getDAO('SchedConfSettingsDAO');
212
		
212
213
								$schedConfId = $schedConf->getId();
213
								$registrationName = $schedConfSettingsDao->getSetting($schedConfId, 'registrationName');
214
								$registrationName = $schedConfSettingsDao->getSetting($schedConfId, 'registrationName');
214
								$registrationEmail = $schedConfSettingsDao->getSetting($schedConfId, 'registrationEmail');
215
								$registrationEmail = $schedConfSettingsDao->getSetting($schedConfId, 'registrationEmail');
215
								$registrationPhone = $schedConfSettingsDao->getSetting($schedConfId, 'registrationPhone');
216
								$registrationPhone = $schedConfSettingsDao->getSetting($schedConfId, 'registrationPhone');
216
								$registrationFax = $schedConfSettingsDao->getSetting($schedConfId, 'registrationFax');
217
								$registrationFax = $schedConfSettingsDao->getSetting($schedConfId, 'registrationFax');
217
								$registrationMailingAddress = $schedConfSettingsDao->getSetting($schedConfId, 'registrationMailingAddress');
218
								$registrationMailingAddress = $schedConfSettingsDao->getSetting($schedConfId, 'registrationMailingAddress');
218
								$registrationContactSignature = $registrationName;
219
								$registrationContactSignature = $registrationName;
219
						
220
220
								if ($registrationMailingAddress != '') $registrationContactSignature .= "\n" . $registrationMailingAddress;
221
								if ($registrationMailingAddress != '') $registrationContactSignature .= "\n" . $registrationMailingAddress;
221
								if ($registrationPhone != '') $registrationContactSignature .= "\n" . Locale::Translate('user.phone') . ': ' . $registrationPhone;
222
								if ($registrationPhone != '') $registrationContactSignature .= "\n" . Locale::Translate('user.phone') . ': ' . $registrationPhone;
222
								if ($registrationFax != '')	$registrationContactSignature .= "\n" . Locale::Translate('user.fax') . ': ' . $registrationFax;
223
								if ($registrationFax != '')	$registrationContactSignature .= "\n" . Locale::Translate('user.fax') . ': ' . $registrationFax;
223
						
224
224
								$registrationContactSignature .= "\n" . Locale::Translate('user.email') . ': ' . $registrationEmail;
225
								$registrationContactSignature .= "\n" . Locale::Translate('user.email') . ': ' . $registrationEmail;
225
226
226
								$paramArray = array(
227
								$paramArray = array(
227
									'registrantName' => $contactName,
228
									'registrantName' => $contactName,
228
									'schedConfName' => $schedConfName,
229
									'schedConfName' => $schedConfName,
229
									'registrationContactSignature' => $registrationContactSignature 
230
									'registrationContactSignature' => $registrationContactSignature
230
								);
231
								);
231
						
232
232
								import('mail.MailTemplate');
233
								import('mail.MailTemplate');
233
								$mail = new MailTemplate('MANUAL_PAYMENT_RECEIVED');
234
								$mail = new MailTemplate('MANUAL_PAYMENT_RECEIVED');
234
								$mail->setFrom($registrationEmail, $registrationName);
235
								$mail->setFrom($registrationEmail, $registrationName);
235
								$mail->assignParams($paramArray);
236
								$mail->assignParams($paramArray);
236
								$mail->addRecipient($contactEmail, $contactName);
237
								$mail->addRecipient($contactEmail, $contactName);
237
								$mail->send();
238
								$mail->send();
238
								
239
239
								exit();
240
								exit();
240
							}
241
							}
241
242

Return to bug 6596