dev/core#2493 Default to not cleaning money for order.create api
authoreileen <emcnaughton@wikimedia.org>
Wed, 7 Apr 2021 20:36:42 +0000 (08:36 +1200)
committereileen <emcnaughton@wikimedia.org>
Wed, 7 Apr 2021 22:45:53 +0000 (10:45 +1200)
api/v3/Order.php
tests/phpunit/CRM/Contribute/BAO/ContributionTest.php

index c108b82218923b5f57182a641f0028b1f81105f9..8e9c5b89dc8b9e32fcbae163b8d610fc1fccd455 100644 (file)
@@ -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',
index ce2e193a07493f52b5c70e796d867a328a56e28d..5590511d9ec8a6ec921c7a200bfa5afd5aedc4a0 100644 (file)
@@ -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);