Closed samiuelson closed 2 days ago
3 Errors | |
---|---|
:no_entry_sign: | Please add tests for class CardReaderPaymentOrRefundState (or add unit-tests-exemption label to ignore this). |
:no_entry_sign: | Please add tests for class CardReaderPaymentState (or add unit-tests-exemption label to ignore this). |
:no_entry_sign: | This PR is tagged with status: do not merge label(s). |
1 Warning | |
---|---|
:warning: | This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews. |
Generated by :no_entry_sign: Danger
App Name | WooCommerce-Wear Android | |
Platform | ⌚️ Wear OS | |
Flavor | Jalapeno | |
Build Type | Debug | |
Commit | 0c4e9ecd9955fdb198590ec6794774b89e46c450 | |
Direct Download | woocommerce-wear-prototype-build-pr12877-0c4e9ec.apk |
📲 You can test the changes from this Pull Request in WooCommerce Android by scanning the QR code below to install the corresponding build.
App Name | WooCommerce Android | |
Platform | 📱 Mobile | |
Flavor | Jalapeno | |
Build Type | Debug | |
Commit | f75681960fa13d9abce0c6c511387cb6f39fbea4 | |
Direct Download | woocommerce-prototype-build-pr12877-f756819.apk |
Thanks for the reviews @kidinov and @malinajirka 🙇🏼
As discussed, we're going to keep the callbacks in the CardReaderPaymentOrRefundState
. Also, the mapping of CardReaderPaymentOrRefundState
to ViewState
, and removing viewStateData
from controller (bringing the controller to the final shape) is ready for review in the next PR: [POS] Custom payment UI — Part 4 | Switch from viewStateData to paymentState.
In the current PR, I extracted nameForTracking
from the payment state model (c26ed71, 7fe2991) and moved the logic of the ::trackCancelledFlow
function into a use case class (44115aa).
Let me know what you think!
Thanks for review, @malinajirka!
I haven't run thorough tests since I believe we'll run them on the final PR of this chain of PRs anyway.
That's correct. The build used in the Call for testing (pdfdoF-5Rg-p2) is generated from the next PR that includes payment state to UI state mapping — [POS] Custom payment UI — Part 4 | Switching from viewStateData to paymentState.
Closes: #12825
This is part 3 of 5 PRs refactoring the Payment flow:
⚠️ Don't merge — the branch will be merged together with the above ones after additional testing of the whole refactor.
Description
This PR introduces a new class modeling a "payment state" —
CardReaderPaymentOrRefundState
. It is emitted by thepaymentState: StateFlow<CardReaderPaymentOrRefundState>
property inCardReaderPaymentController
, allowing observing the payment state in POS.The goal of the
paymentState
property is to replace theviewStateData: LiveData<ViewState>
that emits "UI model" instances, designed specifically for the existing dialog-based payment flow UI. For now, theviewStateData
is marked deprecated, and supposed to be used only by the existing IPP flow.Coming up in the next PR:
paymentState
toViewState
inCardReaderPaymentViewModel
Testing information
As a result of the refactoring done within this PR, the app should work without any change. It's crucial to test the IPP flow in the store management and POS modes against regression. It may be useful to base on the test plan (pdfdoF-5Jz-p2).
The tests that have been performed
This PR will be followed up by removing the
viewStateData
property from the controller, adding unit tests, and mapping thepaymentState
toViewState
. That said, this PR should not cause any regression in the existing IPP flow, however, the most important part to test is the code changes.RELEASE-NOTES.txt
if necessary. Use the "[Internal]" label for non-user-facing changes.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: