jp.gopay.sdk.models.response.subscription.Subscription 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.subscription;
import com.google.gson.annotations.SerializedName;
import jp.gopay.sdk.models.common.StoreId;
import jp.gopay.sdk.models.common.SubscriptionId;
import jp.gopay.sdk.models.response.GoPayResponse;
import jp.gopay.sdk.models.response.SimpleModel;
import jp.gopay.sdk.types.MetadataMap;
import jp.gopay.sdk.types.ProcessingMode;
import jp.gopay.sdk.types.SubscriptionPeriod;
import jp.gopay.sdk.types.SubscriptionStatus;
import jp.gopay.sdk.utils.MetadataAdapter;
import org.threeten.bp.Duration;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.Date;
import java.util.UUID;
public class Subscription extends GoPayResponse implements SimpleModel {
@SerializedName("id")
private UUID id;
@SerializedName("store_id")
private UUID storeId;
@SerializedName("transaction_token_id")
private UUID transactionTokenId;
@SerializedName("amount")
private BigInteger amount;
@SerializedName("currency")
private String currency;
@SerializedName("amount_formatted")
private BigDecimal amountFormatted;
@SerializedName("period")
private SubscriptionPeriod period;
@SerializedName("initial_amount")
private BigInteger initialAmount;
@SerializedName("initial_amount_formatted")
private BigDecimal initialAmountFormatted;
@SerializedName("subsequent_cycles_start")
private Date subsequentCyclesStart;
@SerializedName("schedule_settings")
private ScheduleSettings scheduleSettings;
@SerializedName("first_charge_capture_after")
private Duration firstChargeCaptureAfter;
@SerializedName("first_charge_authorization_only")
private Boolean firstChargeAuthorizationOnly;
@SerializedName("only_direct_currency")
private Boolean onlyDirectCurrency;
@SerializedName("status")
private SubscriptionStatus status;
@SerializedName("descriptor")
private String descriptor;
@SerializedName("metadata")
private MetadataMap metadata;
@SerializedName("mode")
private ProcessingMode mode;
@SerializedName("created_on")
private Date createdOn;
public SubscriptionId getId() {
return new SubscriptionId(id);
}
public StoreId getStoreId() {
return new StoreId(storeId);
}
public UUID getTransactionTokenId() {
return transactionTokenId;
}
public BigInteger getAmount() {
return amount;
}
public String getCurrency() {
return currency;
}
public BigDecimal getAmountFormatted() {
return amountFormatted;
}
public SubscriptionPeriod getPeriod() {
return period;
}
public BigInteger getInitialAmount() {
return initialAmount;
}
public BigDecimal getInitialAmountFormatted() {
return initialAmountFormatted;
}
public Date getSubsequentCyclesStart() {
return subsequentCyclesStart;
}
public ScheduleSettings getScheduleSettings() {
return scheduleSettings;
}
public Duration getFirstChargeCaptureAfter() {
return firstChargeCaptureAfter;
}
public Boolean getFirstChargeAuthorizationOnly() {
return firstChargeAuthorizationOnly;
}
public Boolean getOnlyDirectCurrency() {
return onlyDirectCurrency;
}
public String getDescriptor() {
return descriptor;
}
public SubscriptionStatus getStatus() {
return status;
}
public MetadataMap getMetadata() {
return metadata;
}
public T getMetadata(MetadataAdapter deserializer) {
return deserializer.deserialize(metadata);
}
public ProcessingMode getMode() {
return mode;
}
public Date getCreatedOn() {
return createdOn;
}
}