Refund by items: Full refund flow - Step 6#1635
Refund by items: Full refund flow - Step 6#1635anitaa1990 merged 21 commits intofeature/refund-by-items-masterfrom
Conversation
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/orders/AddOrderShipmentTrackingFragment.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt
|
You can test the changes on this Pull Request by downloading the APK here. |
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/RefundByItemsFragment.kt # WooCommerce/src/main/res/layout/refund_by_items_products.xml # build.gradle
# Conflicts: # WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/IssueRefundViewModel.kt
anitaa1990
left a comment
There was a problem hiding this comment.
Changes look good @0nko!! Just left a couple of comments in the code. There were some minor issues faced when testing that I have listed below:
- If we click on the back button and go to the Order detail screen, when the refund is being processed, the Order detail is not refreshed when the refresh is completed and there is no snackbar to indicate the the refund was successfully processed.
- I refunded all the items from the product list and there was still $4.99 left (this was due to shipping). But I am not able to see the
Issue refundbutton anymore. But when I click on theHomebutton and open the app again, theIssue Refundbutton is displayed. Note that I hadDo not keep activitiesenabled on my device.
(LEFT: Before clicking on Home button after successful refund)
(RIGHT: After opening the app again)
. 
| CREATE_ORDER_REFUND_TAB_CHANGED, | ||
| CREATE_ORDER_REFUND_SELECT_ALL_ITEMS_BUTTON_TAPPED, | ||
| CREATE_ORDER_REFUND_ITEM_QUANTITY_DIALOG_OPENED, | ||
| CREATE_ORDER_REFUND_PRODUCT_AMOUNT_DIALOG_OPENED, |
There was a problem hiding this comment.
np: I didn't find any of these events in the event streadsheet. Just mentioning it here so it doesn't get missed, we would need to add all new events to the event streadsheet and validate/register them :)
There was a problem hiding this comment.
I've added the events to the spreadsheet. Thanks for checking!
| app:layout_constraintTop_toTopOf="@id/issueRefund_lblProductsTotal" | ||
| tools:text="$1.00"/> | ||
|
|
||
| <!-- <androidx.appcompat.widget.AppCompatButton--> |
There was a problem hiding this comment.
np: Can we add a some explanation here on why this is commented out so we don't forget and delete it by accident in the future?
| issueRefund_productsTotal.setOnClickListener { | ||
| viewModel.onProductRefundAmountTapped() | ||
| } | ||
| // will be used in the future |
There was a problem hiding this comment.
np: same comment here. Would it be possible to explain why this is commented out so we don't accidentally delete it in the future?
This reverts commit d599bbf.
| issueRefund_selectButton.text = it | ||
| } | ||
| // temporarily hidden | ||
|
|
There was a problem hiding this comment.
Reporter: Checkstyle
Rule: no-trailing-spaces
Severity: ERROR
File: /home/circleci/project/WooCommerce/src/main/kotlin/com/woocommerce/android/ui/refunds/RefundByItemsFragment.kt L98
Trailing space(s)
|
Thanks for the review, @anitaa1990!
I've disabled the button during the refund process. I know it's not an ideal UX but it'd complicate things a lot to keep the job running in the background on a global scope. Plus I don't think it's gonna happen too often.
This one's weird. I think it has something to do with the rounding errors. I've added rounding fix for the Refund model, which was missing. As for the shipping refund, this is not supported by the API at the moment (only using refund by amount, which screws up the reports). So once the full product amount is refunded, refunding is not allowed anymore. This will be fixed once the API supports refund shipping properly. |
Generated by 🚫 dangerJS |
anitaa1990
left a comment
There was a problem hiding this comment.
Looks good! Thanks for the explanation! So the way I understand it, we cannot fully refund an order now, correct? Because everytime I try to refund the full order by selecting Select All, there is still some amount left, which is because of shipping. And since we have temporarily removed the option to refund via amount, the user will not be able to refund the order and the status will remain Processing. Is that correct?
|
That's right. Unfortunately. |

This PR brings the complete refund-by-items flow.
To test: