jp.gopay.sdk.models.response.applicationtoken.ApplicationToken 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.models.response.applicationtoken;
import com.google.gson.annotations.SerializedName;
import jp.gopay.sdk.models.common.AppTokenId;
import jp.gopay.sdk.models.common.Domain;
import jp.gopay.sdk.models.common.StoreId;
import jp.gopay.sdk.models.common.auth.AppTokenStrategy;
import jp.gopay.sdk.models.response.GoPayResponse;
import jp.gopay.sdk.models.response.SimpleModel;
import jp.gopay.sdk.types.ProcessingMode;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
public class ApplicationToken extends GoPayResponse implements SimpleModel {
@SerializedName("id")
private UUID id;
@SerializedName("store_id")
private UUID storeId;
@SerializedName("token")
private String token;
@SerializedName("secret")
private String secret;
@SerializedName("domains")
private List domains;
@SerializedName("mode")
private ProcessingMode mode;
@SerializedName("created_on")
private Date createdOn;
public AppTokenId getId() {
return new AppTokenId(id);
}
public StoreId getStoreId() {
return new StoreId(storeId);
}
public String getToken() {
return token;
}
public String getSecret() {
return secret;
}
public List getDomains() {
List formattedDomains = new ArrayList<>();
for (String domain : domains) {
formattedDomains.add(new Domain(domain));
}
return formattedDomains;
}
public ProcessingMode getMode() {
return mode;
}
public Date getCreatedOn() {
return createdOn;
}
public AppTokenStrategy getAppTokenAuthStrategy(){
return new AppTokenStrategy(token, secret);
}
}