Adyen / adyen-react-native

Adyen React Native
https://docs.adyen.com/checkout
MIT License
45 stars 33 forks source link

No acceptHeader being passed on browserInfo when submitting payment #164

Open joaooliveiramanteigas opened 1 year ago

joaooliveiramanteigas commented 1 year ago

Describe the bug When the onSubmit prop function gets triggered we receive the data that is supposed to be sent to the server but this data is missing the field acceptHeader inside browserInfo. Is there something we are missing on the implementation?

Expected behavior When sending this data to the server there is an exception because no acceptHeader is being sent, we expect acceptHeader to come inside the data parameter for the onSubmit function.

Screenshots

Screenshot 2023-03-17 at 11 58 45

Smartphone (please complete the following information):

descorp commented 1 year ago

Hey @joaooliveiramanteigas

thank you for reaching out!

Do you have same issue on Android?

there is an exception because no acceptHeader

What kind of exception?

joaooliveiramanteigas commented 1 year ago

On Android we don't receive this browserInfo field, I will get into more details on the server error.

Screenshot 2023-03-17 at 16 55 39
joaooliveiramanteigas commented 1 year ago

Server error log we have is this acceptHeader is a required property for BrowserInfo and cannot be null

descorp commented 1 year ago

This is unusual 🤔

Is this error coming from Adyen API? What version of Adyen API you are using? Are you using any API Library ? Could you provide a full server response/exception?

acceptHeader is not expected for iOS and Android, hence our SDKs do not provide them. You might find our documentation that state otherwise, but it requires update. This means that if null check of `acceptHeader is false-positive -any value should do: For example:

text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8

As a side note, on your first screenshot I see that returnURL is "https://google.com". returnURL property have complicated behaviour and triggering web-friendly POST or mobile-friendly GET redirect flow for "https" or "Custom URL Scheme" respectively. We recommend using custom url scheme on iOS.

joaooliveiramanteigas commented 1 year ago

The error occurs while using the latest dotNet library, it fails creating the object, making it impossible to send to Adyen's servers, As seen bellow, the object forces that field: https://github.com/Adyen/adyen-dotnet-api-library/blob/9.2.0/Adyen/Model/Checkout/BrowserInfo.cs#L61

descorp commented 1 year ago

Indeed, acceptHeader is marked as "required" in OpenAPI, so it was applied to all API Libraries. We will look into fixing this. Thanks for pointing on this misalignment! 💚


Have you tried providing random/mock value?

joaooliveiramanteigas commented 1 year ago

Yes, it does work if we remove browserInfo form paymentData on iOS.

avitsrimer commented 1 year ago

Hey there! I dont think this issue should be closed, we can't just remove it from paymentData because we will get 15_002: Required field browserInfo missing for device channel browser. Should it be reopened?

descorp commented 1 year ago

@avitsrimer

we can't just remove it from paymentData

Removing browserInfo was never a good idea. Better provide a mock value:

"acceptHeader" : "*/*"
descorp commented 1 year ago

We are looking to address this exactly same way from native SDK(s) point of view

StefanWallin commented 10 months ago

I can attest that on iOS I get userAgent but not on android. Is browserInfo.userAgent used for fraud scoring? Is it being checked if it matches for the browser visiting the 3DS prompt website?

descorp commented 10 months ago

Thanks @StefanWallin

browserInfo.userAgent is essential for fraud scoring, fingerprinting and for optimising shopper experience on web. For mobile it is less relevant, since shopper can always open external browser different from build-in Chrome or Safari.

We are revisiting separation of web/mobile flows. For now consensus is that browserInfo could be ignored for 3DS2 native and web-fallback flow when channel is "iOS" or "Android".

I will keep this thread posted.