Skip to content

POC - Refactoring settings (2) #4412

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

Draft
wants to merge 1 commit into
base: develop
Choose a base branch
from
Draft

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Jun 17, 2025

Fixes STRIPE-<linear_issue_id>
Fixes #<github_issue_id>

Changes proposed in this Pull Request:

Testing instructions


  • Covered with tests (or have a good reason not to test in description ☝️)
  • Tested on mobile (or does not apply)

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Post merge

@wjrosa wjrosa self-assigned this Jun 17, 2025
@wjrosa
Copy link
Contributor Author

wjrosa commented Jun 17, 2025

@woocommerce/quark I tried to update the settings retrieval code with the main WC_Stripe class (as @diegocurbelo suggested during the meetup). See some of the results here. That did not work because some classes we instantiate inside WC_Stripe (like WC_Stripe_Payment_Request) require the settings. That was causing an infinite loop. The solution would be to access the options on those classes directly, but that would leave us with two different standards anyway.

Today, I came up with this solution here instead. Although it introduces a new class, it uses the singleton pattern and also guarantees that settings are always fresh when updated. What do you think?

This is just a POC PR. If you think the approach is nice, we can work on this later with multiple smaller PRs.

@wjrosa wjrosa changed the title Settings refactor POC POC - Refactoring settings (2) Jun 17, 2025
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.

1 participant