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

Add 'apply_filters' to 'EDD_Download' class 'support_buy_now()' function return value #9679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

maaprote
Copy link

@maaprote maaprote commented Oct 17, 2023

Since EDD v3.2.2, in some custom payment processors plugins like FastSpring by ProtheusPay (https://proteuspay.com/), the 'Buy Now' functionality stop to work with recurring payments. If that's going to be the default behavior (don't work with recurring payments), the ideal would be at least provide a hook to be able to change that behavior with custom code.

Fixes #

Proposed Changes:

  1. Encapsulate the logic to check whether buy now is supported or not in a new 'is_buy_now_supported' function to be able to apply the filter.
  2. Add the filter 'edd_download_supports_buy_now' in the return value from function 'supports_buy_now'

Since EDD v3.2.2, in some custom payment processors plugins like FastSpring by ProtheusPay (https://proteuspay.com/), the 'Buy Now' functionality stopped to work with recurring payments. If that's going to be the default behavior (don't work with recurring payments), the ideal would be at least provide a hook to be able to change that behavior with custom code. A filter hook allowing to change the download 'supports_buy_now()' return value would be sufficient.
@sonarcloud
Copy link

sonarcloud bot commented Oct 17, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell D 5 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

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

Successfully merging this pull request may close these issues.

None yet

1 participant