woocommerce-ios
woocommerce-ios copied to clipboard
[Mobile Payments] Tap to Pay connection errors are unrecoverable
Description
After getting an error when "connecting to" the built-in Tap to Pay reader, the merchant can dismiss it and try again.
If they do, the Preparing Tap to Pay on iPhone
screen is shown, and cannot be dismissed. It never moves on to the next step, and the only way to resolve it is by killing the app and restarting.
Repro
This can be difficult to reproduce. Apple are the main source of errors for connecting to the built in flow, and we can't really fake the errors effectively.
Some merchants could see repeated errors when connecting though, e.g. if they have been blocked by Apple, which can happen for trying to use TTP on too many stores (>3, I think) in a 24 hour period, or for issues when accepting the Terms of Service. However, I don't have repeatable repro steps for getting to those error states. Context here: p1724162683176379-slack-C025A8VV728
Backgrounding during connection
The connection can fail if the app goes into the background while it's happening:
- Launch the app
- Go to
Menu > Payments > Manage card reader
- Tap
Connect Card Reader
then cancel the connection – this ensures that the TTP reader is not auto-connected. - Go to
Orders
, and select an unpaid order (create one if needed) - Tap
Collect Payment
- Tap
Tap to Pay on iPhone
, and immediately background the app. You have to be fast, I think it has to happen while theChecking device
step. - Wait a few seconds, then open the app again
- Observe that you're shown the
Setup failed
error:There was an issue preparing to use Tap to Pay on iPhone – please try again.
(If you're shown aPayment failed
error, you've not backgrounded fast enough and TTP is connected, go back to step 2.) - Tap
Try again
- Observe that you're shown the
Preparing Tap to Pay on iPhone
screen, and it never moves to the next step, and can't be dismissed.
Expectation – when trying again, the connection should continue as normal. If it ends in an error, that's fine, but it shouldn't get stuck in an unrecoverable state.
Speed is important – there's also an auto-reconnection for the built in reader which kicks in when you foreground the app. The fastest one will win, so if you don't tap Try again
quickly enough, you may find it's already tried the reconnection.
Cancelling Terms Of Service acceptance
The connection will fail (without a visible error) if the merchant cancels Apple's TTP TOS acceptance screen.
- Launch the app
- Switch to a store which is not linked to an Apple ID for the purposes of Tap to Pay (you can unlink a store using Apple's management site: https://register.apple.com)
- Go to
Orders
, and select an unpaid order (create one if needed) - Tap
Collect Payment
- Tap
Tap to Pay on iPhone
- Wait for Apple's TOS screen to show
- Tap
Cancel
- When it dismisses, tap
Tap to Pay on iPhone
- Observe that you're shown the
Preparing Tap to Pay on iPhone
screen, and it never moves to the next step, and can't be dismissed.
Expectation – at step 9, you should be shown the TOS screen again.
Screenshots
https://github.com/user-attachments/assets/c3741f23-ffec-4eab-b6ad-0c308c24cdad