-
Notifications
You must be signed in to change notification settings - Fork 110
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
[Mobile Payments] Log Stripe error codes within the CardReaderService #13976
Conversation
📲 You can test the changes from this Pull Request in WooCommerce iOS by scanning the QR code below to install the corresponding build.
|
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.
👍 Thanks for the work!
Tested, I confirm that stripe payment errors are now logged .
case is CardReaderConfigError: | ||
DDLogError("💳 Card Reader Config Error: \(error)") | ||
default: | ||
let nsError = error as NSError |
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.
Unused
let nsError = error as NSError |
Description
This PR adds logging for the error codes we get from Stripe, within the StripeCardReaderService, for a lower-level way to identify errors that are causing issues.
Steps to reproduce
Menu > Payments > Manage card reader
Connect card reader
if neededMenu > Settings > Help & Support > View Application Log > Current
)💳 Stripe Error Code: SCPError(rawValue: 2320)
Testing information
Some errors don't originate from Stripe. If they don't, they'll default to being tracked with code 1. I've written some pattern matching logic to try to avoid this, but it's not feasible to test every situation here.
No unit testing because the
StripeCardReaderService
is not structured for unit tests, due to the impracticality of mocking the Stripe Terminal.RELEASE-NOTES.txt
if necessary.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: