-
Notifications
You must be signed in to change notification settings - Fork 121
[Mobile Payments] Add local mobile discovery to StripeCardReaderService #8174
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] Add local mobile discovery to StripeCardReaderService #8174
Conversation
f10c9af to
5233d70
Compare
You can test the changes from this Pull Request by:
|
|
@jostnes @lmischner I've added you as optional reviewers. I'll be refactoring quite a bit, so there will be more chances to test this as we go along. @toupper similarly for context... this is the early stages of getting the structure in place. |
|
The code looks good and it tests well, what a great addition to IPP! 🎉 |
| /// Boolean flag Indicates that clients have provided a CardReaderConfigProvider | ||
| var didReceiveAConfigurationProvider = false | ||
|
|
||
| /// DiscoveryMethod recieved on starting a payment |
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.
Typo here: received 😅
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.
Will fix that in a future PR :)
Closes: #8172
Description
In sTAP Away, we will add the ability to take card payments using the phone's built in card reader. This PR adds
LocalMobileReaderDelegateconformance to ourStripeCardReaderService, and discovery method support to our calls into theCardReaderService.The Tap on Mobile functionality is behind a feature flag, and only available on
localDeveloperXcode builds. Alpha and Release builds do not currently have the correct entitlement to use the built-in reader functionality, and the feature toggle is not available on those builds.When the feature toggle is enabled, all connection attempts will be made to the built-in reader; when it's disabled, all attempts will be bluetooth. In future, the feature flag will be changed to show the user-facing selection screen.
This PR does not address any UI changes, it only adds the feature flag, and the ability to connect to the built-in reader for payments when the toggle is enabled.
Duplication
There's quite a bit of duplicated code in the
StripeCardReaderService. Future work will address this, for now it's important to keep the changes as simple as possible to enable us to work on the user-facing flows sooner.Testing instructions
Simulated reader
The Stripe simulated reader can be used if this does not build to a device with your installed provisioning profiles. Updates to the profiles have been requested.
To enable the Stripe simulated reader, in Xcode go to
Product > Scheme > Edit Schemeand selectRunin the sidebar, thenArgumentsin the tabs. Check the-simulate-stripe-card-readerbox.Testing a
Menu > Settings cog > Experimental featuresTap to Pay on iPhoneMenuPayments > Collect paymentand go through the Simple Payments flow.Cardon the payment methods screen, and connect to the (built-in) readerScreenshots
With simulated reader
Note that there is a bug in the Stripe simulated reader, which means the
Preparing readerscreen remains on screen and the other screens do not show the payment details.tap-on-iphone-simulator.mp4
With physical device
This shows the flow, but the screen recording does not capture the out-of-process Apple Tap on iPhone payment screen, which is shown over the
Reader is readyscreen you see in this video.tap-on-iphone-device.mp4
Simulator without turning on the simulated reader
If you try to use the built-in (non-simulated) reader in a simulator, you'll see this error
RELEASE-NOTES.txtif necessary.