Commit | Line | Data |
---|---|---|
6a488035 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
6a488035 | 5 | | | |
bc77d7c0 TO |
6 | | This work is published under the GNU AGPLv3 license with some | |
7 | | permitted exceptions and without any warranty. For full license | | |
8 | | and copyright information, see https://civicrm.org/licensing | | |
6a488035 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
6a488035 | 11 | |
a201e208 | 12 | use Civi\Api4\Contribution; |
13 | ||
6a488035 TO |
14 | /** |
15 | * | |
16 | * @package CRM | |
ca5cec67 | 17 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
6a488035 TO |
18 | */ |
19 | class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN { | |
20 | ||
b5c2afd0 | 21 | /** |
f78c9258 | 22 | * Input parameters from payment processor. Store these so that |
23 | * the code does not need to keep retrieving from the http request | |
24 | * @var array | |
b5c2afd0 | 25 | */ |
be2fb01f | 26 | protected $_inputParameters = []; |
f78c9258 | 27 | |
28 | /** | |
29 | * Constructor function. | |
30 | * | |
31 | * @param array $inputData | |
32 | * Contents of HTTP REQUEST. | |
33 | * | |
34 | * @throws CRM_Core_Exception | |
35 | */ | |
36 | public function __construct($inputData) { | |
d2803851 | 37 | // CRM-19676 |
0aeed2bc BS |
38 | $params = (!empty($inputData['custom'])) ? |
39 | array_merge($inputData, json_decode($inputData['custom'], TRUE)) : | |
40 | $inputData; | |
41 | $this->setInputParameters($params); | |
6a488035 TO |
42 | parent::__construct(); |
43 | } | |
44 | ||
6c786a9b | 45 | /** |
100fef9d | 46 | * @param string $name |
d2803851 | 47 | * @param string $type |
6c786a9b EM |
48 | * @param bool $abort |
49 | * | |
50 | * @return mixed | |
d2803851 | 51 | * @throws \CRM_Core_Exception |
6c786a9b | 52 | */ |
f78c9258 | 53 | public function retrieve($name, $type, $abort = TRUE) { |
d2803851 | 54 | $value = CRM_Utils_Type::validate(CRM_Utils_Array::value($name, $this->_inputParameters), $type, FALSE); |
6a488035 | 55 | if ($abort && $value === NULL) { |
d2803851 | 56 | throw new CRM_Core_Exception("PayPalIPN: Could not find an entry for $name"); |
6a488035 TO |
57 | } |
58 | return $value; | |
59 | } | |
60 | ||
6c786a9b | 61 | /** |
d2803851 | 62 | * @param array $input |
f6973d25 | 63 | * @param CRM_Contribute_BAO_ContributionRecur $recur |
64 | * @param CRM_Contribute_BAO_Contribution $contribution | |
d2803851 MW |
65 | * @param bool $first |
66 | * | |
67 | * @return void | |
7a9ab499 | 68 | * |
d2803851 MW |
69 | * @throws \CRM_Core_Exception |
70 | * @throws \CiviCRM_API3_Exception | |
6c786a9b | 71 | */ |
ae0b8266 | 72 | public function recur($input, $recur, $contribution, $first) { |
6a488035 | 73 | |
6a488035 TO |
74 | // make sure the invoice ids match |
75 | // make sure the invoice is valid and matches what we have in the contribution record | |
76 | if ($recur->invoice_id != $input['invoice']) { | |
d2803851 | 77 | Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request (RecurID: ' . $recur->id . ').'); |
3a317d6d | 78 | throw new CRM_Core_Exception("Failure: Invoice values dont match between database and IPN request"); |
6a488035 TO |
79 | } |
80 | ||
81 | $now = date('YmdHis'); | |
82 | ||
d2803851 | 83 | // set transaction type |
d2803851 | 84 | $contributionStatuses = array_flip(CRM_Contribute_BAO_Contribution::buildOptions('contribution_status_id', 'validate')); |
e02cd781 | 85 | switch ($this->getTrxnType()) { |
6a488035 TO |
86 | case 'subscr_signup': |
87 | $recur->create_date = $now; | |
d2803851 MW |
88 | // sometimes subscr_signup response come after the subscr_payment and set to pending mode. |
89 | ||
6a488035 TO |
90 | $statusID = CRM_Core_DAO::getFieldValue('CRM_Contribute_DAO_ContributionRecur', |
91 | $recur->id, 'contribution_status_id' | |
92 | ); | |
d2803851 MW |
93 | if ($statusID != $contributionStatuses['In Progress']) { |
94 | $recur->contribution_status_id = $contributionStatuses['Pending']; | |
6a488035 | 95 | } |
f78c9258 | 96 | $recur->processor_id = $this->retrieve('subscr_id', 'String'); |
6a488035 | 97 | $recur->trxn_id = $recur->processor_id; |
4423352d EM |
98 | $recur->save(); |
99 | return; | |
6a488035 TO |
100 | |
101 | case 'subscr_eot': | |
d2803851 MW |
102 | if ($recur->contribution_status_id != $contributionStatuses['Cancelled']) { |
103 | $recur->contribution_status_id = $contributionStatuses['Completed']; | |
6a488035 TO |
104 | } |
105 | $recur->end_date = $now; | |
4423352d EM |
106 | $recur->save(); |
107 | return; | |
6a488035 TO |
108 | |
109 | case 'subscr_cancel': | |
d2803851 | 110 | $recur->contribution_status_id = $contributionStatuses['Cancelled']; |
6a488035 | 111 | $recur->cancel_date = $now; |
4423352d EM |
112 | $recur->save(); |
113 | return; | |
6a488035 TO |
114 | |
115 | case 'subscr_failed': | |
d2803851 | 116 | $recur->contribution_status_id = $contributionStatuses['Failed']; |
6a488035 | 117 | $recur->modified_date = $now; |
4423352d | 118 | $recur->save(); |
6a488035 TO |
119 | break; |
120 | ||
121 | case 'subscr_modify': | |
d2803851 | 122 | Civi::log()->debug('PayPalIPN: We do not handle modifications to subscriptions right now (RecurID: ' . $recur->id . ').'); |
6a488035 | 123 | echo "Failure: We do not handle modifications to subscriptions right now<p>"; |
d2803851 | 124 | return; |
6a488035 | 125 | |
6a488035 TO |
126 | } |
127 | ||
e02cd781 | 128 | if ($this->getTrxnType() !== 'subscr_payment') { |
6a488035 TO |
129 | return; |
130 | } | |
4423352d EM |
131 | if ($input['paymentStatus'] !== 'Completed') { |
132 | Civi::log()->debug('PayPalIPN: Ignore all IPN payments that are not completed'); | |
133 | echo 'Failure: Invalid parameters<p>'; | |
134 | return; | |
135 | } | |
6a488035 TO |
136 | |
137 | if (!$first) { | |
d2803851 MW |
138 | // check if this contribution transaction is already processed |
139 | // if not create a contribution and then get it processed | |
6a488035 | 140 | $contribution = new CRM_Contribute_BAO_Contribution(); |
bc66bc9e PJ |
141 | $contribution->trxn_id = $input['trxn_id']; |
142 | if ($contribution->trxn_id && $contribution->find()) { | |
d2803851 | 143 | Civi::log()->debug('PayPalIPN: Returning since contribution has already been handled (trxn_id: ' . $contribution->trxn_id . ')'); |
4423352d | 144 | echo 'Success: Contribution has already been handled<p>'; |
d2803851 MW |
145 | return; |
146 | } | |
147 | ||
3cf0a9be | 148 | if ($input['paymentStatus'] !== 'Completed') { |
d2803851 | 149 | throw new CRM_Core_Exception("Ignore all IPN payments that are not completed"); |
bc66bc9e PJ |
150 | } |
151 | ||
f5bc4a2d MW |
152 | // In future moving to create pending & then complete, but this OK for now. |
153 | // Also consider accepting 'Failed' like other processors. | |
154 | $input['contribution_status_id'] = $contributionStatuses['Completed']; | |
ae0b8266 | 155 | $input['original_contribution_id'] = $contribution->id; |
156 | $input['contribution_recur_id'] = $recur->id; | |
f5bc4a2d MW |
157 | |
158 | civicrm_api3('Contribution', 'repeattransaction', $input); | |
159 | return; | |
6a488035 TO |
160 | } |
161 | ||
4f4bf3b6 | 162 | $this->single($input, $contribution, TRUE); |
6a488035 TO |
163 | } |
164 | ||
6c786a9b | 165 | /** |
d2803851 | 166 | * @param array $input |
667af247 | 167 | * @param \CRM_Contribute_BAO_Contribution $contribution |
6c786a9b | 168 | * @param bool $recur |
7a9ab499 | 169 | * |
d2803851 | 170 | * @return void |
84801709 | 171 | * @throws \CRM_Core_Exception |
172 | * @throws \CiviCRM_API3_Exception | |
6c786a9b | 173 | */ |
4f4bf3b6 | 174 | public function single($input, $contribution, $recur = FALSE) { |
6a488035 TO |
175 | |
176 | // make sure the invoice is valid and matches what we have in the contribution record | |
175f6d95 | 177 | if ($contribution->invoice_id != $input['invoice']) { |
178 | Civi::log()->debug('PayPalIPN: Invoice values dont match between database and IPN request. (ID: ' . $contribution->id . ').'); | |
179 | echo "Failure: Invoice values dont match between database and IPN request<p>"; | |
180 | return; | |
6a488035 TO |
181 | } |
182 | ||
183 | if (!$recur) { | |
184 | if ($contribution->total_amount != $input['amount']) { | |
d2803851 | 185 | Civi::log()->debug('PayPalIPN: Amount values dont match between database and IPN request. (ID: ' . $contribution->id . ').'); |
6a488035 | 186 | echo "Failure: Amount values dont match between database and IPN request<p>"; |
d2803851 | 187 | return; |
6a488035 TO |
188 | } |
189 | } | |
190 | else { | |
191 | $contribution->total_amount = $input['amount']; | |
192 | } | |
193 | ||
6a488035 | 194 | // check if contribution is already completed, if so we ignore this ipn |
4a413eb6 | 195 | $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); |
d2803851 | 196 | if ($contribution->contribution_status_id == $completedStatusId) { |
d2803851 | 197 | Civi::log()->debug('PayPalIPN: Returning since contribution has already been handled. (ID: ' . $contribution->id . ').'); |
85ce114d | 198 | echo 'Success: Contribution has already been handled<p>'; |
d2803851 | 199 | return; |
6a488035 TO |
200 | } |
201 | ||
1d6cc2d3 | 202 | CRM_Contribute_BAO_Contribution::completeOrder($input, $this->getContributionRecurID(), $contribution->id ?? NULL); |
6a488035 TO |
203 | } |
204 | ||
2e2605fe EM |
205 | /** |
206 | * Main function. | |
207 | * | |
61470a1a | 208 | * @throws \API_Exception |
d2803851 | 209 | * @throws \CiviCRM_API3_Exception |
61470a1a | 210 | * @throws \Civi\API\Exception\UnauthorizedException |
2e2605fe | 211 | */ |
00be9182 | 212 | public function main() { |
cd0f2a34 | 213 | try { |
2b4ab802 | 214 | $input = []; |
cd0f2a34 | 215 | $component = $this->retrieve('module', 'String'); |
216 | $input['component'] = $component; | |
6a488035 | 217 | |
2b4ab802 | 218 | $contributionID = $this->getContributionID(); |
cd0f2a34 | 219 | $this->getInput($input); |
6a488035 | 220 | |
1d6cc2d3 | 221 | $paymentProcessorID = $this->getPayPalPaymentProcessorID($input, $this->getContributionRecurID()); |
cd0f2a34 | 222 | |
2b4ab802 | 223 | Civi::log()->debug('PayPalIPN: Received (ContactID: ' . $this->getContactID() . '; trxn_id: ' . $input['trxn_id'] . ').'); |
68b23e7f | 224 | $contribution = $this->getContribution(); |
6a488035 | 225 | |
dc65872a MW |
226 | $input['payment_processor_id'] = $paymentProcessorID; |
227 | ||
1d6cc2d3 | 228 | if ($this->getContributionRecurID()) { |
ae0b8266 | 229 | $contributionRecur = new CRM_Contribute_BAO_ContributionRecur(); |
1d6cc2d3 | 230 | $contributionRecur->id = $this->getContributionRecurID(); |
ae0b8266 | 231 | if (!$contributionRecur->find(TRUE)) { |
1d6cc2d3 | 232 | throw new CRM_Core_Exception('Could not find contribution recur record'); |
ae0b8266 | 233 | } |
e813005b | 234 | // check if first contribution is completed, else complete first contribution |
235 | $first = TRUE; | |
236 | $completedStatusId = CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed'); | |
fcc57b56 | 237 | if ($contribution->contribution_status_id == $completedStatusId) { |
e813005b | 238 | $first = FALSE; |
6a488035 | 239 | } |
ae0b8266 | 240 | $this->recur($input, $contributionRecur, $contribution, $first); |
3a317d6d | 241 | if ($this->getFirstOrLastInSeriesStatus()) { |
242 | //send recurring Notification email for user | |
ce9ceea4 | 243 | CRM_Contribute_BAO_ContributionPage::recurringNotify( |
1d6cc2d3 | 244 | $contributionID, |
ce9ceea4 | 245 | $this->getFirstOrLastInSeriesStatus(), |
4206fa5c | 246 | $contributionRecur |
3a317d6d | 247 | ); |
248 | } | |
e813005b | 249 | return; |
6a488035 | 250 | } |
e813005b | 251 | |
a83a1f47 | 252 | $status = $input['paymentStatus']; |
253 | if ($status === 'Denied' || $status === 'Failed' || $status === 'Voided') { | |
61470a1a | 254 | Contribution::update(FALSE)->setValues([ |
255 | 'cancel_date' => 'now', | |
256 | 'contribution_status_id:name' => 'Failed', | |
257 | ])->addWhere('id', '=', $contributionID)->execute(); | |
258 | Civi::log()->debug("Setting contribution status to Failed"); | |
a83a1f47 | 259 | return; |
260 | } | |
261 | if ($status === 'Pending') { | |
262 | Civi::log()->debug('Returning since contribution status is Pending'); | |
263 | return; | |
264 | } | |
265 | if ($status === 'Refunded' || $status === 'Reversed') { | |
a201e208 | 266 | Contribution::update(FALSE)->setValues([ |
267 | 'cancel_date' => 'now', | |
268 | 'contribution_status_id:name' => 'Cancelled', | |
269 | ])->addWhere('id', '=', $contributionID)->execute(); | |
270 | Civi::log()->debug("Setting contribution status to Cancelled"); | |
a83a1f47 | 271 | return; |
272 | } | |
273 | if ($status !== 'Completed') { | |
274 | Civi::log()->debug('Returning since contribution status is not handled'); | |
275 | return; | |
276 | } | |
4f4bf3b6 | 277 | $this->single($input, $contribution); |
cd0f2a34 | 278 | } |
279 | catch (CRM_Core_Exception $e) { | |
1d6cc2d3 | 280 | Civi::log()->debug($e->getMessage() . ' input {input}', ['input' => $input]); |
cd0f2a34 | 281 | echo 'Invalid or missing data'; |
6a488035 | 282 | } |
6a488035 TO |
283 | } |
284 | ||
6c786a9b | 285 | /** |
d2803851 | 286 | * @param array $input |
7a9ab499 | 287 | * |
d2803851 | 288 | * @throws \CRM_Core_Exception |
6c786a9b | 289 | */ |
41ce57e7 | 290 | public function getInput(&$input) { |
291 | $billingID = CRM_Core_BAO_LocationType::getBilling(); | |
f78c9258 | 292 | $input['paymentStatus'] = $this->retrieve('payment_status', 'String', FALSE); |
293 | $input['invoice'] = $this->retrieve('invoice', 'String', TRUE); | |
294 | $input['amount'] = $this->retrieve('mc_gross', 'Money', FALSE); | |
295 | $input['reasonCode'] = $this->retrieve('ReasonCode', 'String', FALSE); | |
6a488035 | 296 | |
be2fb01f | 297 | $lookup = [ |
6a488035 TO |
298 | "first_name" => 'first_name', |
299 | "last_name" => 'last_name', | |
300 | "street_address-{$billingID}" => 'address_street', | |
301 | "city-{$billingID}" => 'address_city', | |
302 | "state-{$billingID}" => 'address_state', | |
303 | "postal_code-{$billingID}" => 'address_zip', | |
304 | "country-{$billingID}" => 'address_country_code', | |
be2fb01f | 305 | ]; |
6a488035 | 306 | foreach ($lookup as $name => $paypalName) { |
f78c9258 | 307 | $value = $this->retrieve($paypalName, 'String', FALSE); |
6a488035 TO |
308 | $input[$name] = $value ? $value : NULL; |
309 | } | |
310 | ||
f78c9258 | 311 | $input['is_test'] = $this->retrieve('test_ipn', 'Integer', FALSE); |
312 | $input['fee_amount'] = $this->retrieve('mc_fee', 'Money', FALSE); | |
313 | $input['net_amount'] = $this->retrieve('settle_amount', 'Money', FALSE); | |
314 | $input['trxn_id'] = $this->retrieve('txn_id', 'String', FALSE); | |
f5bc4a2d MW |
315 | |
316 | $paymentDate = $this->retrieve('payment_date', 'String', FALSE); | |
317 | if (!empty($paymentDate)) { | |
318 | $receiveDateTime = new DateTime($paymentDate); | |
6800eef1 JGJ |
319 | /** |
320 | * The `payment_date` that Paypal sends back is in their timezone. Example return: 08:23:05 Jan 11, 2019 PST | |
321 | * Subsequently, we need to account for that, otherwise the recieve time will be incorrect for the local system | |
322 | */ | |
602836ee | 323 | $input['receive_date'] = CRM_Utils_Date::convertDateToLocalTime($receiveDateTime); |
f5bc4a2d MW |
324 | } |
325 | } | |
326 | ||
f5bc4a2d | 327 | /** |
ae0b8266 | 328 | * Get PaymentProcessorID for PayPal |
f5bc4a2d MW |
329 | * |
330 | * @param array $input | |
ae0b8266 | 331 | * @param int|null $contributionRecurID |
f5bc4a2d MW |
332 | * |
333 | * @return int | |
334 | * @throws \CRM_Core_Exception | |
335 | * @throws \CiviCRM_API3_Exception | |
336 | */ | |
ae0b8266 | 337 | public function getPayPalPaymentProcessorID(array $input, ?int $contributionRecurID): int { |
f5bc4a2d MW |
338 | // First we try and retrieve from POST params |
339 | $paymentProcessorID = $this->retrieve('processor_id', 'Integer', FALSE); | |
340 | if (!empty($paymentProcessorID)) { | |
341 | return $paymentProcessorID; | |
342 | } | |
343 | ||
344 | // Then we try and get it from recurring contribution ID | |
ae0b8266 | 345 | if ($contributionRecurID) { |
be2fb01f | 346 | $contributionRecur = civicrm_api3('ContributionRecur', 'getsingle', [ |
ae0b8266 | 347 | 'id' => $contributionRecurID, |
f5bc4a2d | 348 | 'return' => ['payment_processor_id'], |
be2fb01f | 349 | ]); |
f5bc4a2d MW |
350 | if (!empty($contributionRecur['payment_processor_id'])) { |
351 | return $contributionRecur['payment_processor_id']; | |
352 | } | |
353 | } | |
354 | ||
355 | // This is an unreliable method as there could be more than one instance. | |
356 | // Recommended approach is to use the civicrm/payment/ipn/xx url where xx is the payment | |
357 | // processor id & the handleNotification function (which should call the completetransaction api & by-pass this | |
358 | // entirely). The only thing the IPN class should really do is extract data from the request, validate it | |
359 | // & call completetransaction or call fail? (which may not exist yet). | |
360 | ||
361 | Civi::log()->warning('Unreliable method used to get payment_processor_id for PayPal IPN - this will cause problems if you have more than one instance'); | |
362 | // Then we try and retrieve based on business email ID | |
363 | $paymentProcessorTypeID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_PaymentProcessorType', 'PayPal_Standard', 'id', 'name'); | |
364 | $processorParams = [ | |
365 | 'user_name' => $this->retrieve('business', 'String', FALSE), | |
366 | 'payment_processor_type_id' => $paymentProcessorTypeID, | |
367 | 'is_test' => empty($input['is_test']) ? 0 : 1, | |
368 | 'options' => ['limit' => 1], | |
369 | 'return' => ['id'], | |
370 | ]; | |
371 | $paymentProcessorID = civicrm_api3('PaymentProcessor', 'getvalue', $processorParams); | |
372 | if (empty($paymentProcessorID)) { | |
518fa0ee | 373 | throw new CRM_Core_Exception('PayPalIPN: Could not get Payment Processor ID'); |
f5bc4a2d | 374 | } |
ae0b8266 | 375 | return (int) $paymentProcessorID; |
6a488035 | 376 | } |
96025800 | 377 | |
7b7ccbe7 | 378 | /** |
379 | * @return mixed | |
380 | * @throws \CRM_Core_Exception | |
381 | */ | |
382 | protected function getTrxnType() { | |
e02cd781 | 383 | return $this->retrieve('txn_type', 'String'); |
7b7ccbe7 | 384 | } |
385 | ||
386 | /** | |
387 | * Get status code for first or last recurring in the series. | |
388 | * | |
389 | * If this is the first or last then return the status code, else | |
390 | * null. | |
391 | * | |
392 | * @return string|null | |
393 | * @throws \CRM_Core_Exception | |
394 | */ | |
395 | protected function getFirstOrLastInSeriesStatus(): ?string { | |
396 | $subscriptionPaymentStatus = NULL; | |
397 | if ($this->getTrxnType() === 'subscr_signup') { | |
398 | return CRM_Core_Payment::RECURRING_PAYMENT_START; | |
399 | } | |
400 | if ($this->getTrxnType() === 'subscr_eot') { | |
401 | return CRM_Core_Payment::RECURRING_PAYMENT_END; | |
402 | } | |
403 | return NULL; | |
404 | } | |
405 | ||
1d6cc2d3 EM |
406 | /** |
407 | * Get the recurring contribution ID. | |
408 | * | |
409 | * @return int|null | |
410 | * | |
411 | * @throws \CRM_Core_Exception | |
412 | */ | |
413 | protected function getContributionRecurID(): ?int { | |
414 | $id = $this->retrieve('contributionRecurID', 'Integer', FALSE); | |
415 | return $id ? (int) $id : NULL; | |
416 | } | |
417 | ||
0b095e9a EM |
418 | /** |
419 | * Get Contribution ID. | |
420 | * | |
421 | * @return int | |
422 | * | |
423 | * @throws \CRM_Core_Exception | |
424 | */ | |
425 | protected function getContributionID(): int { | |
426 | return (int) $this->retrieve('contributionID', 'Integer', TRUE); | |
427 | } | |
428 | ||
429 | /** | |
430 | * Get contact id from parameters. | |
431 | * | |
432 | * @return int | |
433 | * | |
434 | * @throws \CRM_Core_Exception | |
435 | */ | |
436 | protected function getContactID(): int { | |
437 | return (int) $this->retrieve('contactID', 'Integer', TRUE); | |
438 | } | |
439 | ||
68b23e7f EM |
440 | /** |
441 | * Get the contribution object. | |
442 | * | |
443 | * @return \CRM_Contribute_BAO_Contribution | |
444 | * @throws \CRM_Core_Exception | |
445 | */ | |
446 | protected function getContribution(): CRM_Contribute_BAO_Contribution { | |
447 | $contribution = new CRM_Contribute_BAO_Contribution(); | |
448 | $contribution->id = $this->getContributionID(); | |
449 | if (!$contribution->find(TRUE)) { | |
450 | 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: "]); | |
451 | } | |
452 | if ($contribution->contact_id !== $this->getContactID()) { | |
453 | CRM_Core_Error::debug_log_message("Contact ID in IPN not found but contact_id found in contribution."); | |
454 | } | |
455 | return $contribution; | |
456 | } | |
457 | ||
6a488035 | 458 | } |