Adyen / adyen-android

Adyen Android Drop-in and Components
https://docs.adyen.com/checkout/android
MIT License
124 stars 66 forks source link

3DS2 Prompt Not Displaying Android Drop-In #1247

Closed Zach-Dean-Attractions-io closed 1 year ago

Zach-Dean-Attractions-io commented 1 year ago

Issue We are using Adyen drop-in 4.5.0.

When making a payment that requires 3DS2 an error message is displayed by the drop-in SDK: 'Error - There was an error while processing your payment. Please try again later.'

In the logs I see the following:

Screenshot 2023-06-27 at 16 45 00 (1)

I tried upgrading the version of the Adyen drop-in SDK and version 4.9.0 gave me a new error message.

Screenshot 2023-06-28 at 10 36 03

I have read through: https://github.com/Adyen/adyen-android/issues/326 and saw on there a note about using Google Play services.

At this point we are using: 'com.google.android.gms:play-services-location:17.1.0'

I tried upgrading the location library to the latest version 'com.google.android.gms:play-services-location:21.0.1', which returned me to the original error posted (I see this was a known issue with 4.9.0 posted here: https://github.com/Adyen/adyen-android/releases/tag/4.9.0)

Screenshot 2023-06-28 at 10 46 48

Placing a breakpoint where the error is thrown reveals that the exception is being thrown when calling this endpoint

https://checkoutshopper-live.adyen.com/checkoutshopper/v1/submitThreeDS2Fingerprint?token=live_xxxxx

I've not tried versions after 4.9.0 but from downloading the source code I can see it still hits the same endpoint above so I don't think that will solve anything.

Note: I have implemented the drop-in as per the documentation here: https://docs.adyen.com/online-payments/3d-secure/native-3ds2/android-drop-in

To Reproduce Steps to reproduce the behaviour:

  1. Use Adyen Drop-In 4.5.0
  2. Trigger a 3DS2 action
  3. No prompt is displayed and an error is shown

Expected Behaviour 3DS2 prompt displays and the payment can be completed.

Device Information

OscarSpruit commented 1 year ago

Hi @Zach-Dean-Attractions-io, thank you for reaching out! Could you share the "pspReference" of this failing network request? You can find it by going to the App Inspection tool in Android Studio, open the Network Inspector tab, find the failing request and open the response tab. It should be one of the response header listed there (see the image as example)

image
Zach-Dean-Attractions-io commented 1 year ago

Hi @OscarSpruit

Thanks for the prompt response. I do not get a 'pspReference' for this request.

Screenshot 2023-06-28 at 14 18 36

I added a note that when this was implemented the guide here: https://docs.adyen.com/online-payments/3d-secure/native-3ds2/android-drop-in was followed.

However, looking at this now I see that in the server API call to /payments the following parameters are required:

I think this has changed since it was implemented. Looking at our implementation we do not send the parameter authenticationData.threeDSRequestData.nativeThreeDS.

We send the following relating to 3DS additionalData.allow3DS2 and we send this as true:

additionalData: {
    allow3DS2: true
},

Could this be the issue?

We have just ran a test app and test server that we used when implementing the drop-in SDK and this does not send authenticationData.threeDSRequestData.nativeThreeDS in the /payments API call and this still works in presenting the 3DS2 challenge when using the test card 4917 6100 0000 0000.

OscarSpruit commented 1 year ago

The required parameters depend on which version of the Checkout API is used in your backend. The guide you linked is made for the latest Checkout API version (which is v70). additionalData.allow3DS2 is deprecated since v69, but should still work.

It is difficult for me to guess why this request is failing, but one thing that comes to mind is to check if you are sending the correct channel "channel": "Android". The content of the response is slightly different per channel.

In case the channel doesn't solve your issue, please reach out to our support team and they should be able to help you troubleshoot this better

Zach-Dean-Attractions-io commented 1 year ago

Our server is using v68 of the Checkout API and yes we are sending the channel so I will raise a ticket with the support team.

Zach-Dean-Attractions-io commented 1 year ago

Hi,

I have raised a support ticket also but have managed to obtain the psp reference for one of the payments: RTGG2WGHJVSSD272

We have other apps running on the same code client and server side, which are successfully making 3DS2 challenges (seen in the API logs in the Adyen console) so I am guessing there may be some configuration issue or something, but if you can shed any light now I have the psp reference then that would be great, if not then I will keep trying with support.

The error is because of a 500 response from https://checkoutshopper-live.adyen.com/checkoutshopper/v1/submitThreeDS2Fingerprint?token=live_xxxxx. I've verified the request against the test app and the requestBody passes the fingerprint and paymentData in both the test and live app.

Zach-Dean-Attractions-io commented 1 year ago

In case anyone else faces this problem:

The issue was that when configuring the Adyen Drop-In we were setting the environment to LIVE.

In the Adyen Drop-In SDK code the LIVE environment defaults to EUROPE whereas we were making a payment to a merchant in the US. Setting the environment to UNITED_STATES resolved the issue.

I note that the LIVE environment has been deprecated in more recent versions of the drop-in SDK (we were using 4.5.0).

OscarSpruit commented 1 year ago

~@Zach-Dean-Attractions-io I have tried to look into the psp reference, but I am not able to see the exact reason of why the request fails. Unfortunately, you will have to wait for support to help you.~

Happy to hear you figured it out! And thanks for sharing the solution!

Zach-Dean-Attractions-io commented 1 year ago

Hi @OscarSpruit

Apologies this is now resolved. The issue/solution is in my previous comment. Thanks for your help.