Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using BaseIPN class in core payment processors #31451

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 12 additions & 3 deletions CRM/Core/Payment/AuthorizeNetIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
class CRM_Core_Payment_AuthorizeNetIPN {

/**
* Input parameters from payment processor. Store these so that
* the code does not need to keep retrieving from the http request
* @var array
*/
protected $_inputParameters = [];

/**
* Constructor function.
Expand All @@ -29,8 +36,10 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
* @throws CRM_Core_Exception
*/
public function __construct($inputData) {
$this->setInputParameters($inputData);
parent::__construct();
if (!is_array($inputData)) {
throw new CRM_Core_Exception('Invalid input parameters');
}
$this->_inputParameters = $inputData;
}

/**
Expand Down
9 changes: 6 additions & 3 deletions CRM/Core/Payment/PayPalIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
class CRM_Core_Payment_PayPalIPN {

/**
* Input parameters from payment processor. Store these so that
Expand Down Expand Up @@ -45,8 +45,11 @@ public function __construct($inputData) {
$params = (!empty($inputData['custom'])) ?
array_merge($inputData, json_decode($inputData['custom'], TRUE) ?? []) :
$inputData;
$this->setInputParameters($params);
parent::__construct();

if (!is_array($params)) {
throw new CRM_Core_Exception('Invalid input parameters');
}
$this->_inputParameters = $params;
}

/**
Expand Down
8 changes: 5 additions & 3 deletions CRM/Core/Payment/PayPalProIPN.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* @package CRM
* @copyright CiviCRM LLC https://civicrm.org/licensing
*/
class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
class CRM_Core_Payment_PayPalProIPN {

/**
* Input parameters from payment processor. Store these so that
Expand Down Expand Up @@ -129,9 +129,11 @@ public function setContributionID(int $contributionID): void {
* @throws CRM_Core_Exception
*/
public function __construct($inputData) {
$this->setInputParameters($inputData);
if (!is_array($inputData)) {
throw new CRM_Core_Exception('Invalid input parameters');
}
$this->_inputParameters = $inputData;
$this->setInvoiceData();
parent::__construct();
}

/**
Expand Down