Finish deprecating BaseIPN->completeTransaction
authoreileen <emcnaughton@wikimedia.org>
Sat, 5 Sep 2020 22:59:14 +0000 (10:59 +1200)
committereileen <emcnaughton@wikimedia.org>
Sat, 5 Sep 2020 22:59:14 +0000 (10:59 +1200)
This has been marked deprecated, but still called for a long timme.

Now that it is just a one-liner I think it's cleaner if the core processors that use it do the one line
directly

CRM/Core/Payment/AuthorizeNetIPN.php
CRM/Core/Payment/BaseIPN.php
CRM/Core/Payment/PayPalIPN.php
CRM/Core/Payment/PayPalProIPN.php

index 83697bd338fa7f7da2e3aa99bbc420a78e136ae7..ca4de653532f3618e0dc00465a8fbb5819c3ff7a 100644 (file)
@@ -182,7 +182,11 @@ class CRM_Core_Payment_AuthorizeNetIPN extends CRM_Core_Payment_BaseIPN {
       return TRUE;
     }
 
-    $this->completeTransaction($input, $ids, $objects);
+    CRM_Contribute_BAO_Contribution::completeOrder($input, [
+      'related_contact' => $ids['related_contact'] ?? NULL,
+      'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
+      'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
+    ], $objects);
 
     // Only Authorize.net does this so it is on the a.net class. If there is a need for other processors
     // to do this we should make it available via the api, e.g as a parameter, changing the nuance
index d99c8c8f80cff9a8b77217557732b5c6db6eecf7..518e35a2d2eda1b049335c8c19bbb6c624ecaee6 100644 (file)
@@ -461,6 +461,7 @@ class CRM_Core_Payment_BaseIPN {
    * @throws \CiviCRM_API3_Exception
    */
   public function completeTransaction($input, $ids, $objects) {
+    CRM_Core_Error::deprecatedFunctionWarning('Use Payment.create api');
     CRM_Contribute_BAO_Contribution::completeOrder($input, [
       'related_contact' => $ids['related_contact'] ?? NULL,
       'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
index 289bdcd74558a9ac394dcde49c8a5431648da4e6..830f085a073543107e6dec199c4d1ca481f2bb00 100644 (file)
@@ -276,7 +276,11 @@ class CRM_Core_Payment_PayPalIPN extends CRM_Core_Payment_BaseIPN {
       return;
     }
 
-    $this->completeTransaction($input, $ids, $objects);
+    CRM_Contribute_BAO_Contribution::completeOrder($input, [
+      'related_contact' => $ids['related_contact'] ?? NULL,
+      'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
+      'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
+    ], $objects);
   }
 
   /**
index 024d845b427ae3b15db26653d2794f5baf253105..a0f418eeee031c97366fe2d96c9f5285fad9dc14 100644 (file)
@@ -373,7 +373,11 @@ class CRM_Core_Payment_PayPalProIPN extends CRM_Core_Payment_BaseIPN {
       return;
     }
 
-    $this->completeTransaction($input, $ids, $objects);
+    CRM_Contribute_BAO_Contribution::completeOrder($input, [
+      'related_contact' => $ids['related_contact'] ?? NULL,
+      'participant' => !empty($objects['participant']) ? $objects['participant']->id : NULL,
+      'contributionRecur' => !empty($objects['contributionRecur']) ? $objects['contributionRecur']->id : NULL,
+    ], $objects);
   }
 
   /**