-
Notifications
You must be signed in to change notification settings - Fork 68
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
Implement error logging in ECE #9108
Conversation
Test the buildOption 1. Jetpack Beta
Option 2. Jurassic Ninja - available for logged-in A12s🚀 Launch a JN site with this branch 🚀 ℹ️ Install this Tampermonkey script to get more options. Build info:
Note: the build is updated when a new commit is pushed to this PR. |
Size Change: 0 B Total Size: 1.28 MB ℹ️ View Unchanged
|
$response = [ | ||
'result' => 'error', | ||
'messages' => $e->getMessage(), | ||
]; | ||
wp_send_json( $response, 400 ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just noting that this is the response expected in the frontend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code changes look good and work as intended.
Note: I left a nit comment, but it's not a blocker.
Testing Instructions
- ✅ Regression test: Ensure you can pay with ECE.
- ✅ Regression test: Ensure you can pay with ECE in the pay for order flow.
- ✅ Test: Ensure error is displayed and logged when trying to pay with ECE.
- ✅ Test: Ensure error is displayed and logged when trying to pay with ECE in the pay for order flow.
- ✅
npm run test:php
.
Resolves #9049.
Changes proposed in this Pull Request
I've looked into all PHP and JS files concerning ECE and spotted only two opportunities where we can log errors, that are in the backend. In the frontend, we're already displaying errors to the customer and that is being tracked in the checkout conversion. Since the most critical errors come from the backend, that should suffice.
I didn't implement any testing here as we're going to look into unit tests for ECE as a whole in #9026.
Testing instructions
Setup
_wcpay_feature_stripe_ece
option to1
.Regression test: Ensure you can pay with ECE
Regression test: Ensure you can pay with ECE in the pay for order flow
Test: Ensure error is displayed and logged when trying to pay with ECE
true
.woopayments
log of the current day and ensure you can find a log "Failed to process express checkout payment: Exception: Empty cart..." matching the time you tried to checkout.Test: Ensure error is displayed and logged when trying to pay with ECE in the pay for order flow
true
.woopayments
log of the current day and ensure you can find a log "Failed to process express checkout payment for invalid order: Exception: Invalid request..." matching the time you tried to checkout.npm run changelog
to add a changelog file, choosepatch
to leave it empty if the change is not significant. You can add multiple changelog files in one PR by running this command a few times.Post merge