Skip to content

Cancel Payment Intent When Payment Completes Unsuccessfully #13609

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

Closed
wants to merge 14 commits into from

Conversation

malinajirka
Copy link
Contributor

Closes: #13593

Description

Steps to reproduce

Testing information

The tests that have been performed

Images/gif

  • 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.

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:

  • The PR is small and has a clear, single focus, or a valid explanation is provided in the description. If needed, please request to split it into smaller PRs.
  • Ensure Adequate Unit Test Coverage: The changes are reasonably covered by unit tests or an explanation is provided in the PR description.
  • Manual Testing: The author listed all the tests they ran, including smoke tests when needed (e.g., for refactorings). The reviewer confirmed that the PR works as expected on big (tablet) and small (phone) in case of UI changes, and no regressions are added.
13

@dangermattic
Copy link
Collaborator

1 Message
📖 This PR is still a Draft: some checks will be skipped.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 21, 2025

📲 You can test the changes from this Pull Request in WooCommerce-Wear Android by scanning the QR code below to install the corresponding build.
App Name WooCommerce-Wear Android
Platform⌚️ Wear OS
FlavorJalapeno
Build TypeDebug
Commit13c0cbc
Direct Downloadwoocommerce-wear-prototype-build-pr13609-13c0cbc.apk

@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Feb 21, 2025

📲 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
FlavorJalapeno
Build TypeDebug
Commit13c0cbc
Direct Downloadwoocommerce-prototype-build-pr13609-13c0cbc.apk

paymentIntent.status == PaymentIntentStatus.REQUIRES_CONFIRMATION
) {
cancelPaymentAction.cancelPayment(paymentIntent)
try {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

📓 This is the block that ensures we always cancel PIs when payment completes unsuccessfully.

@codecov-commenter
Copy link

codecov-commenter commented Feb 21, 2025

Codecov Report

Attention: Patch coverage is 82.35294% with 3 lines in your changes missing coverage. Please review.

Project coverage is 38.04%. Comparing base (304a817) to head (13c0cbc).
Report is 463 commits behind head on trunk.

Files with missing lines Patch % Lines
...oid/cardreader/internal/payments/PaymentManager.kt 80.00% 1 Missing and 1 partial ⚠️
...cardreader/internal/payments/PaymentErrorMapper.kt 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##              trunk   #13609      +/-   ##
============================================
- Coverage     38.06%   38.04%   -0.02%     
+ Complexity     9039     9029      -10     
============================================
  Files          2057     2057              
  Lines        112563   112532      -31     
  Branches      14252    14248       -4     
============================================
- Hits          42846    42817      -29     
+ Misses        65821    65818       -3     
- Partials       3896     3897       +1     

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

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@malinajirka
Copy link
Contributor Author

Replaced with #13719

@malinajirka malinajirka deleted the issue/13593-payment-intent-cancellation branch March 11, 2025 13:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Woo POS] Payment Intent Is Not Cancelled On Back Press
4 participants