X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=api%2Fv3%2FContribution.php;h=451e302d5832f505fc2b8a8cd6478fa19e8dc612;hb=00e18848bae4a42a67f0bf07002760ab35f9dd40;hp=6ed8f2a93eb94a073f874f9332abb0784afa9058;hpb=706b70f5b7a5c2ae99fc76a4b892c5bf94e9c3c4;p=civicrm-core.git diff --git a/api/v3/Contribution.php b/api/v3/Contribution.php index 6ed8f2a93e..451e302d58 100644 --- a/api/v3/Contribution.php +++ b/api/v3/Contribution.php @@ -45,6 +45,16 @@ function civicrm_api3_contribution_create(&$params) { $values = array(); _civicrm_api3_custom_format_params($params, $values, 'Contribution'); $params = array_merge($params, $values); + // The BAO should not clean money - it should be done in the form layer & api wrapper + // (although arguably the api should expect pre-cleaned it seems to do some cleaning.) + if (empty($params['skipCleanMoney'])) { + foreach (['total_amount', 'net_amount', 'fee_amount'] as $field) { + if (isset($params[$field])) { + $params[$field] = CRM_Utils_Rule::cleanMoney($params[$field]); + } + } + } + $params['skipCleanMoney'] = TRUE; if (CRM_Financial_BAO_FinancialType::isACLFinancialTypeStatus()) { if (empty($params['id'])) {