jp.gopay.sdk.AbstractSDK Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gopay-java-sdk Show documentation
Show all versions of gopay-java-sdk Show documentation
Official Gyro-n Payments Java SDK
package jp.gopay.sdk;
import jp.gopay.sdk.models.common.auth.AuthStrategy;
import jp.gopay.sdk.settings.AbstractSDKSettings;
import jp.gopay.sdk.types.AuthType;
import jp.gopay.sdk.utils.RequestUtils;
import okhttp3.ConnectionPool;
import retrofit2.Retrofit;
public abstract class AbstractSDK{
protected Retrofit retrofit;
protected AuthStrategy authStrategy;
protected AbstractSDKSettings settings;
public AbstractSDK(AuthStrategy authStrategy, AbstractSDKSettings settings) {
this.authStrategy = authStrategy;
this.settings = settings;
this.retrofit = RequestUtils.createClient(authStrategy, settings);
}
public AbstractSDK(AuthStrategy authStrategy, AbstractSDKSettings settings, ConnectionPool connectionPool) {
this.authStrategy = authStrategy;
this.settings = settings;
this.retrofit = RequestUtils.createClient(authStrategy, settings, connectionPool);
}
public String getTokenValue() {
return authStrategy.getAuthHeader().getTokenValue();
}
public AuthType getAuthType() {
return authStrategy.getAuthHeader().getAuthType();
}
}