Skip to content

Commit

Permalink
Merge pull request #25240 from eileenmcnaughton/cancel
Browse files Browse the repository at this point in the history
Remove legacy code payment processor handling
  • Loading branch information
yashodha authored Dec 30, 2022
2 parents 4f0b7a9 + 50cbd3d commit f14c83c
Showing 1 changed file with 0 additions and 30 deletions.
30 changes: 0 additions & 30 deletions CRM/Contribute/Form/ContributionBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -489,11 +489,6 @@ public function preProcess() {
$this->_values['campaign_id'] = $campID;
}

//do check for cancel recurring and clean db, CRM-7696
if (CRM_Utils_Request::retrieve('cancel', 'Boolean')) {
self::cancelRecurring();
}

// check if billing block is required for pay later
if (!empty($this->_values['is_pay_later'])) {
$this->_isBillingAddressRequiredForPayLater = $this->_values['is_billing_required'] ?? NULL;
Expand Down Expand Up @@ -1125,31 +1120,6 @@ public function authenticatePledgeUser() {
}
}

/**
* Cancel recurring contributions.
*
* In case user cancel recurring contribution,
* When we get the control back from payment gate way
* lets delete the recurring and related contribution.
*
* @throws \CRM_Core_Exception
*/
public function cancelRecurring() {
$isCancel = CRM_Utils_Request::retrieve('cancel', 'Boolean');
if ($isCancel) {
$isRecur = CRM_Utils_Request::retrieve('isRecur', 'Boolean');
$recurId = CRM_Utils_Request::retrieve('recurId', 'Positive');
//clean db for recurring contribution.
if ($isRecur && $recurId) {
CRM_Contribute_BAO_ContributionRecur::deleteRecurContribution($recurId);
}
$contribId = CRM_Utils_Request::retrieve('contribId', 'Positive');
if ($contribId) {
CRM_Contribute_BAO_Contribution::deleteContribution($contribId);
}
}
}

/**
* Determine if recurring parameters need to be added to the form parameters.
*
Expand Down

0 comments on commit f14c83c

Please sign in to comment.