return [FALSE, $isARefund];
}
}
- // @todo - figure out when, if ever this is reached.
return [TRUE, $isARefund];
}
$trxnID = NULL;
$inputParams = $params;
$isARefund = FALSE;
- $currentContributionStatus = CRM_Core_PseudoConstant::getLabel('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $params['contribution']->contribution_status_id);
+ $currentContributionStatus = CRM_Core_PseudoConstant::getName('CRM_Contribute_BAO_Contribution', 'contribution_status_id', $params['contribution']->contribution_status_id);
$previousContributionStatus = CRM_Contribute_PseudoConstant::contributionStatus($params['prevContribution']->contribution_status_id, 'name');
if (($previousContributionStatus == 'Pending'
'contribution_id' => $contribution['id'],
'total_amount' => 40,
);
+ // Rename the 'completed' status label first to check that we are not using the labels!
+ $this->callAPISuccess('OptionValue', 'get', ['name' => 'Completed', 'option_group_id' => 'contribution_status', 'api.OptionValue.create' => ['label' => 'Unicorn']]);
$payment = $this->callAPISuccess('Payment', 'create', $params);
$expectedResult = array(
$payment['id'] => array(
$this->assertEquals($eft['values'][$eft['id']]['amount'], 40);
// Check contribution for completed status
$contribution = $this->callAPISuccess('contribution', 'get', array('id' => $contribution['id']));
- $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status'], 'Completed');
+ $this->assertEquals($contribution['values'][$contribution['id']]['contribution_status'], 'Unicorn');
$this->assertEquals($contribution['values'][$contribution['id']]['total_amount'], 100.00);
$this->callAPISuccess('Contribution', 'Delete', array(
'id' => $contribution['id'],
));
+ $this->callAPISuccess('OptionValue', 'get', ['name' => 'Completed', 'option_group_id' => 'contribution_status', 'api.OptionValue.create' => ['label' => 'Completed']]);
+
}
/**