adyen-java-api-library icon indicating copy to clipboard operation
adyen-java-api-library copied to clipboard

StoredPaymentMethodDetails doesn't have support for the "subtype" field used by the native TWINT drop-in

Open elitalon opened this issue 1 year ago • 3 comments

Describe the bug Deserialisation of a POST /payments request done against a proxy backend ignores the subtype field from the paymentMethod object in the JSON body.

This results in the drop-in integration of TWINT for iOS using a web-based UI instead of the native one.

How to reproduce Make a POST /payments request with the following JSON body:

{
    "channel": "iOS",
    "amount": {
        "currency": "CHF",
        "value": 0
    },
    "browserInfo": {
        "userAgent": "<redacted>"
    },
    "merchantAccount": "<redacted>",
    "returnUrl": "<redacted>",
    "storePaymentMethod": true,
    "countryCode": "CH",
    "paymentMethod": {
        "type": "twint",
        "subtype": "sdk"
    },
    "shopperLocale": "en_US",
    "shopperReference": "<redacted>",
    "reference": "<redacted>",
    "recurringProcessingModel": "<redacted>",
    "shopperInteraction": "Ecommerce"
}

Expected behavior The resulting StoredPaymentMethodDetails object stores the value of the subtype JSON field.

Screenshots Not applicable

Desktop (please complete the following information):

  • Java Version: Java 21
  • Library Version: 28.2.0

Additional context This problem was discovered as part of https://github.com/Adyen/adyen-ios/issues/1783.

elitalon avatar Sep 20 '24 13:09 elitalon

Hi @elitalon,

Thanks for reaching out here, we have a fix on the way!

Best, Jilling Adyen

jillingk avatar Sep 30 '24 11:09 jillingk

Hi @jillingk.

Are there any news on this? I've seen a few releases of the library in the past weeks, but none of them seem to mention this issue.

Thanks!

elitalon avatar Oct 28 '24 09:10 elitalon

Hi @elitalon!

We've merged the fix from this PR (#1380): src/main/java/com/adyen/model/checkout/TwintDetails.java.

Would you be willing to check the fix and confirm that it addresses the issue before we proceed with the release?

We appreciate your help!

Best regards, Djoyke Adyen

DjoykeAbyah avatar Oct 29 '24 13:10 DjoykeAbyah

@DjoykeAbyah Thanks for the heads up 👍🏼 I will give it a try.

elitalon avatar Oct 30 '24 09:10 elitalon

@DjoykeAbyah Speaking of testing, how do you intend us to reach that change without a new version?

Specifically, how can we point to the current state of the main branch in the pom.xml of our project?

elitalon avatar Oct 30 '24 12:10 elitalon

Hey @elitalon thanks for helping out. We are not able to deploy a snapshot yet (we are looking at the options and we hope to do so in the near future) so it is indeed difficult to test. The only option at the moment would be to build the library from source (main branch).

If that's not doable I understand, if you can please check the changes introduced by the PR #1380 and let us know if they look what you'd expect, that would be tremendously helpful. We are planning the new release shortly.

gcatanese avatar Oct 30 '24 12:10 gcatanese

@gcatanese I'll try building from source. If that doesn't work, then I'll take a look at the pull request. Cheers!

elitalon avatar Oct 30 '24 13:10 elitalon

Hi @gcatanese, I was able to build from source and test the integration agains our backend. I also took a look at #1380.

I think we should be good to go, as far as this issue is concerned.

It could be that we find something else when trying an end-to-end registration together with the iOS SDK. But in that case we will open a separate issue.

Thanks a lot!

elitalon avatar Oct 31 '24 11:10 elitalon

That's great, thank you so much @elitalon for your help.

gcatanese avatar Oct 31 '24 16:10 gcatanese

Hi @elitalon,

I wanted to quickly mention the Java library has just been released with the changes from #1380!

Kind Regards,

Djoyke Adyen

DjoykeAbyah avatar Nov 04 '24 15:11 DjoykeAbyah

Thanks a lot, @DjoykeAbyah!

elitalon avatar Nov 04 '24 15:11 elitalon