com.checkout.AbstractClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of checkout-sdk-java Show documentation
Show all versions of checkout-sdk-java Show documentation
Checkout SDK for Java https://checkout.com
package com.checkout;
import static com.checkout.common.CheckoutUtils.validateParams;
public abstract class AbstractClient {
protected final ApiClient apiClient;
protected final CheckoutConfiguration configuration;
private final SdkAuthorizationType authorizationType;
protected AbstractClient(final ApiClient apiClient,
final CheckoutConfiguration configuration,
final SdkAuthorizationType authorizationType) {
validateParams("apiClient", apiClient, "configuration", configuration, "authorizationType", authorizationType);
this.apiClient = apiClient;
this.configuration = configuration;
this.authorizationType = authorizationType;
}
protected SdkAuthorization sdkAuthorization(final SdkAuthorizationType authorizationType) {
return configuration.getSdkCredentials().getAuthorization(authorizationType);
}
protected SdkAuthorization sdkAuthorization() {
return configuration.getSdkCredentials().getAuthorization(authorizationType);
}
protected static String buildPath(final String... pathParams) {
return String.join("/", pathParams);
}
protected boolean isSandbox() {
return configuration.getEnvironment().isSandbox();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy