Commit d5346e1b authored by Eileen's avatar Eileen Committed by eileen

CRM-12108 minor improvement - simplify ipn.php by putting logic in the

relevant classes (no logic behind the split)
parent 763b8d6f
......@@ -262,12 +262,13 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
$this->completeTransaction($input, $ids, $objects, $transaction, $recur);
}
function main($component = 'contribute') {
function main() {
// CRM_Core_Error::debug_var( 'GET' , $_GET , true, true );
// CRM_Core_Error::debug_var( 'POST', $_POST, true, true );
$objects = $ids = $input = array();
$component = CRM_Utils_Array::value('module', $_GET);
$input['component'] = $component;
// get the contribution and contact ids from the GET params
......
......@@ -279,13 +279,12 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
$this->completeTransaction($input, $ids, $objects, $transaction, $recur);
}
function main($component = 'contribute') {
function main() {
CRM_Core_Error::debug_var('GET', $_GET, TRUE, TRUE);
CRM_Core_Error::debug_var('POST', $_POST, TRUE, TRUE);
$objects = $ids = $input = array();
$input['component'] = $component;
$input['component'] = self::getValue('m');
// get the contribution and contact ids from the GET params
$ids['contact'] = self::getValue('c', TRUE);
......
......@@ -40,32 +40,11 @@ require_once '../civicrm.config.php';
$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();
}
else {
$value = CRM_Utils_Array::value('module', $_GET);
$paypalIPN = new CRM_Core_Payment_PayPalIPN();
}
switch ($value) {
case 'contribute':
$paypalIPN->main('contribute');
break;
$paypalIPN->main();
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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment