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] Tapping Order Complete button should be equivalent tapping Mark as Paid #11587

Conversation

backwardstruck
Copy link
Contributor

@backwardstruck backwardstruck commented May 26, 2024

Closes: #11583

Description

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 (try again without entering anything)
  5. Tap "Mark Order As Complete" button

Expected:

  • Screen should close and return to the order screen (closing the payment method screen as well)
  • The order should be marked as paid/completed
  • Amount paid should be accurate on the order
  • 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.

@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

@backwardstruck backwardstruck added this to the 18.9 milestone May 26, 2024
@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
Commitd5747fb
Direct Downloadwoocommerce-prototype-build-pr11587-d5747fb.apk

@codecov-commenter
Copy link

codecov-commenter commented May 26, 2024

Codecov Report

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

Project coverage is 40.34%. Comparing base (484b8d7) to head (d5747fb).
Report is 49 commits behind head on trunk.

Files Patch % Lines
...hangeduecalculator/ChangeDueCalculatorViewModel.kt 58.33% 5 Missing ⚠️
...ts/methodselection/SelectPaymentMethodViewModel.kt 0.00% 4 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #11587      +/-   ##
============================================
- Coverage     40.34%   40.34%   -0.01%     
  Complexity     5199     5199              
============================================
  Files          1087     1087              
  Lines         63250    63265      +15     
  Branches       8669     8671       +2     
============================================
+ Hits          25519    25524       +5     
- Misses        35436    35445       +9     
- Partials       2295     2296       +1     

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

@backwardstruck backwardstruck changed the base branch from trunk to 11525-change-due-calculator-ui-part-4 May 26, 2024 20:35
@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
Base automatically changed from 11525-change-due-calculator-ui-part-4 to 11525-change-due-calculator-ui-part-3 May 27, 2024 15:26
…ng-order-complete-button-equivalent-tapping-mark-as-paid
@backwardstruck backwardstruck marked this pull request as ready for review May 27, 2024 19:21
Base automatically changed from 11525-change-due-calculator-ui-part-3 to trunk May 28, 2024 13:57
@kidinov kidinov self-assigned this May 28, 2024
@@ -70,6 +74,16 @@
<argument
android:name="orderId"
app:argType="long" />

<action
android:id="@+id/action_changeDueCalculatorFragment_to_selectPaymentMethodFragment"
Copy link
Contributor

@kidinov kidinov May 28, 2024

Choose a reason for hiding this comment

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

Shell, you go back and bring result with "is order paid = true/false" instead of going forward and passing "true" always? Check the setupResultHandlers method in SelectPaymentMethodFragment - I believe they do pretty much the same as what you need in order to deliver the result back

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks. I'll do it that way instead as you suggested. Added to this ticket for my draft PR:
#11585

@kidinov
Copy link
Contributor

kidinov commented May 28, 2024

Overall some things I noted (sorry if this is already fixed in the following PRs and I repeat myself):

  • I think there is something wrong with margins/paddings on the UI (vertically it should be either 8/16 or 32 in some cases, and horizontally sheel we have 16 margins from the borders of the screen)? The button is not aligned with input field on the right. The input field has large margin on the left than on the right
  • The screen is not scrollable so not possible to click the button when the keyboard is visible
  • In the PR description, it says

Switched to WCOutlinedTypedTextField like it's used in OrderCreateEditProductDiscountScreen and changed the button to use WCColoredButton as suggested here by @kidinov

But I still see WCMaterialOutlinedCurrencyEditTextView is being used

  • We'd need to fix the layout for the text that displays the change
image
  • Just an advice for the future PR - better to make the not toggle "clickable" including the text itself and with some padding so it's easier to tap on

@kidinov kidinov self-requested a review May 28, 2024 15:10
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.

There are a few notes I left which I think worth attention, but you can fix them in the open PR so not blocking this one

@kidinov kidinov merged commit 0ca694b into trunk May 28, 2024
18 of 20 checks passed
@kidinov kidinov deleted the 11583-tapping-order-complete-button-equivalent-tapping-mark-as-paid branch May 28, 2024 15:11
@backwardstruck
Copy link
Contributor Author

Overall some things I noted (sorry if this is already fixed in the following PRs and I repeat myself):

  • I think there is something wrong with margins/paddings on the UI (vertically it should be either 8/16 or 32 in some cases, and horizontally sheel we have 16 margins from the borders of the screen)? The button is not aligned with input field on the right. The input field has large margin on the left than on the right
  • The screen is not scrollable so not possible to click the button when the keyboard is visible
  • In the PR description, it says

Switched to WCOutlinedTypedTextField like it's used in OrderCreateEditProductDiscountScreen and changed the button to use WCColoredButton as suggested here by @kidinov

But I still see WCMaterialOutlinedCurrencyEditTextView is being used

  • We'd need to fix the layout for the text that displays the change
image * Just an advice for the future PR - better to make the not toggle "clickable" including the text itself and with some padding so it's easier to tap on

Sorry for the confusion @kidinov my PR description was innaccurate. Those changes are in this PR:

https://github.com/woocommerce/woocommerce-android/pull/11593/commits

I will update the margin and padding there as well.

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
5 participants