diff --git a/CRM/Core/Payment/PayPalIPN.php b/CRM/Core/Payment/PayPalIPN.php index 4a23cacdd625..bbf874b2c864 100644 --- a/CRM/Core/Payment/PayPalIPN.php +++ b/CRM/Core/Payment/PayPalIPN.php @@ -133,19 +133,6 @@ public function recur($input, $recur, $contribution, $first) { echo 'Failure: Invalid parameters
'; return; } - if ($first) { - $recur->start_date = $now; - } - else { - $recur->modified_date = $now; - } - - // make sure the contribution status is not done - // since order of ipn's is unknown - if ($recur->contribution_status_id != $contributionStatuses['Completed']) { - $recur->contribution_status_id = $contributionStatuses['In Progress']; - } - $recur->save(); if (!$first) { // check if this contribution transaction is already processed diff --git a/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php index f6075b1a988d..8a9ebb6920cd 100644 --- a/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php +++ b/tests/phpunit/CRM/Core/Payment/PayPalIPNTest.php @@ -9,6 +9,8 @@ +--------------------------------------------------------------------+ */ +use Civi\Api4\ContributionRecur; + /** * Class CRM_Core_Payment_PayPalProIPNTest * @group headless @@ -123,6 +125,11 @@ public function testIPNPaymentRecurSuccess(): void { $mut = new CiviMailUtils($this, TRUE); $paypalIPN = new CRM_Core_Payment_PayPalIPN($this->getPaypalRecurTransaction()); $paypalIPN->main(); + $recur = ContributionRecur::get() + ->addWhere('contact_id', '=', $this->_contactID) + ->addSelect('contribution_status_id:name') + ->execute()->first(); + $this->assertEquals('In Progress', $recur['contribution_status_id:name']); $mut->checkMailLog(['https://www.sandbox.paypal.com/cgi-bin/webscr?cmd=_subscr-find'], ['civicrm/contribute/unsubscribe', 'civicrm/contribute/updatebilling']); $mut->stop(); $contribution1 = $this->callAPISuccess('Contribution', 'getsingle', ['id' => $this->_contributionID]);