All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.gopay.sdk.AbstractSDK Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
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();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy