-
Notifications
You must be signed in to change notification settings - Fork 69
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
Use shared dispute utility function isRefundable
for disputed order notice to improve code quality
#7965
Conversation
@@ -66,7 +62,7 @@ const DisputedOrderNoticeHandler = ( { chargeId, onDisableOrderRefund } ) => { | |||
// This may be dead code. Leaving in for now as this is consistent with | |||
// the logic before this PR. | |||
// https://github.com/Automattic/woocommerce-payments/pull/7557 | |||
if ( dispute.status === 'lost' && ! isRefundable ) { |
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.
isRefundable
is redundant here since isRefundable('lost')
will always be false
if dispute.status === 'lost'
.
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
isRefundable
util function for disputed order notice
Size Change: -7 B (0%) Total Size: 1.27 MB
ℹ️ View Unchanged
|
…ther actions in the future
…o dev/refactor-order-dispute-refundable-util
…o dev/refactor-order-dispute-refundable-util
isRefundable
util function for disputed order noticeisRefundable
for disputed order notice
isRefundable
for disputed order noticeisRefundable
for disputed order notice to improve code quality
SP 0, a followup from #7962 |
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.
Reviewed code, small change looks good.
Have not tested.
Thanks @brucealdridge. I have confirmed that the flows as described in the PR description are working as expected. Adding to merge queue 🚢 |
Changes proposed in this Pull Request
This PR utilises the shared dispute util function
isRefundable
to determine if a disputed order is refundable on the order screen.woocommerce-payments/client/disputes/utils.ts
Lines 75 to 78 in ea14b50
Testing instructions
Note: PR author has confirmed that the following flows are working as expected
4000000000000259
at checkout.winning_evidence
in the "additional details" field.4000000000001976
at checkout.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge