Skip to content
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

Advanced flow + Android: Additional details not being handled (Expo) #536

Open
zegenerative opened this issue Oct 3, 2024 · 7 comments
Open
Labels
bug report when a bug report is created

Comments

@zegenerative
Copy link

zegenerative commented Oct 3, 2024

Describe the bug
(Works on iOS)
On android, the additionalDetails callback does not seem to be triggered on redirect. Probably because on iOS you stay within the app in a webview, but on Android you redirect out of the app to a chrome browser window.

To Reproduce

  1. Run adyen react native sdk 2.4.0 on Android device
  2. Simulate success flow with iDeal following advanced flow
  3. Notice none of the additionalDetails, onComplete nor the onError callback are triggered

Expected behavior
Drop in triggers callback(s)

  • OS: Android API 34 (multiple different devices)
  • Version 2.4.0

Additional context
In our case we get this log, and I can;t see where it's coming from
/reservations/0192518f-af7a-740b-8e58-6c2d2aa0e6d6/payment?redirectResult=X3XtfGC9%21H4sIAAAAAAAA%2F31UXW%2FTMBT9L3nGwUmcOImEUL%2FYutJRui4dExJy7JslkDrGcYBq2n%2FH7gorQ%2FDW3Ht8ru85x733uAZmQIyMl3shDgkKMMLRBqc5oTlOb70XngbRaOBmxfY7kGbKDPPye4%2Fxr4Ot6xHn3SDNXHh5GgYhJi88tnMVB%2BKD1iD53rLPrteW7BtrB%2FDyICCYBg8WqpoCdN900stp4L5V23BmbGEuq%2B4wSOxBvm1KzfTefUu2swyPZaRqhSwHao99O%2BEXnd3Hj3zsPdgxtinFpBPuYCOAtRbIa%2BBfusFMaiYltLYzkkJ3jbC9HWhuy%2Ba4nO0t99saoO1PmmuowG3nSHGQhXGQVqgEHiMa4gqloUhQHFUpzuxPglN7tNPNXSNZu%2BrV6emzt4tNfE7DOE3XV4sitkjF2jX0Q2ueQYv1Kr6JVun2bDM9pweohq8D9Pauj4acommQ4jCiSRiRKKM0OEEL0TiVWfvb0D%2Bl94%2BSFs%2F1tCa1bfc9ml6Ftmi09fNJk7k0cKcPJP6TE4fB%2F%2BC%2F%2FL%2BdGpRNKOokMs0OrF3%2Fn2n2yrFNzmeTxbvrzaez2eVsPZ94D47JDFpea%2Bd0bYzq848vP778lYK%2B7pQCjYzVxj9cxufd7q%2F%2BU%2BH4HNYH1td3qhGvzlY4i9PROJpOw3RMx%2FHI3rKH1j4eEGMXwZP4HQnd5TXj5lGomZ3p1oInwLOUYSCMIBZyjihhAjFISyQSEhCSBREjLhD9l0Yew66G0v8W%2BosiLIrbi224WEZxXMT%2BuJ0t7dO80abva3O7%2FbFQ2edis82%2Ba8b6DZDogn7CGbu5cInvTafhuPASTN3ZRZwJp6qumGa73gVJ9WrG6%2B4xV38F9vgvke%2BXyZttizfvJRvefVhX9eo8KWhUvNnPXzm7jFUFFLOrO8sxRlxgWpEgiiuS0JIGjNE4LYMoKeOyIowjIZKEYl5BREhUZinCgffwEx2%2BRfjjBAAAiZKP6NCuXgpyIrI8K%2F%2BKcQ5IPGWM4p7VITgfa0Pmzd0%3D

@zegenerative zegenerative added the bug report when a bug report is created label Oct 3, 2024
@zegenerative zegenerative changed the title Advanced flow + Android: Additional details not being handled Advanced flow + Android: Additional details not being handled (Expo) Oct 3, 2024
@descorp
Copy link
Contributor

descorp commented Oct 3, 2024

Hey @zegenerative

Could you provide more details:

  • DropIn or individual component?
  • \sessions or \payments (aka Advanced) flow ?
  • what returnUrl you are using on AdyenCheckout.config?

@zegenerative
Copy link
Author

zegenerative commented Oct 3, 2024

@descorp

  • we are using the drop in
  • /payments (advanced flow, as mentioned in title)
  • redirectUrl: <customscheme>://xxx.xxx.nl

@descorp
Copy link
Contributor

descorp commented Oct 3, 2024

I see.

On Android, the Drop-In is an Activity with its own unique returnUrl that looks like adyencheckout://(com.your.package_name).

The appropriate returnUrl is provided in the PaymentMethodData during onSubmit(paymentData, component).

As alternative, you can get Drop-in returnUrl via AdyenDropIn.getReturnURL():

import {AdyenDropIn} from '@adyen/react-native';

const returnUrl = Platform.select({
      ios: ENVIRONMENT.returnUrl,
      android: await AdyenDropIn.getReturnURL(),
    });

@zegenerative
Copy link
Author

zegenerative commented Oct 8, 2024

I implemented the returnUrl based on device by adyencheckout://${DeviceInfo.getBundleId()} (Docs)

But it didn't work. On iOS the additional details are triggered, everything is fine. Android never reaches that point.

Apparently it doesn't have anything to do with the returnUrl, since it does actually redirect, with the same url given as iOS. It just never triggers the additionalDetails on Android, as if it redirects to the app, but not 'to' the sdk.

The log I was getting, was coming from a util that parses deeplinks. Could it be that state is lost during the redirect? And in case of iOS it is still present because of the webview instead of directing out of the app?

Edit: and because of this, the onComplete is also not being called.

Do I need to register the adyencheckout://etc url as a deeplink in our app?

@descorp
Copy link
Contributor

descorp commented Oct 9, 2024

Hey @zegenerative

could you give an example of com.your.package_name?

Drop-in retunrUrl for our example app looks like this: adyencheckout://com.adyen.example
Sorry the parentheses in my previous message gave you a wrong idea of the right format.

Normally, you can find applicationId in android/app/build.gradle.

You can verify that you have the right one by opening any web redirect payment on DropIn and executing:

adb shell am start -a android.intent.action.VIEW -d "adyencheckout://com.your.package_name" com.your.package_name

Could you confirm with your backend team that the adyencheckout://com.your.package_name value you are using for returnUrl is passed to the \payments API ? Because that would explain all the symptoms.

Alternatively, you can reach out to our Support Team via Customer Area or via email: [email protected] and provide them with PSP reference (or link to the transaction in question). Please mention this thread, so they can provide this info directly to me.

@zegenerative
Copy link
Author

zegenerative commented Oct 9, 2024

our returnUrl is adyencheckout://nl.mywheels.app. As fetched using react-native-device-info and corresponds with our store app.

I will check with our BE what the returlUrl is. The response however, is an object containing a redirectResult being

{
  "details": {
    "redirectResult": "X3XtfGC9!H4sIAAAAAAAA/31U72/TMBD9X/IVHJy4+eFICEEbYOvKuq5roUJCrn1dwtLEsx2goP3vnLuOFSbxMXfP73zvPedXIA0IB+q1C4ogpvGARJRQPo/iIkoLlq+C54EBVRuQbip2W2jdSDgRFL8CIW97rJvXUnZ9605UUORxFNPB80BsfcWDZG8MtHKH7OXVDMm+iaaHoGCcJukdInW9AGPrrg2KLPLfuqmlcFg4aTfdfo7aQXtWr40wO//dii0S3JeJrjRBDtIc+jjggQ7XCVlIgzscg81WDTvlD9YKRINAWYG86Xo3rETbQuM755dY34KRWHKHvbA+2S0rgMYeNWewAb+YJ6QRj7OIJWSdsjXJFGMk31AgKUAi1sAiyQGPdqa+rlvRTK0+Pr1aTc4uLi6mAz66TNkiQaQWzQxs37h/oJP3pyxdLvlZNp7O+R5q4LYHi3e99+IYnUU55Ukeo6tRFGf8CK1U7RUWzR8v/5Y9PMi5+FdLNKhpuu9sdBlj0ZkejjQ5aR1cmz1J+OhCFgVPbH3g//B/Kw1oDCfpWuLqLaBV/5/pdtqzDd+Xw/H51fzLu/JDOTsZBneeyfWmvTLe5co5bYvPLz6/eEiArTqtwRCH2oT7y4Sy2z7pPxYOL2G2Z311rWv18t10VI5oUrLh4C3POMtHeEsLDb4bUG98/I6idyD0lzdCunuhSpzp14JHwJOU0ZwRUEyQjG8o4WuhCHAVRTlXGQVvsb2p20PQdb8Ov8XheBEvFqvTZTyesCRZJOGbppzgq/xonLWVWy1/jDX/upgv+XcjhJ3DgJ1mXygXH0994q3rDBwWnoCrOlxkIxoLx7JOhRFb65OkrS5l1d0H60liD3+IQnza/pije582mflaTZ6d/8ynNxezfqrtS++XQ1lAC9zde04pUZJKkOkAJM1xY5mlNI9lpgZA1ylQL0NCE5ZsQAq2Sfma0Ci4+w1tCDoi3wQAAA==P7y6VGP90qwIqrwzwHW2v0x+ljgBR4cvWseO8jTnKsw="
  }
}

Our app is sending the following paymentMethodData:

{"paymentData": {"amount": {"currency": "EUR", "value": 119370}, "paymentMethod": {"checkoutAttemptId": "cd480e8f-239a-4d40-8fe9-e225460b813c1728479587842CB4569689F3FB520DCB519F05FFB9328F364D7EA228CA0978EF2588B9F09AD7C", "type": "ideal"}, "returnUrl": "adyencheckout://nl.mywheels.app", "supportNativeRedirect": true}}

If I execute your shell script with the package name updated, nothing happens.
TBC

@descorp
Copy link
Contributor

descorp commented Oct 9, 2024

The response however, is an object containing a redirectResult being

This look like paymentDetails provided by onAdditionalDetails callback - it is triggered when redirect payload successfully received by SDK

Where do you see this?


If I execute your shell script with the package name updated, nothing happens.

You should be able to see result if you open iDeal on DropIn.
If nothing - then at least it should be detected by Android Studio Logcat

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report when a bug report is created
Projects
None yet
Development

No branches or pull requests

2 participants