Skip to content

Conversation

@joshheald
Copy link
Contributor

@joshheald joshheald commented Jan 9, 2023

Closes: #8314

Description

In sTAP Away, we're adding support for Tap to Pay on iPhone, using Stripe's Terminal SDK to access the feature.

Apple's requirements for TTP are documented as needing iOS 15.5, on an iPhone XS or newer, and in US-based stores. However, Stripe's SDK is more stringent, and only makes the feature available for iPhones (not iPads) running iOS 16 or newer.

This PR updates the device and OS checks using Stripe's rules.

Background

When we did the proof of concept, we relied on Apple's PaymentCardReader.isSupported property, and didn't see a function in Stripe's SDK for checking support, as it was done intrinsically when we tried to discover a reader.

Unfortunately, this is not a suitable flow for our app, as we give the user an upfront choice of the reader type they want to use. In the production version of Stripe's SDK, there is a checkDeviceSupport function which allows us to find this detail out according to Stripe's rules.

Testing instructions

N.B. To fully test this on device needs a lot of test devices, more than I have available. I have checked scenarios 1 and 5 on device, and all scenarios on the simulator.

Unfortunately, Stripe's terminal simulator is returning true for iPhone X and iPhone 8, which doesn't reflect the published device support, so scenario 3 is essentially untested, or failing the test. I've reached out to Stripe about this, but if anyone is able to test that specific scenario on device, I'd appreciate you noting it in the comments 😊

1. Using an iPhone XS or newer on iOS 16.0 or newer on a US store

  1. Navigate to Menu > Settings > Experimental features
  2. Turn on Tap to Pay on iPhone
  3. Navigate to Menu > Payments > Collect payment
  4. Go through the payment flow, and select Card on the payment method screen
  5. Observe that you are asked to choose a reader type: tap Tap to Pay on iPhone and go through the Terms of Service Apple ID linking (if you've not done so before)
  6. Observe that you can take the payment

2. Using an iPad on iOS 16.0 or newer on a US store

  1. Navigate to Menu > Settings > Experimental features
  2. Turn on Tap to Pay on iPhone
  3. Navigate to Menu > Payments > Collect payment
  4. Go through the payment flow, and select Card on the payment method screen
  5. Observe that you are not asked to choose a reader type, and taken straight to the Bluetooth reader discovery flow

3. Using an iPhone X or older on iOS 16.0 or newer on a US store

As for iPad above

4. Using an iPhone XS or newer on iOS 15.7.2 or older on a US store

As for iPad above

5. Using an iPhone X or older on iOS 15.7.2 or older on a US store

As for iPad above

Screenshots

ttpoi.mp4

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

We will need the checkSupport function Stripe provide to check whether a given device supports the built-in card reader. The simpler Apple version is more permissive, e.g. it says support is available from iOS 15.5, however via Stripe, 16.0 is the minimum.
Previously the logic for when we show the `Tap to Pay on iPhone` or `Bluetooth reader` screen was in the preflight controller, using Apple’s API’s. Stripe’s support is more restricted than Apple’s, and has been exposed via the CardPresentPaymentsStore. This commit updates the PreflightController to use the exposed Stripe check.
@joshheald joshheald added type: enhancement A request for an enhancement. feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: feature-flagged Behind a feature flag. Milestone is not strongly held. labels Jan 9, 2023
@joshheald joshheald added this to the 11.9 milestone Jan 9, 2023
@wpmobilebot
Copy link
Collaborator

wpmobilebot commented Jan 9, 2023

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8595-b2a9b81 on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@joshheald joshheald marked this pull request as ready for review January 9, 2023 17:40
@joshheald
Copy link
Contributor Author

@toupper Not sure what devices you have to test with: would appreciate your review and a list of it either way, since you have context on the feature. I can ask for further reviews as needed to fully test though.

@lmischner @jostnes This seems like a PR which would particularly benefit from testing, since it needs physical devices to do it properly, of various ages and OS versions. See my note in the PR for what I've been able to test and feel free to add scenarios which need checking.

@jostnes
Copy link
Contributor

jostnes commented Jan 11, 2023

I was only able to test out scenarios 1 and 4 with the devices I have:

Scenario 1: iPhone 13 Pro [iOS 16.2] - Payments using both Tap to Pay on iPhone and the BBPOS Chipper card reader works without issue 👍

Scenario 4: iPhone 13 mini [iOS 15.7.1] - Payments using the BBPOS Chipper card reader work without issue and Tap to Pay on iPhone option is not displayed even after turning on the experimental feature flag 👍

@toupper
Copy link
Contributor

toupper commented Jan 12, 2023

@joshheald Great job, the code looks good to me, I just added a non-blocker.
Regarding testing and devices, unfortunately, I only have either devices that support this feature (iPhone 11 and iPhone 13 Pro) or too old ones (iPhone 5S). I tested it with the iPhone 13 Pro and it worked fine.

public func checkSupport(for cardReaderType: CardReaderType,
configProvider: CardReaderConfigProvider,
discoveryMethod: CardReaderDiscoveryMethod) -> Bool {
return false
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A non blocker here, you can omit return if you want

@joshheald joshheald merged commit 47c0bd6 into trunk Jan 12, 2023
@joshheald joshheald deleted the issue/8314-built-in-card-reader-requirements branch January 12, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: mobile payments Related to mobile payments / card present payments / Woo Payments. status: feature-flagged Behind a feature flag. Milestone is not strongly held. type: enhancement A request for an enhancement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Mobile Payments] Update Tap on Mobile requirements to iOS 16.0

5 participants