if (!$contribution->find(TRUE)) {
throw new CRM_Core_Exception('Failure: Could not find contribution record for ' . (int) $contribution->id, NULL, ['context' => "Could not find contribution record: {$contribution->id} in IPN request: " . print_r($input, TRUE)]);
}
+ $ids['contributionPage'] = $contribution->contribution_page_id;
// make sure contact exists and is valid
// use the contact id from the contribution record as the id in the IPN may not be valid anymore.
$objects['contact'] = &$contact;
$objects['contribution'] = &$contribution;
- // CRM-19478: handle oddity when p=null is set in place of contribution page ID,
- if (!empty($ids['contributionPage']) && !is_numeric($ids['contributionPage'])) {
- // We don't need to worry if about removing contribution page id as it will be set later in
- // CRM_Contribute_BAO_Contribution::loadRelatedObjects(..) using $objects['contribution']->contribution_page_id
- unset($ids['contributionPage']);
- }
-
$this->loadObjects($input, $ids, $objects, TRUE, $paymentProcessorID);
if (!empty($ids['paymentProcessor']) && $objects['contributionRecur']->payment_processor_id != $ids['paymentProcessor']) {
throw new CRM_Core_Exception($message);
}
- // get page id based on contribution id
- $ids['contributionPage'] = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_Contribution',
- $ids['contribution'],
- 'contribution_page_id'
- );
-
if ($input['component'] == 'event') {
// FIXME: figure out fields for event
}
<?php
use Civi\Payment\Exception\PaymentProcessorException;
+use Civi\Api4\Contribution;
/**
* Class CRM_Core_Payment_PayPalProIPNTest
$this->assertEquals(date('Y-m-d'), substr($updatedContributionRecurAgain['end_date'], 0, 10));
// There should not be any email.
$mut->assertMailLogEmpty();
+
+ $contributions = Contribution::get()->addWhere('contribution_recur_id', '=', $this->_contributionRecurID)->addSelect('contribution_page_id')->execute();
+ foreach ($contributions as $contribution) {
+ $this->assertEquals($this->_contributionPageID, $contribution['contribution_page_id']);
+ }
}
/**