Currently, I am upgrading my Square Java SDK from version 2 to 20.1.0.20220616, but when I try to get SquareClient then it throws below error:
org.springframework.web.util.NestedServletException: Handler dispatch failed; nested exception is java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder.callTimeout(JLjava/util/concurrent/TimeUnit;)Lokhttp3/OkHttpClient$Builder
My code in Java is written like below. Here, apikey is access_token of merchant which I stored in db. Also, I tried for SANDBOX environment. Can someone please help me to solve this.
also need to find compatible versions for square SDK 20.1.0.20220616
with appropriate okhttp library which can work with above square SDK
Environment environment = Environment.PRODUCTION;
return new SquareClient.Builder().environment(environment)
.accessToken(apiKey).build();