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

jp.gopay.sdk.models.request.transactiontoken.TemporaryTokenAliasReq Maven / Gradle / Ivy

There is a newer version: 0.11.17
Show newest version
package jp.gopay.sdk.models.request.transactiontoken;

import com.google.gson.annotations.SerializedName;
import jp.gopay.sdk.models.common.MoneyLike;
import jp.gopay.sdk.models.common.TransactionTokenId;
import jp.gopay.sdk.types.MetadataMap;

import java.math.BigInteger;
import java.util.Date;
import java.util.UUID;

public class TemporaryTokenAliasReq {

    @SerializedName("transaction_token_id")
    private UUID transactionTokenId;

    @SerializedName("metadata")
    private MetadataMap metadata;

    @SerializedName("amount")
    private BigInteger amount;

    @SerializedName("currency")
    private String currency;

    @SerializedName("valid_until")
    private Date validUntil;

    public TransactionTokenId getTransactionTokenId() {
        return new TransactionTokenId(transactionTokenId);
    }

    public Date getValidUntil() {
        return validUntil;
    }

    public MetadataMap getMetadata() {
        return metadata;
    }

    public BigInteger getAmount() {
        return amount;
    }

    public String getCurrency() {
        return currency;
    }

    public TemporaryTokenAliasReq(TransactionTokenId transactionTokenId, Date validUntil, MetadataMap metadata) {
        this.transactionTokenId = transactionTokenId.toUUID();
        this.validUntil = validUntil;
        this.metadata = metadata;
    }

    public TemporaryTokenAliasReq(TransactionTokenId transactionTokenId, Date validUntil, MetadataMap metadata, MoneyLike money) {
        this.transactionTokenId = transactionTokenId.toUUID();
        this.validUntil = validUntil;
        this.metadata = metadata;
        this.amount = money.getAmount();
        this.currency = money.getCurrency();
    }
}





© 2015 - 2025 Weber Informatics LLC | Privacy Policy