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

Removing saved cards when setting is disabled #3189

Merged
merged 5 commits into from
Jun 10, 2024

Conversation

wjrosa
Copy link
Contributor

@wjrosa wjrosa commented Jun 7, 2024

Fixes #3142

Changes proposed in this Pull Request:

Currently, when disabling the "Enable payments via saved cards" settings in the new checkout experience, selecting the previously saved cards is still possible. This PR fixes that by filtering the saved cards when the setting is "on".

Testing instructions

  • With "Enable the legacy checkout experience" disabled, go to Stripe settings, and click off Enable payments via saved cards
  • Checkout as a user with previously saved payment methods
  • On this branch, previously saved payment methods will not be displayed
  • Also, you won't be able to save a new card

  • Covered with tests (or have a good reason not to test in description ☝️)
  • Added changelog entry in both changelog.txt and readme.txt (or does not apply)
  • Tested on mobile (or does not apply)

Post merge

@wjrosa wjrosa self-assigned this Jun 7, 2024
@wjrosa wjrosa requested review from a team and diegocurbelo and removed request for a team June 7, 2024 21:23
@wjrosa wjrosa marked this pull request as ready for review June 7, 2024 21:23
Copy link
Member

@diegocurbelo diegocurbelo left a comment

Choose a reason for hiding this comment

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

Thanks for fixing this, @wjrosa, tests nicely 👍🏼

I added a suggestion to update the woocommerce_saved_payment_methods_list filter callback phpdoc

@wjrosa wjrosa requested a review from diegocurbelo June 10, 2024 14:06
@wjrosa wjrosa merged commit d47d6d2 into develop Jun 10, 2024
33 checks passed
@wjrosa wjrosa deleted the fix/removing-saved-cards-when-setting-is-disabled branch June 10, 2024 21:35
Mayisha pushed a commit that referenced this pull request Jun 13, 2024
* Removing saved cards when setting is disabled

* Changelog and readme updates

* Adding specific unit tests

* Update includes/payment-methods/class-wc-stripe-upe-payment-gateway.php

Co-authored-by: Diego Curbelo <diego@curbelo.com>

---------

Co-authored-by: Wesley Rosa <wesley.rosa@automattic.com>
Co-authored-by: Diego Curbelo <diego@curbelo.com>
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.

Disabling saved payment methods does not work
2 participants