From: eileen Date: Wed, 7 Apr 2021 20:36:42 +0000 (+1200) Subject: dev/core#2493 Default to not cleaning money for order.create api X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2c35902f0f85fe9a7091a8dc4801673852ca1dfa;p=civicrm-core.git dev/core#2493 Default to not cleaning money for order.create api --- diff --git a/api/v3/Order.php b/api/v3/Order.php index c108b82218..8e9c5b89dc 100644 --- a/api/v3/Order.php +++ b/api/v3/Order.php @@ -239,6 +239,11 @@ function _civicrm_api3_order_create_spec(&$params) { 'name' => 'total_amount', 'title' => 'Total Amount', ]; + $params['skipCleanMoney'] = [ + 'api.default' => TRUE, + 'title' => 'Do not attempt to convert money values', + 'type' => CRM_Utils_Type::T_BOOLEAN, + ]; $params['financial_type_id'] = [ 'name' => 'financial_type_id', 'title' => 'Financial Type', diff --git a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php index ce2e193a07..5590511d9e 100644 --- a/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php +++ b/tests/phpunit/CRM/Contribute/BAO/ContributionTest.php @@ -1123,6 +1123,7 @@ WHERE eft.entity_id = %1 AND ft.to_financial_account_id <> %2"; 'receipt_date' => '20080522000000', 'total_amount' => '20,000.00', 'api.Payment.create' => ['total_amount' => '8,000.00'], + 'skipCleanMoney' => FALSE, ]; $contribution = $this->callAPISuccess('Order', 'create', $params);