woocommerce-ios icon indicating copy to clipboard operation
woocommerce-ios copied to clipboard

[Mobile Payments] Tap to Pay connection errors are unrecoverable

Open joshheald opened this issue 6 months ago • 1 comments

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:

  1. Launch the app
  2. Go to Menu > Payments > Manage card reader
  3. Tap Connect Card Reader then cancel the connection – this ensures that the TTP reader is not auto-connected.
  4. Go to Orders, and select an unpaid order (create one if needed)
  5. Tap Collect Payment
  6. Tap Tap to Pay on iPhone, and immediately background the app. You have to be fast, I think it has to happen while the Checking device step.
  7. Wait a few seconds, then open the app again
  8. 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 a Payment failed error, you've not backgrounded fast enough and TTP is connected, go back to step 2.)
  9. Tap Try again
  10. 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.

  1. Launch the app
  2. 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)
  3. Go to Orders, and select an unpaid order (create one if needed)
  4. Tap Collect Payment
  5. Tap Tap to Pay on iPhone
  6. Wait for Apple's TOS screen to show
  7. Tap Cancel
  8. When it dismisses, tap Tap to Pay on iPhone
  9. 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

joshheald avatar Aug 21 '24 09:08 joshheald