-
Notifications
You must be signed in to change notification settings - Fork 121
[Mobile Payments] Built-in reader disconnection during payment error message #8620
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
Conversation
When we get an error collecting the payment, caused by the reader disconnecting, any retry attempt will fail. By showing a non-retriable error which dismisses the payment flow, the merchant will be taken back to the order and can see clearly whether the payment has gone through or not, before attempting the payment again.
When the built in reader disconnects during a payment flow, e.g. because of going in to the background, or recieving a call, we handle the error as non-retryable. This commit updates the error message to specifically tell the user about this interruption without using the word “disconnected”, which is strange in the context of the built in reader, and informs them about how to continue with the payment.
You can test the changes from this Pull Request by:
|
|
I looked at: cancel by backgrounding, cancel by receiving a call, cancel by turning off screen. I tried to look at cancelling by turning off wifi/connectivity via the control center (though I'm not sure I was able to actually target that or if it was just handled the same as backgrounding). I'd imagine the only issue that's specific to this PR is the grammar one -- let me know if you'd like the other two separated into their own GH issues. Issues found:
RPReplay_Final1673553306.MP4 |
Thanks for the detailed review @lmischner! I'll cover what makes sense here, and break anything I need to out into separate issues, but thanks for the offer 😊 |
This commit prevents us from going through the success flow when Tap to Pay on iPhone payments fail. Previously, if you locked the phone while the Apple payment screen was showing, it would still show a success notice even though the payment hadn’t been taken.
|
@lmischner first one is fixed in 52e12a0
Thanks for pointing this out again: I should have seen it on the test charter but I thought I'd already fixed it. Turns out that this is a deeper issue which is likely to affect the existing implementation of (bluetooth reader) card payments. When there's an error in the payment flow, we track that, but also continue through the success flow even though it was a failure. I've not fixed it in the legacy implementation, because I've not found specific repro steps for how it manifests (locking the phone won't do it as bluetooth readers stay connected even when you lock, unlike the built-in reader.) I'll investigate this so we can fix it with confidence. |
Good spot, fixed in 8703aa2 |
@lmischner Thanks for this one. When I repro it the order has actually been paid for: I checked in the Stripe dashboard and found the order was paid. I'll dig in to whether we know enough to change the error to be more descriptive, but I think given the order shows as paid correctly, it's a safe failure mode. I'll break this into a new issue and handle it separately. |
|
The code looks good and it tests well |

Closes: #8089
Description
The built-in card reader used with Tap to Pay on iPhone can disconnect for a number of reasons, in general, when the app goes in to the background.
In future, we may automatically reconnect in this scenario, but I've found that there's significant risk in that approach, as we can't always tell whether the payment was taken or not. See pdfdoF-2aX-p2 for more context.
When this happens during a payment, we need to inform the user about the payment failure and how to continue
Changes in this PR
When we get an error collecting the payment, caused by the reader disconnecting, any retry attempt will fail.
By showing a non-retriable error which dismisses the payment flow, the merchant will be taken back to the order and can see clearly whether the payment has gone through or not, before attempting the payment again.
The error message specifically tells the user about this interruption without using the word “disconnected”, which is strange in the context of the built in reader, and informs them about how to continue with the payment.
Testing instructions
Using an iPhone XS or newer on iOS 16.0 or newer on a US store
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)Getting ready to collect paymentscreen is shown, background the appCanceledScreenshots
disconnection.error.mp4
RELEASE-NOTES.txtif necessary.