*/
protected $_component;
- /**
- * Parameters to append to the notify url.
- *
- * The notify url is passed to the payment processor and the processor uses it for return ping backs or redirection.
- *
- * @var array
- */
- protected $notifyUrlParameters = array();
-
- /**
- * Get notify url parameters.
- *
- * @return array
- */
- public function getNotifyUrlParameters() {
- return $this->notifyUrlParameters;
- }
-
- /**
- * Set notify url parameters.
- *
- * @param array $notifyUrlParameters
- */
- public function setNotifyUrlParameters($notifyUrlParameters) {
- $this->notifyUrlParameters = $notifyUrlParameters;
- }
-
/**
* How are we getting billing information.
*
protected function getNotifyUrl() {
$url = CRM_Utils_System::url(
'civicrm/payment/ipn/' . $this->_paymentProcessor['id'],
- $this->getNotifyUrlParameters(),
+ array(),
TRUE,
NULL,
FALSE
$params['processor_id'] = $_GET['processor_id'] = $lastParam;
}
else {
+ self::logPaymentNotification($params);
throw new CRM_Core_Exception("Either 'processor_id' (recommended) or 'processor_name' (deprecated) is required for payment callback.");
}
}
* @throws CRM_Core_Exception
*/
public function __construct($inputData) {
- $this->setInputParameters($inputData);
+ $this->setInputParameters(array_merge($inputData, json_decode($inputData['custom'], TRUE)));
parent::__construct();
}
'membershipID' => 'membershipID',
'related_contact' => 'relatedContactID',
'onbehalf_dupe_alert' => 'onBehalfDupeAlert',
+ 'accountingCode' => 'accountingCode',
);
foreach ($notifyParameterMap as $paramsName => $notifyName) {
if (!empty($params[$paramsName])) {
$notifyParameters[$notifyName] = $params[$paramsName];
}
}
- $this->setNotifyUrlParameters($notifyParameters);
$notifyURL = $this->getNotifyUrl();
$config = CRM_Core_Config::singleton();
TRUE, NULL, FALSE
);
- $customParams = array_merge($notifyParameters, array(
- 'accountingCode' => CRM_Utils_Array::value('accountingCode', $params),
- ));
$paypalParams = array(
'business' => $this->_paymentProcessor['user_name'],
'notify_url' => $notifyURL,
'invoice' => $params['invoiceID'],
'lc' => substr($config->lcMessages, -2),
'charset' => function_exists('mb_internal_encoding') ? mb_internal_encoding() : 'UTF-8',
- 'custom' => json_encode($customParams),
+ 'custom' => json_encode($notifyParameters),
'bn' => 'CiviCRM_SP',
);