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

Hosted Onboarding LEM API not supported in v3

Open jillingk opened this issue 2 years ago • 0 comments

Describe the bug In the Adyen documentation and the API-explorer it states that the Hosted Onboarding API in LegalEntityManagement is not supported in v3. Instead its suggesting me to use v2, even though the library only supports the latest version. How should I proceed?

Expected behavior Either hosted onboarding version 2 to be supported in the library or for the API to properly support Hosted Onboarding in v3.

(Temporary) solution Since we only support the latest versions in this library through an automated process, we cannot simply downgrade to a lower version of the API. Behind the screen the owners of the Hosted Onboarding API are working to add the support in v3, however in the meantime we recommend manually overriding the Hosted Onboarding Service class.

You can extend the service class and override the endpoint url like this:

public class HostedOnboardingApiV2 extends HostedOnboardingApi{
    public HostedOnboardingApiV2(Client client) {
        super(client);
        this.baseURL = createBaseURL("https://kyc-test.adyen.com/lem/v2");
    }
}

You can then call the methods inherited from the original HostedOnboardingApi class, which will call the version 2 of the API. Since the behaviour and models are identical between v2/v3 this will work perfectly fine for these endpoints.

Do note that other endpoints in LegalEntityManagement or other Adyen API's might contain major changes between versions so using these kind of extensions is at your own risk. If you want to see the changes between API versions you can inspect our OpenAPI specifications in the Adyen-OpenAPI repository.

jillingk avatar Aug 09 '23 11:08 jillingk