Skip to content

[Payment Method Improvements] Gray out button until payment amount is greater or equal to amount due #11606

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

Merged
merged 13 commits into from
May 30, 2024

Conversation

backwardstruck
Copy link
Contributor

@backwardstruck backwardstruck commented May 29, 2024

Closes: #11604

This PR is branched off of #11594

Description

Gray out "Mark order as complete" button:

  • The "Mark order as complete" button is disabled if the amount of cash received is less than the amount due. This prevents users from completing the order without receiving sufficient payment.

Display correct currency symbol in change due field:

  • The change due field now correctly displays the currency symbol, aligning with the currency used for the transaction.

Testing instructions

  1. Enable OTHER_PAYMENT_METHODS

  2. Gray out button test:

    • Navigate to an order that needs to be paid with cash.
    • Enter a cash received amount that is less than the amount due.
    • Verify that the "Mark order as complete" button is grayed out and disabled.
    • Enter a cash received amount that is equal to or greater than the amount due.
    • Verify that the "Mark order as complete" button is enabled.
  3. Currency symbol in change due field test:

    • Verify that the change due field displays the correct currency symbol as defined by the app's currency settings.
  • 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 this to the 18.9 milestone May 29, 2024
@backwardstruck backwardstruck added status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: enhancement A request for an enhancement. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. labels May 29, 2024
@backwardstruck backwardstruck marked this pull request as ready for review May 29, 2024 04:32
@backwardstruck backwardstruck requested a review from kidinov May 29, 2024 04:39
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented May 29, 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
Commit64d82e7
Direct Downloadwoocommerce-prototype-build-pr11606-64d82e7.apk

Base automatically changed from 11585-implement-record-transaction-details to trunk May 30, 2024 09:41
kidinov added 6 commits May 30, 2024 12:06
# Conflicts:
#	WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/changeduecalculator/ChangeDueCalculatorScreen.kt
#	WooCommerce/src/main/kotlin/com/woocommerce/android/ui/payments/changeduecalculator/ChangeDueCalculatorViewModel.kt
@dangermattic
Copy link
Collaborator

1 Warning
⚠️ This PR is assigned to the milestone 18.9. This milestone is due in less than 2 days.
Please make sure to get it merged by then or assign it to a milestone with a later deadline.

Generated by 🚫 Danger

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.

I've done some changes to the code (moved the state into state object and some other stuff)

Please feel free to revert them if they don't make much sense

@kidinov kidinov enabled auto-merge May 30, 2024 10:48
@kidinov kidinov self-assigned this May 30, 2024
@backwardstruck
Copy link
Contributor Author

I've done some changes to the code (moved the state into state object and some other stuff)

Please feel free to revert them if they don't make much sense

Thanks a lot. I see Moved ui state flags to the UI state, which I definitely should have done to simplify things.

@kidinov kidinov merged commit b88ff32 into trunk May 30, 2024
14 checks passed
@kidinov kidinov deleted the 11604-gray-out-button-until-payment-amount branch May 30, 2024 13:55
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Payment Method Improvements] Gray out button until payment amount is greater or equal to amount due
4 participants