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

jp.gopay.sdk.models.request.charge.ChargesReq Maven / Gradle / Ivy

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

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;

@SuppressWarnings("FieldCanBeLocal")
public class ChargesReq {
    @SerializedName("transaction_token_id")
    private UUID transactionTokenId;

    @SerializedName("amount")
    private BigInteger amount;

    @SerializedName("currency")
    private String currency;

    @SerializedName("only_direct_currency")
    private Boolean onlyDirectCurrency;

    @SerializedName("capture")
    private Boolean capture;

    @SerializedName("capture_at")
    private Date captureAt;

    @SerializedName("descriptor")
    private String descriptor;

    @SerializedName("metadata")
    private MetadataMap metadata;

    public ChargesReq(TransactionTokenId transactionTokenId, MoneyLike money, Boolean capture, Date captureAt, MetadataMap metadata,
                      Boolean onlyDirectCurrency, String descriptor) {
        this.transactionTokenId = transactionTokenId.toUUID();
        this.amount = money.getAmount();
        this.currency = money.getCurrency();
        this.onlyDirectCurrency = onlyDirectCurrency;
        this.capture = capture;
        this.captureAt = captureAt;
        this.descriptor = descriptor;
        this.metadata = metadata;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy