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

Fix removal of express payment method from state #44633

Merged
merged 7 commits into from Feb 16, 2024

Conversation

tarunvijwani
Copy link
Contributor

@tarunvijwani tarunvijwani commented Feb 15, 2024

Submission Review Guidelines:

Changes proposed in this Pull Request:

With this PR, we are fixing the behavior of the REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD reducer to correctly remove the specified express payment method.

Closes #44694.

How to test the changes in this Pull Request:

Using the WooCommerce Testing Instructions Guide, include your detailed testing instructions:

  1. Enable Stripe and Paypal express payment methods.
  2. Add a product to the Cart and visit the Checkout block page.
  3. Notice there are 3 express checkout buttons.
  4. Open console log and run wp.data.dispatch( 'wc/store/payment').__internalRemoveAvailableExpressPaymentMethod('payment_request') code to remove stripe's express payment method.
  5. Confirm stripe express payment method is removed correctly.

Changelog entry

  • Automatically create a changelog entry from the details below.

Significance

  • Patch
  • Minor
  • Major

Type

  • Fix - Fixes an existing bug
  • Add - Adds functionality
  • Update - Update existing functionality
  • Dev - Development related task
  • Tweak - A minor adjustment to the codebase
  • Performance - Address performance issues
  • Enhancement - Improvement to existing functionality

Message

Fixed a bug where express payment methods could not be removed from the wc/store/payment data store.

Comment

- Correct the logic for removing an express payment method from the availableExpressPaymentMethods state object.
- Previously, the deletion targeted the incorrect object, leading to incorrect change in state. Now, the correct entry is removed using destructuring and rest parameters, ensuring the express payment method is properly deleted.
Copy link
Contributor

github-actions bot commented Feb 15, 2024

Test Results Summary

Commit SHA: db387c8

Test 🧪Passed ✅Failed 🚨Broken 🚧Skipped ⏭️Unknown ❔Total 📊Duration ⏱️
API Tests25900202610m 37s
E2E Tests296002903256m 34s

To view the full API test report, click here.
To view the full E2E test report, click here.
To view all test reports, visit the WooCommerce Test Reports Dashboard.

@tarunvijwani tarunvijwani self-assigned this Feb 16, 2024
@tarunvijwani tarunvijwani added the team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues label Feb 16, 2024
@github-actions github-actions bot added the plugin: woocommerce Issues related to the WooCommerce Core plugin. label Feb 16, 2024
Copy link
Contributor

github-actions bot commented Feb 16, 2024

Hi @opr,

Apart from reviewing the code changes, please make sure to review the testing instructions as well.

You can follow this guide to find out what good testing instructions should look like:
https://github.com/woocommerce/woocommerce/wiki/Writing-high-quality-testing-instructions

@tarunvijwani tarunvijwani marked this pull request as ready for review February 16, 2024 13:29
@woocommercebot woocommercebot requested a review from a team February 16, 2024 13:34
Copy link
Contributor

@opr opr left a comment

Choose a reason for hiding this comment

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

Thanks @tarunvijwani this is testing OK for me, the code changes look 99% good too, just a couple of changes needed (I don't think the reducer test is a huge deal, but it would be nice to make sure we're being consistent with the test data vs. real life data)

@tarunvijwani
Copy link
Contributor Author

Thanks @tarunvijwani this is testing OK for me, the code changes look 99% good too, just a couple of changes needed (I don't think the reducer test is a huge deal, but it would be nice to make sure we're being consistent with the test data vs. real life data)

Thank you so much for the suggestion. I have updated the tests and changelog. 👍

Copy link
Contributor

@opr opr left a comment

Choose a reason for hiding this comment

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

Thanks Tarun, looks good now! 👏🏼

@tarunvijwani
Copy link
Contributor Author

Thank you for reviewing the PR, @opr! 🎉

@tarunvijwani tarunvijwani merged commit 7528a7d into trunk Feb 16, 2024
59 checks passed
@tarunvijwani tarunvijwani deleted the fix/available-express-payment-method-removal branch February 16, 2024 19:00
@github-actions github-actions bot added this to the 8.7.0 milestone Feb 16, 2024
@github-actions github-actions bot added the needs: analysis Indicates if the PR requires a PR testing scrub session. label Feb 16, 2024
@Stojdza Stojdza added needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. status: analysis complete Indicates if a PR has been analysed by Solaris and removed needs: analysis Indicates if the PR requires a PR testing scrub session. labels Feb 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: external testing Indicates if the PR requires further testing conducted by testers external to the development team. plugin: woocommerce Issues related to the WooCommerce Core plugin. status: analysis complete Indicates if a PR has been analysed by Solaris team: Rubik Store API checkout endpoints, Mini-Cart, Cart and Checkout related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

REMOVE_AVAILABLE_EXPRESS_PAYMENT_METHOD reducer not working correctly
3 participants