<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.3 |
+ | CiviCRM version 4.5 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013 |
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
/**
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-2013
+ * @copyright CiviCRM LLC (c) 2004-2014
* $Id$
*/
$config = CRM_Core_Config::singleton();
if (empty($_GET)) {
- $rpInvoiceArray = array();
- $rpInvoiceArray = explode('&', $_POST['rp_invoice_id']);
- foreach ($rpInvoiceArray as $rpInvoiceValue) {
- $rpValueArray = explode('=', $rpInvoiceValue);
- if ($rpValueArray[0] == 'm') {
- $value = $rpValueArray[1];
- }
- }
- $paypalIPN = new CRM_Core_Payment_PayPalProIPN();
+ $paypalIPN = new CRM_Core_Payment_PayPalProIPN($_REQUEST);
}
else {
- $value = CRM_Utils_Array::value('module', $_GET);
$paypalIPN = new CRM_Core_Payment_PayPalIPN();
+ // @todo upgrade standard per Pro
}
-
-switch ($value) {
- case 'contribute':
- $paypalIPN->main('contribute');
- break;
-
- case 'event':
- $paypalIPN->main('event');
- break;
-
- default:
- CRM_Core_Error::debug_log_message("Could not get module name from request url");
- echo "Could not get module name from request url<p>";
- break;
+try{
+ $paypalIPN->main();
}
+catch(CRM_Core_Exception $e) {
+ CRM_Core_Error::debug_log_message($e->getMessage());
+ CRM_Core_Error::debug_var('error data', $e->getErrorData(), TRUE, TRUE);
+ CRM_Core_Error::debug_var('REQUEST', $_REQUEST, TRUE, TRUE);
+ //@todo give better info to logged in user - ie dev
+ echo "The transaction has failed. Please review the log for more detail";
+}
+