CRM-17647 fix for submitting payment with thousand separator
authoreileen <emcnaughton@wikimedia.org>
Wed, 17 Jan 2018 22:56:05 +0000 (11:56 +1300)
committereileen <emcnaughton@wikimedia.org>
Sat, 10 Feb 2018 00:20:57 +0000 (13:20 +1300)
CRM/Contribute/BAO/Contribution.php
CRM/Event/Form/Participant.php
tests/phpunit/CRM/Core/Payment/AuthorizeNetTest.php
tests/phpunit/CRM/Financial/BAO/FinancialAccountTest.php

index b4fe8f809a88d614b96a4a9ced7414cbe948e815..05459a3f99be9fcf468d2f0058241ab424d527d7 100644 (file)
@@ -132,6 +132,7 @@ class CRM_Contribute_BAO_Contribution extends CRM_Contribute_DAO_Contribution {
     else {
       // @todo put a deprecated here - this should be done in the form layer.
       $params['skipCleanMoney'] = FALSE;
+      Civi::log()->warning('Deprecated code path. Money should always be clean before it hits the BAO.', array('civi.tag' => 'deprecated'));
     }
 
     foreach ($moneyFields as $field) {
index b9a1dec7cdcfc824195bb7deb549a5065e972bad..b7958bb4a0780a42cf064a0aaecbd47ae2f7f78e 100644 (file)
@@ -986,7 +986,7 @@ class CRM_Event_Form_Participant extends CRM_Contribute_Form_AbstractEditPayment
     }
     if ($this->_isPaidEvent) {
 
-      $contributionParams = array();
+      $contributionParams = array('skipCleanMoney' => TRUE);
       $lineItem = array();
       $additionalParticipantDetails = array();
       if (CRM_Contribute_BAO_Contribution::checkContributeSettings('deferred_revenue_enabled')) {
index 5bb68f8c586683a3e5f2fd1c0d6091ffd62813ba..3575a24e761fde1a86b469c1e11c1cf2b800fc6f 100644 (file)
@@ -88,7 +88,7 @@ class CRM_Core_Payment_AuthorizeNetTest extends CiviUnitTestCase {
       'is_test' => 1,
       'contribution_status_id' => 2,
     );
-    $contribution = CRM_Contribute_BAO_Contribution::add($contributionParams);
+    $contribution = $this->callAPISuccess('Contribution', 'create', $contributionParams);
 
     $params = array(
       'qfKey' => '08ed21c7ca00a1f7d32fff2488596ef7_4454',
index c67c76422b955d1daf620eafa9a8723ff94c357a..d3b284f1c45571ca442a4a3bc0bfe134195d0284 100644 (file)
@@ -145,7 +145,7 @@ class CRM_Financial_BAO_FinancialAccountTest extends CiviUnitTestCase {
       'financial_type_id' => $financialType->id,
       'contribution_status_id' => 1,
     );
-    $contributions = CRM_Contribute_BAO_Contribution::create($contributionParams);
+    $this->callAPISuccess('Contribution', 'create', $contributionParams);
     CRM_Financial_BAO_FinancialAccount::del($result->id);
     $params = array('id' => $result->id);
     $result = CRM_Financial_BAO_FinancialAccount::retrieve($params, $defaults);