Closed samiuelson closed 2 days ago
1 Error | |
---|---|
:no_entry_sign: | This PR is tagged with status: do not merge label(s). |
2 Warnings | |
---|---|
:warning: | This PR is larger than 300 lines of changes. Please consider splitting it into smaller PRs for easier and faster reviews. |
:warning: | Class CardReaderPaymentController is missing tests, but unit-tests-exemption label was set to ignore this. |
Generated by :no_entry_sign: Danger
App Name | WooCommerce-Wear Android | |
Platform | ⌚️ Wear OS | |
Flavor | Jalapeno | |
Build Type | Debug | |
Commit | b51daa9a9fdcac58e22dccf46cc41e1034011c1f | |
Direct Download | woocommerce-wear-prototype-build-pr12853-b51daa9.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 | b51daa9a9fdcac58e22dccf46cc41e1034011c1f | |
Direct Download | woocommerce-prototype-build-pr12853-b51daa9.apk |
Attention: Patch coverage is 91.25000%
with 49 lines
in your changes missing coverage. Please review.
Project coverage is 40.38%. Comparing base (
9c96e74
) to head (f2efc1a
). Report is 133 commits behind head on trunk.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Custom payment UI
Separating payment collection management from Android Framework
Closes: #12824
💡 I tried to keep this PR as small as possible, but I wasn't able to make it into the 300 loc limit. The code was only restructured though—extracted to a new class.
This is part 1 of 5 PRs refactoring the Payment flow:
⚠️ Don't merge — the branch will serve as a base branch for merging the above PRs together, after additional testing.
Description
The intent of this PR is to separate the business logic controlling payment collection and processing process from the framework APIs (like
ViewModel.viewModelScope
,SavedStateHandle
,FragmentArgs
, andDialogFragment
-specific events).CardReaderPaymentViewModel: ScopedViewModel
toCardReaderPaymentController
— plain Kotlin class.5. Additionally,Moved to the next PRCardReaderPaymentController
emits its own events thatCardReaderPaymentViewModel
is mapping to its own ones. Thanks this separationCardReaderPaymentController
doesn't depend on theMultiLiveEvent
making it easier to decouple the whole POS mode from the existing app (e.g. making it easier to extract into a standalone app in the future).Testing information
The refactor introduced by this PR is mostly a code restructuring. As a result, 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
I tested the payment collection flow in both POS and store management modes, using card-present payment and TTP; verified that the IPP flow works and is not changed.
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: