com.cardpay.sdk.model.InvoiceData Maven / Gradle / Ivy
/*
* CardPay REST API
* Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.
*
* OpenAPI spec version: 3.0
*
*
* NOTE: This class is auto generated by the swagger code generator program.
* https://github.com/swagger-api/swagger-codegen.git
* Do not edit the class manually.
*/
package com.cardpay.sdk.model;
import com.google.gson.annotations.SerializedName;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
@Data
public class InvoiceData {
@SerializedName("amount")
private BigDecimal amount = null;
@SerializedName("currency")
private String currency = null;
@SerializedName("expire_at")
private OffsetDateTime expireAt = null;
@SerializedName("installment_type")
private String installmentType = null;
@SerializedName("installments")
private List installments = null;
@SerializedName("reusable")
private Boolean reusable = null;
@SerializedName("reuse_count")
private Integer reuseCount = null;
public void setAmount(BigDecimal amount) {
this.amount = amount;
}
/**
* @param amount The total invoice amount in selected currency with dot as a decimal separator, must be less than 10 billion
* @return bean instance
**/
public InvoiceData amount(BigDecimal amount) {
this.amount = amount;
return this;
}
public void setCurrency(String currency) {
this.currency = currency;
}
/**
* @param currency [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
* @return bean instance
**/
public InvoiceData currency(String currency) {
this.currency = currency;
return this;
}
public void setExpireAt(OffsetDateTime expireAt) {
this.expireAt = expireAt;
}
/**
* @param expireAt Date and time of invoice expiring. Invoice cannot be used after this date and time.
* @return bean instance
**/
public InvoiceData expireAt(OffsetDateTime expireAt) {
this.expireAt = expireAt;
return this;
}
public void setInstallmentType(String installmentType) {
this.installmentType = installmentType;
}
/**
* @param installmentType Installment type
* @return bean instance
**/
public InvoiceData installmentType(String installmentType) {
this.installmentType = installmentType;
return this;
}
public void setInstallments(List installments) {
this.installments = installments;
}
/**
* @param installments Number of installments. It depends on country.
* @return bean instance
**/
public InvoiceData installments(List installments) {
this.installments = installments;
return this;
}
public InvoiceData addInstallmentsItem(Integer installmentsItem) {
if (this.installments == null) {
this.installments = new ArrayList<>();
}
this.installments.add(installmentsItem);
return this;
}
public void setReusable(Boolean reusable) {
this.reusable = reusable;
}
/**
* @param reusable The flag that can be used for enabling payment link multiple times
* @return bean instance
**/
public InvoiceData reusable(Boolean reusable) {
this.reusable = reusable;
return this;
}
public void setReuseCount(Integer reuseCount) {
this.reuseCount = reuseCount;
}
/**
* minimum: 1
* @param reuseCount The number that customer can pay by this link. Default value 10
* @return bean instance
**/
public InvoiceData reuseCount(Integer reuseCount) {
this.reuseCount = reuseCount;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("InvoiceData( ");
if (amount != null) sb.append("amount=").append(amount.toString()).append("; ");
if (currency != null) sb.append("currency=").append(currency.toString()).append("; ");
if (expireAt != null) sb.append("expireAt=").append(expireAt.toString()).append("; ");
if (installmentType != null) sb.append("installmentType=").append(installmentType.toString()).append("; ");
if (installments != null) sb.append("installments=").append(installments.toString()).append("; ");
if (reusable != null) sb.append("reusable=").append(reusable.toString()).append("; ");
if (reuseCount != null) sb.append("reuseCount=").append(reuseCount.toString()).append("; ");
sb.append(")");
return sb.toString();
}
}