Skip to content
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

[Payment Method Improvements] Update change due based on user input #11586

Merged
merged 7 commits into from
May 28, 2024

Conversation

backwardstruck
Copy link
Contributor

@backwardstruck backwardstruck commented May 26, 2024

Closes: #11584

Description

I added the unit-tests-exemption label as this PR is dependent on others and will likely change. Updating the test is ticketed here:
#11542

This PR is to update the change due correctly based on the user input for how much cash was given.

Testing instructions

  1. Enable OTHER_PAYMENT_METHODS
  2. Go to an order that needs to be paid
  3. Select "Cash"
  4. Enter a cash value

Expected: You should see the correct values update for Cash received and Change Due

  • I have considered if this change warrants release notes and have added them to RELEASE-NOTES.txt if necessary. Use the "[Internal]" label for non-user-facing changes.

@backwardstruck backwardstruck added type: enhancement A request for an enhancement. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels May 26, 2024
@dangermattic
Copy link
Collaborator

dangermattic commented May 26, 2024

1 Warning
⚠️ Class Success is missing tests, but unit-tests-exemption label was set to ignore this.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 26, 2024

📲 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
FlavorJalapeno
Build TypeDebug
Commit2c1f337
Direct Downloadwoocommerce-prototype-build-pr11586-2c1f337.apk

@backwardstruck backwardstruck marked this pull request as ready for review May 26, 2024 18:21
@backwardstruck backwardstruck added this to the 18.9 milestone May 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 26, 2024

Codecov Report

Attention: Patch coverage is 58.33333% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 40.33%. Comparing base (f99dc1d) to head (2c1f337).
Report is 90 commits behind head on trunk.

Files Patch % Lines
...hangeduecalculator/ChangeDueCalculatorViewModel.kt 58.33% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff            @@
##              trunk   #11586   +/-   ##
=========================================
  Coverage     40.32%   40.33%           
  Complexity     5200     5200           
=========================================
  Files          1087     1087           
  Lines         63229    63239   +10     
  Branches       8667     8668    +1     
=========================================
+ Hits          25500    25505    +5     
- Misses        35435    35440    +5     
  Partials       2294     2294           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kidinov kidinov self-assigned this May 27, 2024
Base automatically changed from 11525-change-due-calculator-ui-part-4 to 11525-change-due-calculator-ui-part-3 May 27, 2024 15:26
@@ -52,4 +58,12 @@ class ChangeDueCalculatorViewModel @Inject constructor(
fun onBackPressed() {
_navigationEvent.value = Unit
}

fun updateAmountReceived(amount: BigDecimal) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be nice to add a test on this logic

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sure, thanks for the suggestion. I will add it in this draft PR:
#11594

Copy link
Contributor

@kidinov kidinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Left a comment regarding the possibility of adding a test

Base automatically changed from 11525-change-due-calculator-ui-part-3 to trunk May 28, 2024 13:57
@kidinov kidinov merged commit 2c1f337 into trunk May 28, 2024
18 checks passed
@kidinov kidinov deleted the 11584-update-change-due-based-on-user-input branch May 28, 2024 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: enhancement A request for an enhancement. unit-tests-exemption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Payment Method Improvements] Update change due based on user input
5 participants