-
Notifications
You must be signed in to change notification settings - Fork 121
[Mobile Payments] Prevent gap between card reader connection and payment #8329
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] Prevent gap between card reader connection and payment #8329
Conversation
We won’t _always_ want to dismiss the connection view when we’re done connecting, e.g. when we go straight on to payment we can keep the same VC to avoid a dismiss animation immediately followed by a presentation.
Sharing the alertsPresenter between Connection and Payment flows allows us to avoid a visual gap between these flows.
You can test the changes from this Pull Request by:
|
|
@joshheald The code looks good and it tests well 👏 I noticed a couple of issues that we might consider, even if not strictly related to the purpose of this PR:
With info icon: Without it: |
| /// alert viewModels such a provider is expected to provide over the course of performind | ||
| /// a card present transaction (payment or refund.) | ||
| /// | ||
| protocol CardReaderTransactionAlertsProviding { |
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.
Clear protocol naming here 👏
Generated by 🚫 dangerJS |
|
Thanks for the review @toupper
Thanks! That one's known, covered in #8085
Yep, that one's known too, @iamgabrielma has a PR to fix it which I'm reviewing today. |
Closes: #8321
Review after: #8328
Description
In sTAP Away, we're adding support for Apple's built in card readers to take in-person payments. During this work, we are looking to share code where practical with the bluetooth reader flows, and fix issues in those flows. One such issue is the gap between the connection flow and the payment flow.
Connection (except multiple readers) and Payment screens are all shown in a
CardPresentPaymentsModalViewController, which is configured to show different view models as we move through the flow. However, with the existing implementation we dismiss the view controller after the connection flow and show a new one for the payment flow.This results in one screen sliding offscreen downwards, and a new one immediately sliding up in its place. This is not required, and distracting for the user.
This PR uses the shared
alertsPresenteracross both flows and delegates dismissal of alerts to the use case, which fixes this visual glitch in the new flows.N.B. there is still a timing issue in the alerts after tapping the card, in both bluetooth and tap on mobile. This will be dealt with in #8289
Testing instructions
Using an iPhone XS or newer on iOS 16.0 or newer
Menu > Settings > Experimental featuresTap to Pay on iPhoneMenu > Payments > Collect paymentCardon the payment method screenTap to Pay on iPhoneand go through the Terms of Service Apple ID linking (if you've not done so before)Preparing iPhone card readertoGetting ready to collect payment, without sliding one off and the other back on.Screenshots
Before: Tap on Mobile
before-changes-tap-on-mobile.mp4
After: Tap on Mobile
new-flow-tap-on-mobile.mp4
Before: Bluetooth
before-changes-bluetooth.mp4
After: Bluetooth
new-flow-bluetooth.mp4
RELEASE-NOTES.txtif necessary.