com.conekta.model.ChargeRequestPaymentMethod Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ct-conekta-java Show documentation
Show all versions of ct-conekta-java Show documentation
This is a java library that allows interaction with https://api.conekta.io API.
/*
* Conekta API
* Conekta sdk
*
* The version of the OpenAPI document: 2.1.0
* Contact: [email protected]
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
package com.conekta.model;
import java.util.Objects;
import java.util.Map;
import java.util.HashMap;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.fasterxml.jackson.annotation.JsonValue;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.conekta.JSON;
/**
* Payment method used in the charge. Go to the [payment methods](https://developers.conekta.com/reference/m%C3%A9todos-de-pago) section for more details
*/
@JsonPropertyOrder({
ChargeRequestPaymentMethod.JSON_PROPERTY_EXPIRES_AT,
ChargeRequestPaymentMethod.JSON_PROPERTY_MONTHLY_INSTALLMENTS,
ChargeRequestPaymentMethod.JSON_PROPERTY_TYPE,
ChargeRequestPaymentMethod.JSON_PROPERTY_TOKEN_ID,
ChargeRequestPaymentMethod.JSON_PROPERTY_PAYMENT_SOURCE_ID,
ChargeRequestPaymentMethod.JSON_PROPERTY_CONTRACT_ID
})
@JsonTypeName("charge_request_payment_method")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class ChargeRequestPaymentMethod {
public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at";
private Long expiresAt;
public static final String JSON_PROPERTY_MONTHLY_INSTALLMENTS = "monthly_installments";
private Integer monthlyInstallments;
public static final String JSON_PROPERTY_TYPE = "type";
private String type;
public static final String JSON_PROPERTY_TOKEN_ID = "token_id";
private String tokenId;
public static final String JSON_PROPERTY_PAYMENT_SOURCE_ID = "payment_source_id";
private String paymentSourceId;
public static final String JSON_PROPERTY_CONTRACT_ID = "contract_id";
private String contractId;
public ChargeRequestPaymentMethod() {
}
public ChargeRequestPaymentMethod expiresAt(Long expiresAt) {
this.expiresAt = expiresAt;
return this;
}
/**
* Method expiration date as unix timestamp
* @return expiresAt
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Long getExpiresAt() {
return expiresAt;
}
@JsonProperty(JSON_PROPERTY_EXPIRES_AT)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setExpiresAt(Long expiresAt) {
this.expiresAt = expiresAt;
}
public ChargeRequestPaymentMethod monthlyInstallments(Integer monthlyInstallments) {
this.monthlyInstallments = monthlyInstallments;
return this;
}
/**
* How many months without interest to apply, it can be 3, 6, 9, 12 or 18
* @return monthlyInstallments
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public Integer getMonthlyInstallments() {
return monthlyInstallments;
}
@JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setMonthlyInstallments(Integer monthlyInstallments) {
this.monthlyInstallments = monthlyInstallments;
}
public ChargeRequestPaymentMethod type(String type) {
this.type = type;
return this;
}
/**
* Get type
* @return type
**/
@javax.annotation.Nonnull
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public String getType() {
return type;
}
@JsonProperty(JSON_PROPERTY_TYPE)
@JsonInclude(value = JsonInclude.Include.ALWAYS)
public void setType(String type) {
this.type = type;
}
public ChargeRequestPaymentMethod tokenId(String tokenId) {
this.tokenId = tokenId;
return this;
}
/**
* Get tokenId
* @return tokenId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_TOKEN_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getTokenId() {
return tokenId;
}
@JsonProperty(JSON_PROPERTY_TOKEN_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setTokenId(String tokenId) {
this.tokenId = tokenId;
}
public ChargeRequestPaymentMethod paymentSourceId(String paymentSourceId) {
this.paymentSourceId = paymentSourceId;
return this;
}
/**
* Get paymentSourceId
* @return paymentSourceId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_PAYMENT_SOURCE_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getPaymentSourceId() {
return paymentSourceId;
}
@JsonProperty(JSON_PROPERTY_PAYMENT_SOURCE_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setPaymentSourceId(String paymentSourceId) {
this.paymentSourceId = paymentSourceId;
}
public ChargeRequestPaymentMethod contractId(String contractId) {
this.contractId = contractId;
return this;
}
/**
* Optional id sent to indicate the bank contract for recurrent card charges.
* @return contractId
**/
@javax.annotation.Nullable
@JsonProperty(JSON_PROPERTY_CONTRACT_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public String getContractId() {
return contractId;
}
@JsonProperty(JSON_PROPERTY_CONTRACT_ID)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setContractId(String contractId) {
this.contractId = contractId;
}
/**
* Return true if this charge_request_payment_method object is equal to o.
*/
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChargeRequestPaymentMethod chargeRequestPaymentMethod = (ChargeRequestPaymentMethod) o;
return Objects.equals(this.expiresAt, chargeRequestPaymentMethod.expiresAt) &&
Objects.equals(this.monthlyInstallments, chargeRequestPaymentMethod.monthlyInstallments) &&
Objects.equals(this.type, chargeRequestPaymentMethod.type) &&
Objects.equals(this.tokenId, chargeRequestPaymentMethod.tokenId) &&
Objects.equals(this.paymentSourceId, chargeRequestPaymentMethod.paymentSourceId) &&
Objects.equals(this.contractId, chargeRequestPaymentMethod.contractId);
}
@Override
public int hashCode() {
return Objects.hash(expiresAt, monthlyInstallments, type, tokenId, paymentSourceId, contractId);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class ChargeRequestPaymentMethod {\n");
sb.append(" expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
sb.append(" monthlyInstallments: ").append(toIndentedString(monthlyInstallments)).append("\n");
sb.append(" type: ").append(toIndentedString(type)).append("\n");
sb.append(" tokenId: ").append(toIndentedString(tokenId)).append("\n");
sb.append(" paymentSourceId: ").append(toIndentedString(paymentSourceId)).append("\n");
sb.append(" contractId: ").append(toIndentedString(contractId)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}