Skip to content

Conversation

@joshheald
Copy link
Contributor

Part of: #8082

Description

In sTAP Away, we're adding support for Apple's built in card readers to take in-person payments. We continue to use Stripe's SDK to handle payments.

Stripe's connection flow is technically very similar to the bluetooth reader flow, but conceptually, there are differences and it's important that we make it clear to users that they are using the built in reader, and don't give the wrong impression that they are connecting to a bluetooth reader, to avoid confusion.

This PR builds on #8299 by adding a specific alert view model for built-in reader configuration updates. This is very similar to the existing software update view model, so the commonalities are extracted out into a new CardPresentModalProgressDisplaying protocol and implemented in an extension, so the implementation can be shared.

Testing instructions

Using an iPhone (XS or above on iOS 15.4 or newer, with a passcode set and signed in to iCloud)

Update the simulator configuration to the following:

Terminal.shared.simulatorConfiguration.availableReaderUpdate = .required

Enable the simulated card reader in Xcode by using Product > Scheme > Edit Scheme > Run > Arguments tab > Check -simulate-stripe-card-reader

Run the app on device or in a simulator, and select a US store with WCPay.

  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. When asked for 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 specific messages for the built in reader are shown during the connecting process (note that images and text are all placeholders!)

N.B. There are known issues with the payment flow after connection. In particular, #8289, #8288, #8274, and #8085. The payment flow "works", but these issues aren't addressed yet, and some are pre-existing in the legacy flow (just a lot less obvious when you use a bluetooth reader.)

Please do note any issues you find, but give me a shout if you want to check they're known first, just to save writing out detailed repro steps.

Screenshots

configuration.update.alerts.mp4

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

The iPhone’s built in card reader may need to be configured before it can be used. In this case, Stripe will call our LocalMobileConnectionDelegate with progress of the configuration, in the same way as it does for bluetooth reader software updates.

This commit duplicates and updates the bluetooth reader software update alert for use with configuration updates.
@joshheald joshheald added type: task An internally driven task. 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 Dec 5, 2022
@joshheald joshheald added this to the 11.6 milestone Dec 5, 2022
@joshheald joshheald requested a review from koke December 5, 2022 12:36
@joshheald joshheald marked this pull request as ready for review December 5, 2022 12:36
@wpmobilebot
Copy link
Collaborator

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 pr8312-0af2f5e on your iPhone

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

@koke
Copy link
Member

koke commented Dec 5, 2022

I followed the steps on an iPhone XS running iOS 15.5, but I didn't get the option to use Tap on iPhone. Also the modals had some styling that looked off in the learn more link and cancel button

EDIT: I can't read and missed the part about enabling the experimental feature. Leaving this comment as the modals still look off

Scanning Connect Multiple readers
Screen Shot 2022-12-05 at 17 03 54 Screen Shot 2022-12-05 at 17 03 57 Screen Shot 2022-12-05 at 17 04 20

@koke
Copy link
Member

koke commented Dec 5, 2022

I'm now getting the following error using iPhone XS on iOS 15.5 (with a passcode set and signed in to iCloud), are you sure about the minimum requirements?

Unsupported mobile device configuration. Ensure the device is running a supported version of iOS and it has the hardware capability you are attempting to use

EDIT: The public docs mention iOS 16.0 as a requirement

@joshheald
Copy link
Contributor Author

EDIT: The public docs mention iOS 16.0 as a requirement

Hmm... I thought I took that requirement list from Stripe's docs, but perhaps it changed since then. I'll update some things to reflect iOS 16 and use Stripe's checking method rather than Apple's (which we currently do, so you only see the TTPoI button if Apple say your device supports it.)

Thanks for testing with the (expected) minimum hardware!

@joshheald
Copy link
Contributor Author

Also the modals had some styling that looked off in the learn more link and cancel button

@koke this is a separate issue that's already merged to trunk. @iamgabrielma is looking at it this week.

Copy link
Member

@koke koke left a comment

Choose a reason for hiding this comment

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

This is looking good. I left a minor note about the copy and apparently it requires iOS 16.0 now

)

static let messageComplete = NSLocalizedString(
"Your phone will be ready to collect payments in a moment...",
Copy link
Member

Choose a reason for hiding this comment

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

The previous message uses iPhone and this one says phone. While its not wrong, we might want to be consistent there.

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: task An internally driven task.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants