question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Swish payment method always triggers an error on mobile

See original GitHub issue

Describe 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:

https://github.com/Adyen/adyen-web/blob/68e1573e39ff925f3cbcb13799816269ea6c57a8/packages/lib/src/components/internal/QRLoader/QRLoader.tsx#L70-L77

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:

  1. on mobile, select Swish in drop-in
  2. click the button to continue payment
  3. the onError method of the checkout configuration is called with a AdyenCheckoutError

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:closed
  • Created a year ago
  • Reactions:3
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
rvdsteegecommented, Oct 5, 2022

Thank you @DavidVujic and @ribeiroguilherme — we’ll update the Adyen integration in our plugin!

2reactions
ribeiroguilhermecommented, Oct 4, 2022

Thanks for raising this issue guys. The fix is available on the 5.27.0 .

Read more comments on GitHub >

github_iconTop Results From Across the Web

Help - Swish
I made a Swish payment but I can't see the payment in my history in the app, what should I do? · What...
Read more >
Swish Merchant Integration Guide
The Swish Commerce API supports two type of payment requests, m-commerce payments and e- commerce payments. It is always the consumer that ...
Read more >
Fix payment issues on your account - Android - Google Support
If you try to buy something on Google Play but your payment is declined or won't process, try the steps below. Troubleshoot Payment...
Read more >
Release notes - Adyen Docs
When a shopper makes gift card partial payments, and the second payment method fails, the corresponding callback gets triggered with an error.
Read more >
Swish Payments -se - ZignSec Docs
Swedish Swish payments are performed with the mobile Swish app and the ... this field is also used to trigger specific error responses...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found