Re-apply useful cleanups from reverted commits
authoreileen <emcnaughton@wikimedia.org>
Mon, 4 Nov 2019 22:06:46 +0000 (11:06 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 4 Nov 2019 22:08:41 +0000 (11:08 +1300)
CRM/Core/Payment.php
api/v3/PaymentProcessor.php

index 69b97a342fbe7cb885e0c2dd71f5c62cef8b4fd5..91a7c0be8c53f059a4b5334125b1c43ab43a5ef8 100644 (file)
@@ -81,7 +81,7 @@ abstract class CRM_Core_Payment {
     RECURRING_PAYMENT_END = 'END';
 
   /**
-   * @var object
+   * @var array
    */
   protected $_paymentProcessor;
 
@@ -257,8 +257,6 @@ abstract class CRM_Core_Payment {
    * @todo move to factory class \Civi\Payment\System (or similar)
    *
    * @param array $params
-   *
-   * @return mixed
    */
   public static function logPaymentNotification($params) {
     $message = 'payment_notification ';
index e2406dc5d0af2cbe11c645fc64f77fb9d6fccf78..c2e5e4e16327e911c2a9963fe8160c164b127912 100644 (file)
@@ -124,8 +124,10 @@ function _civicrm_api3_payment_processor_getlist_defaults(&$request) {
  *   API result array.
  *
  * @throws \API_Exception
+ * @throws \CiviCRM_API3_Exception
  */
 function civicrm_api3_payment_processor_pay($params) {
+  /* @var CRM_Core_Payment $processor */
   $processor = Civi\Payment\System::singleton()->getById($params['payment_processor_id']);
   $processor->setPaymentProcessor(civicrm_api3('PaymentProcessor', 'getsingle', ['id' => $params['payment_processor_id']]));
   try {
@@ -149,7 +151,7 @@ function civicrm_api3_payment_processor_pay($params) {
  */
 function _civicrm_api3_payment_processor_pay_spec(&$params) {
   $params['payment_processor_id'] = [
-    'api.required' => 1,
+    'api.required' => TRUE,
     'title' => ts('Payment processor'),
     'type' => CRM_Utils_Type::T_INT,
   ];