echo 'Failure: Invalid parameters<p>';
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
+--------------------------------------------------------------------+
*/
+use Civi\Api4\ContributionRecur;
+
/**
* Class CRM_Core_Payment_PayPalProIPNTest
* @group headless
$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]);