-
Notifications
You must be signed in to change notification settings - Fork 112
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
Location pre-alert view for card reader payments #14672
Location pre-alert view for card reader payments #14672
Conversation
…Controller Mirror a similar solution to built-in card reader. Ask for permission before Stripe Terminal SDK to have a full control of it: - Before connecting to reader check permission using LocationService - For allowed state, proceed with connection - For not determined state display location pre-alert explaining the native alert that follows - Fot denied state display a location required alert allowing to access device settings
📲 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.
LGTM I'm guessing unit testing CardReaderConnectionController
isn't straightforward on the state transitions, originally to .connectToReader
?
…rd-reader-connection
Thanks! Good point, I'll check how to be safer and cover these changes with unit tests. Update: I noticed that these tests are disabled #10536 However, I added additional tests and ran them. When the location is authorized, all the previous tests pass. |
Closes: #14168
Description
Add location permission pre-alert modal before requesting location permission and handle the location denied state during the card reader connection process.
This PR builds on top of the functionality already developed for TTP:
POS doesn't show any new permission modals. If the location is not determined it immediately shows a native alert and continues with the payment flow regardless of the response. I created a task to implement the functionality:
Steps to reproduce
Prerequisites
Testing information
Tested on iOS 18 simulators, and iOS 17 devices. Tested POS for regressions. Tested alternative flows during the reader discovery process - selecting a list of multiple readers, or canceling the search.
Videos
Card Reader Connection
iOS.-.Location.mp4
POS regression testing - location allowed
POS.-.Location.Allowed.mp4
POS regression testing - location denied
POS.-.Location.Denied.mp4
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: