Merge pull request #22576 from seamuslee001/update_jquery_ui
[civicrm-core.git] / CRM / Core / Payment.php
index 23ad799b85c0fe0d709c4fa75dbec7663d0a7207..6b599e0bf30563cdbc4ff2e789be9a8ac06dc201 100644 (file)
@@ -1166,9 +1166,9 @@ abstract class CRM_Core_Payment {
   protected function getAmount($params = []) {
     if (!CRM_Utils_Rule::numeric($params['amount'])) {
       CRM_Core_Error::deprecatedWarning('Passing Amount value that is not numeric is deprecated please report this in gitlab');
-      return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
+      return CRM_Utils_Money::formatUSLocaleNumericRounded(filter_var($params['amount'], FILTER_SANITIZE_NUMBER_FLOAT, FILTER_FLAG_ALLOW_FRACTION), 2);
     }
-    return CRM_Utils_Money::formatLocaleNumericRoundedByPrecision($params['amount'], 2);
+    return CRM_Utils_Money::formatUSLocaleNumericRounded($params['amount'], 2);
   }
 
   /**
@@ -1279,7 +1279,7 @@ abstract class CRM_Core_Payment {
    *   URL to notify outcome of transaction.
    */
   protected function getNotifyUrl() {
-    $url = CRM_Utils_System::url(
+    $url = CRM_Utils_System::getNotifyUrl(
       'civicrm/payment/ipn/' . $this->_paymentProcessor['id'],
       [],
       TRUE,
@@ -1378,6 +1378,7 @@ abstract class CRM_Core_Payment {
     }
 
     if ($this->_paymentProcessor['billing_mode'] == 4) {
+      CRM_Core_Error::deprecatedFunctionWarning('doPayment', 'doTransferCheckout');
       $result = $this->doTransferCheckout($params, $component);
       if (is_array($result) && !isset($result['payment_status_id'])) {
         $result['payment_status_id'] = array_search('Pending', $statuses);
@@ -1385,6 +1386,7 @@ abstract class CRM_Core_Payment {
       }
     }
     else {
+      CRM_Core_Error::deprecatedFunctionWarning('doPayment', 'doDirectPayment');
       $result = $this->doDirectPayment($params, $component);
       if (is_array($result) && !isset($result['payment_status_id'])) {
         if (!empty($params['is_recur'])) {
@@ -1743,17 +1745,7 @@ abstract class CRM_Core_Payment {
           break;
 
         case 'recur':
-          $sql = "
-    SELECT DISTINCT con.contact_id
-      FROM civicrm_contribution_recur rec
-INNER JOIN civicrm_contribution con ON ( con.contribution_recur_id = rec.id )
-     WHERE rec.id = %1";
-          $contactID = CRM_Core_DAO::singleValueQuery($sql, [
-            1 => [
-              $entityID,
-              'Integer',
-            ],
-          ]);
+          $contactID = CRM_Core_DAO::getFieldValue("CRM_Contribute_DAO_ContributionRecur", $entityID, "contact_id");
           $entityArg = 'crid';
           break;
       }