jp.gopay.sdk.builders.authentication.AuthenticationBuilders 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.builders.authentication;
import jp.gopay.sdk.models.common.EmailAddress;
import jp.gopay.sdk.models.common.Void;
import jp.gopay.sdk.models.request.authentication.AuthenticationRequestData;
import jp.gopay.sdk.models.response.authentication.LoginTokenInfo;
import jp.gopay.sdk.resources.AuthenticationResource;
import retrofit2.Call;
import retrofit2.Retrofit;
import static jp.gopay.sdk.builders.authentication.AbstractAuthenticationBuilders.AbstractLoginRequestBuilder;
import static jp.gopay.sdk.builders.authentication.AbstractAuthenticationBuilders.AbstractLogoutRequestBuilder;
public abstract class AuthenticationBuilders {
public static class LoginRequestBuilder extends AbstractLoginRequestBuilder{
public LoginRequestBuilder(Retrofit retrofit, EmailAddress email, String password) {
super(retrofit, email, password);
}
@Override
protected Call getRequest(AuthenticationResource resource) {
return resource.getLoginToken(new AuthenticationRequestData(email, password));
}
}
public static class LogoutRequestBuilder extends AbstractLogoutRequestBuilder{
public LogoutRequestBuilder(Retrofit retrofit) {
super(retrofit);
}
@Override
protected Call getRequest(AuthenticationResource resource) {
return resource.deleteAuthToken();
}
}
}