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
Fix removal of express payment method from state #44633
Conversation
- 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.
Test Results SummaryCommit SHA: db387c8
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. |
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: |
There was a problem hiding this 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)
plugins/woocommerce-blocks/assets/js/data/payment/test/reducers.js
Outdated
Show resolved
Hide resolved
plugins/woocommerce/changelog/44633-fix-available-express-payment-method-removal
Outdated
Show resolved
Hide resolved
Thank you so much for the suggestion. I have updated the tests and changelog. 👍 |
There was a problem hiding this 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! 👏🏼
Thank you for reviewing the PR, @opr! 🎉 |
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:
wp.data.dispatch( 'wc/store/payment').__internalRemoveAvailableExpressPaymentMethod('payment_request')
code to remove stripe's express payment method.Changelog entry
Significance
Type
Message
Fixed a bug where express payment methods could not be removed from the wc/store/payment data store.
Comment