/**
* Rollback unhandled outcomes.
*
+ * @deprecated
+ *
* @param array $objects
* @param CRM_Core_Transaction $transaction
*
* @return bool
*/
public function unhandled(&$objects, &$transaction) {
+ CRM_Core_Error::deprecatedFunctionWarning('This function will be removed at some point');
$transaction->rollback();
- Civi::log()->debug("Returning since contribution status is not handled");
- echo "Failure: contribution status is not handled<p>";
+ Civi::log()->debug('Returning since contribution status is not handled');
+ echo 'Failure: contribution status is not handled<p>';
return FALSE;
}
elseif ($status == 'Refunded' || $status == 'Reversed') {
return $this->cancelled($objects, $transaction);
}
- elseif ($status != 'Completed') {
- return $this->unhandled($objects, $transaction);
+ elseif ($status !== 'Completed') {
+ Civi::log()->debug('Returning since contribution status is not handled');
+ return;
}
// check if contribution is already completed, if so we ignore this ipn
if ($contribution->contribution_status_id == $completedStatusId) {
$transaction->commit();
Civi::log()->debug('PayPalIPN: Returning since contribution has already been handled. (ID: ' . $contribution->id . ').');
- echo "Success: Contribution has already been handled<p>";
+ echo 'Success: Contribution has already been handled<p>';
return;
}
$this->cancelled($objects, $transaction);
return;
}
- elseif ($status != 'Completed') {
- $this->unhandled($objects, $transaction);
+ elseif ($status !== 'Completed') {
+ Civi::log()->debug('Returning since contribution status is not handled');
return;
}
if ($contribution->contribution_status_id == $completedStatusId) {
$transaction->commit();
Civi::log()->debug('PayPalProIPN: Returning since contribution has already been handled.');
- echo "Success: Contribution has already been handled<p>";
+ echo 'Success: Contribution has already been handled<p>';
return;
}