Commit df201085 authored by mattwire's avatar mattwire
Browse files

Don't allow refunds on negative amounts or if there is no trxn_id

parent 93064c6f
......@@ -233,6 +233,13 @@ function mjwshared_civicrm_links($op, $objectName, $objectId, &$links, &$mask, &
if ((int)$payment['status_id'] !== CRM_Core_PseudoConstant::getKey('CRM_Contribute_BAO_Contribution', 'contribution_status_id', 'Completed')) {
// Don't allow refunds if we have no trxn_id to match it against.
if (empty($payment['trxn_id'])) {
if ($payment['total_amount'] < 0) {
$paymentProcessor = \Civi\Payment\System::singleton()
if ($paymentProcessor->supportsRefund()) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment