Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of deprecated paymentProcessorType function #12039

Merged

Conversation

mattwire
Copy link
Contributor

Overview

This cleans up and removes usage of deprecated CRM_Core_PseudoConstant::paymentProcessorType in favour of standard getKey/getName functions. Duplicated code from getPayment is also removed and consolidated into a single function.

Before

Duplicated code and usage of deprecated function.

After

Removed duplicated code and usage of deprecated function.

@mattwire
Copy link
Contributor Author

This came out of work done on #12007

@eileenmcnaughton
Copy link
Contributor

test this please

@@ -430,7 +430,6 @@ public static function formRule($fields, $files, $self) {
$paymentProcessorID,
'payment_processor_type_id'
);
$paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $paymentProcessorTypeId, 'name');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In fact this whole chunk seems to do nothing?

    if (!empty($fields['is_recur_interval'])) {
      foreach (array_keys($fields['payment_processor']) as $paymentProcessorID) {
        $paymentProcessorTypeId = CRM_Core_DAO::getFieldValue(
          'CRM_Financial_DAO_PaymentProcessor',
          $paymentProcessorID,
          'payment_processor_type_id'
        );
        $paymentProcessorType = CRM_Core_PseudoConstant::paymentProcessorType(FALSE, $paymentProcessorTypeId, 'name');
      }
    }

@eileenmcnaughton
Copy link
Contributor

I read through this pretty carefully & I'm confident the change is as intended & it is just a simplification. I stepped through the code results for getPayment in a debugger from submitting a back office participant record & it seemed fine

@seamuslee001
Copy link
Contributor

Jenkins retest this please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants