Swish payment method always triggers an error on mobile
See original GitHub issueDescribe the bug When an error occurs in drop-in, our Pronamic Pay plugin for WordPress redirects to a failed payment page. The payment status then gets updated accordingly and the error is logged.
For the Swish payment method, this seems to result in an unreasonable amount of failed payments (60%
according to client) with the following error message:
swish App was not found
This error seems to be triggered by redirectToApp()
of the QR loader:
We’re thinking the really short timeout of 25
ms might be the culprit. In a test similar to redirectToApp()
, it seems that even the simplest redirect will trigger the error, even though the redirect works perfectly fine:
<script>
setTimeout( function() {
console.log( "Unable to redirect" );
}, 25 );
window.location.assign( 'https://www.adyen.com/' );
</script>
In the case of Swish, the URL being redirected to uses the custom protocol swish://
to open their app. This means that the browser might also asks for confirmation before opening the Swish app, which will take a little longer to confirm. It is impossible to confirm that this fast.
To Reproduce Steps to reproduce the behavior:
- on mobile, select Swish in drop-in
- click the button to continue payment
- the
onError
method of the checkout configuration is called with aAdyenCheckoutError
Expected behavior The drop-in should not trigger an error if the Swish app can be opened. Also, if we would want to leave the QR code shown on mobile when the app is not installed (for example to use an other device to scan the QR code), there is no way to distinguish between a real error (like when the payment expires after 3 minutes in https://github.com/Adyen/adyen-web/blob/v5.23.0/packages/lib/src/components/internal/QRLoader/QRLoader.tsx#L94-L98) and the case that the app could not be opened. If the PayPal popup is cancelled for example, we do not redirect to our failed payment page:
Smartphone (please complete the following information): I have tested on at least the following device, but assume it affects others too.
- Device: iPhone
- OS: iOS
- Browser: Safari
- Version: 15.6
Issue Analytics
- State:
- Created a year ago
- Reactions:3
- Comments:10 (5 by maintainers)
Top GitHub Comments
Thank you @DavidVujic and @ribeiroguilherme — we’ll update the Adyen integration in our plugin!
Thanks for raising this issue guys. The fix is available on the 5.27.0 .