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

REF Access the method not the property directly to check if a payment processor supports recurring #17602

Merged
merged 1 commit into from
Jul 1, 2020

Conversation

mattwire
Copy link
Contributor

Overview

We have access to the payment processor object and should check the method rather than the metadata directly to see if the processor supports recurring. A processor can override the supportsRecurring() and could choose to return different values based on context.

Before

Property accessed directly.

After

Method accessed (which by default reads the property).

Technical Details

Comments

@civibot
Copy link

civibot bot commented Jun 13, 2020

(Standard links)

@civibot civibot bot added the master label Jun 13, 2020
@eileenmcnaughton
Copy link
Contributor

OK - this supportsRecurring function returns 'is_recur' if not overridden

  /**
   * Checks if payment processor supports recurring contributions
   *
   * @return bool
   */
  public function supportsRecurring() {
    if (!empty($this->_paymentProcessor['is_recur'])) {
      return TRUE;
    }
    return FALSE;
  }

So this should have no impact unless a processor choses to override it. I didn't find instances of extensions that DO override it in a quick check (Omnipay, Iats) which makes sense as it has not been an integral part of our system & was added as part of a membershipType form cleanup.

I think this is pretty safe. Merging

@eileenmcnaughton eileenmcnaughton merged commit 9c651cb into civicrm:master Jul 1, 2020
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.

2 participants