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

com.conekta.model.Checkout Maven / Gradle / Ivy

Go to download

This is a java library that allows interaction with https://api.conekta.io API.

The newest version!
/*
 * 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.conekta.model.CheckoutOrderTemplate;
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.ArrayList;
import java.util.Arrays;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import com.conekta.JSON;


/**
 * It is a sub-resource of the Order model that can be stipulated in order to configure its corresponding checkout
 */
@JsonPropertyOrder({
  Checkout.JSON_PROPERTY_ALLOWED_PAYMENT_METHODS,
  Checkout.JSON_PROPERTY_EXPIRES_AT,
  Checkout.JSON_PROPERTY_MONTHLY_INSTALLMENTS_ENABLED,
  Checkout.JSON_PROPERTY_MONTHLY_INSTALLMENTS_OPTIONS,
  Checkout.JSON_PROPERTY_THREE_DS_MODE,
  Checkout.JSON_PROPERTY_NAME,
  Checkout.JSON_PROPERTY_NEEDS_SHIPPING_CONTACT,
  Checkout.JSON_PROPERTY_ON_DEMAND_ENABLED,
  Checkout.JSON_PROPERTY_ORDER_TEMPLATE,
  Checkout.JSON_PROPERTY_PAYMENTS_LIMIT_COUNT,
  Checkout.JSON_PROPERTY_RECURRENT,
  Checkout.JSON_PROPERTY_TYPE
})
@JsonTypeName("checkout")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class Checkout {
  public static final String JSON_PROPERTY_ALLOWED_PAYMENT_METHODS = "allowed_payment_methods";
  private List allowedPaymentMethods = new ArrayList<>();

  public static final String JSON_PROPERTY_EXPIRES_AT = "expires_at";
  private Long expiresAt;

  public static final String JSON_PROPERTY_MONTHLY_INSTALLMENTS_ENABLED = "monthly_installments_enabled";
  private Boolean monthlyInstallmentsEnabled;

  public static final String JSON_PROPERTY_MONTHLY_INSTALLMENTS_OPTIONS = "monthly_installments_options";
  private List monthlyInstallmentsOptions = new ArrayList<>();

  public static final String JSON_PROPERTY_THREE_DS_MODE = "three_ds_mode";
  private String threeDsMode;

  public static final String JSON_PROPERTY_NAME = "name";
  private String name;

  public static final String JSON_PROPERTY_NEEDS_SHIPPING_CONTACT = "needs_shipping_contact";
  private Boolean needsShippingContact;

  public static final String JSON_PROPERTY_ON_DEMAND_ENABLED = "on_demand_enabled";
  private Boolean onDemandEnabled;

  public static final String JSON_PROPERTY_ORDER_TEMPLATE = "order_template";
  private CheckoutOrderTemplate orderTemplate;

  public static final String JSON_PROPERTY_PAYMENTS_LIMIT_COUNT = "payments_limit_count";
  private Integer paymentsLimitCount;

  public static final String JSON_PROPERTY_RECURRENT = "recurrent";
  private Boolean recurrent;

  public static final String JSON_PROPERTY_TYPE = "type";
  private String type;

  public Checkout() { 
  }

  public Checkout allowedPaymentMethods(List allowedPaymentMethods) {
    this.allowedPaymentMethods = allowedPaymentMethods;
    return this;
  }

  public Checkout addAllowedPaymentMethodsItem(String allowedPaymentMethodsItem) {
    if (this.allowedPaymentMethods == null) {
      this.allowedPaymentMethods = new ArrayList<>();
    }
    this.allowedPaymentMethods.add(allowedPaymentMethodsItem);
    return this;
  }

   /**
   * Those are the payment methods that will be available for the link
   * @return allowedPaymentMethods
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_METHODS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public List getAllowedPaymentMethods() {
    return allowedPaymentMethods;
  }


  @JsonProperty(JSON_PROPERTY_ALLOWED_PAYMENT_METHODS)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setAllowedPaymentMethods(List allowedPaymentMethods) {
    this.allowedPaymentMethods = allowedPaymentMethods;
  }


  public Checkout expiresAt(Long expiresAt) {
    this.expiresAt = expiresAt;
    return this;
  }

   /**
   * It is the time when the link will expire. It is expressed in seconds since the Unix epoch. The valid range is from 2 to 365 days (the valid range will be taken from the next day of the creation date at 00:01 hrs) 
   * @return expiresAt
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_EXPIRES_AT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Long getExpiresAt() {
    return expiresAt;
  }


  @JsonProperty(JSON_PROPERTY_EXPIRES_AT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setExpiresAt(Long expiresAt) {
    this.expiresAt = expiresAt;
  }


  public Checkout monthlyInstallmentsEnabled(Boolean monthlyInstallmentsEnabled) {
    this.monthlyInstallmentsEnabled = monthlyInstallmentsEnabled;
    return this;
  }

   /**
   * This flag allows you to specify if months without interest will be active.
   * @return monthlyInstallmentsEnabled
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getMonthlyInstallmentsEnabled() {
    return monthlyInstallmentsEnabled;
  }


  @JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMonthlyInstallmentsEnabled(Boolean monthlyInstallmentsEnabled) {
    this.monthlyInstallmentsEnabled = monthlyInstallmentsEnabled;
  }


  public Checkout monthlyInstallmentsOptions(List monthlyInstallmentsOptions) {
    this.monthlyInstallmentsOptions = monthlyInstallmentsOptions;
    return this;
  }

  public Checkout addMonthlyInstallmentsOptionsItem(Integer monthlyInstallmentsOptionsItem) {
    if (this.monthlyInstallmentsOptions == null) {
      this.monthlyInstallmentsOptions = new ArrayList<>();
    }
    this.monthlyInstallmentsOptions.add(monthlyInstallmentsOptionsItem);
    return this;
  }

   /**
   * This field allows you to specify the number of months without interest.
   * @return monthlyInstallmentsOptions
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public List getMonthlyInstallmentsOptions() {
    return monthlyInstallmentsOptions;
  }


  @JsonProperty(JSON_PROPERTY_MONTHLY_INSTALLMENTS_OPTIONS)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setMonthlyInstallmentsOptions(List monthlyInstallmentsOptions) {
    this.monthlyInstallmentsOptions = monthlyInstallmentsOptions;
  }


  public Checkout threeDsMode(String threeDsMode) {
    this.threeDsMode = threeDsMode;
    return this;
  }

   /**
   * Indicates the 3DS2 mode for the order, either smart or strict.
   * @return threeDsMode
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_THREE_DS_MODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getThreeDsMode() {
    return threeDsMode;
  }


  @JsonProperty(JSON_PROPERTY_THREE_DS_MODE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setThreeDsMode(String threeDsMode) {
    this.threeDsMode = threeDsMode;
  }


  public Checkout name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Reason for charge
   * @return name
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public String getName() {
    return name;
  }


  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setName(String name) {
    this.name = name;
  }


  public Checkout needsShippingContact(Boolean needsShippingContact) {
    this.needsShippingContact = needsShippingContact;
    return this;
  }

   /**
   * This flag allows you to fill in the shipping information at checkout.
   * @return needsShippingContact
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NEEDS_SHIPPING_CONTACT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getNeedsShippingContact() {
    return needsShippingContact;
  }


  @JsonProperty(JSON_PROPERTY_NEEDS_SHIPPING_CONTACT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setNeedsShippingContact(Boolean needsShippingContact) {
    this.needsShippingContact = needsShippingContact;
  }


  public Checkout onDemandEnabled(Boolean onDemandEnabled) {
    this.onDemandEnabled = onDemandEnabled;
    return this;
  }

   /**
   * This flag allows you to specify if the link will be on demand.
   * @return onDemandEnabled
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_ON_DEMAND_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Boolean getOnDemandEnabled() {
    return onDemandEnabled;
  }


  @JsonProperty(JSON_PROPERTY_ON_DEMAND_ENABLED)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setOnDemandEnabled(Boolean onDemandEnabled) {
    this.onDemandEnabled = onDemandEnabled;
  }


  public Checkout orderTemplate(CheckoutOrderTemplate orderTemplate) {
    this.orderTemplate = orderTemplate;
    return this;
  }

   /**
   * Get orderTemplate
   * @return orderTemplate
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_ORDER_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public CheckoutOrderTemplate getOrderTemplate() {
    return orderTemplate;
  }


  @JsonProperty(JSON_PROPERTY_ORDER_TEMPLATE)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setOrderTemplate(CheckoutOrderTemplate orderTemplate) {
    this.orderTemplate = orderTemplate;
  }


  public Checkout paymentsLimitCount(Integer paymentsLimitCount) {
    this.paymentsLimitCount = paymentsLimitCount;
    return this;
  }

   /**
   * It is the number of payments that can be made through the link.
   * @return paymentsLimitCount
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_PAYMENTS_LIMIT_COUNT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getPaymentsLimitCount() {
    return paymentsLimitCount;
  }


  @JsonProperty(JSON_PROPERTY_PAYMENTS_LIMIT_COUNT)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setPaymentsLimitCount(Integer paymentsLimitCount) {
    this.paymentsLimitCount = paymentsLimitCount;
  }


  public Checkout recurrent(Boolean recurrent) {
    this.recurrent = recurrent;
    return this;
  }

   /**
   * false: single use. true: multiple payments
   * @return recurrent
  **/
  @javax.annotation.Nonnull
  @JsonProperty(JSON_PROPERTY_RECURRENT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)

  public Boolean getRecurrent() {
    return recurrent;
  }


  @JsonProperty(JSON_PROPERTY_RECURRENT)
  @JsonInclude(value = JsonInclude.Include.ALWAYS)
  public void setRecurrent(Boolean recurrent) {
    this.recurrent = recurrent;
  }


  public Checkout type(String type) {
    this.type = type;
    return this;
  }

   /**
   * It is the type of link that will be created. It must be a valid 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;
  }


  /**
   * Return true if this checkout object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    Checkout checkout = (Checkout) o;
    return Objects.equals(this.allowedPaymentMethods, checkout.allowedPaymentMethods) &&
        Objects.equals(this.expiresAt, checkout.expiresAt) &&
        Objects.equals(this.monthlyInstallmentsEnabled, checkout.monthlyInstallmentsEnabled) &&
        Objects.equals(this.monthlyInstallmentsOptions, checkout.monthlyInstallmentsOptions) &&
        Objects.equals(this.threeDsMode, checkout.threeDsMode) &&
        Objects.equals(this.name, checkout.name) &&
        Objects.equals(this.needsShippingContact, checkout.needsShippingContact) &&
        Objects.equals(this.onDemandEnabled, checkout.onDemandEnabled) &&
        Objects.equals(this.orderTemplate, checkout.orderTemplate) &&
        Objects.equals(this.paymentsLimitCount, checkout.paymentsLimitCount) &&
        Objects.equals(this.recurrent, checkout.recurrent) &&
        Objects.equals(this.type, checkout.type);
  }

  @Override
  public int hashCode() {
    return Objects.hash(allowedPaymentMethods, expiresAt, monthlyInstallmentsEnabled, monthlyInstallmentsOptions, threeDsMode, name, needsShippingContact, onDemandEnabled, orderTemplate, paymentsLimitCount, recurrent, type);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class Checkout {\n");
    sb.append("    allowedPaymentMethods: ").append(toIndentedString(allowedPaymentMethods)).append("\n");
    sb.append("    expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
    sb.append("    monthlyInstallmentsEnabled: ").append(toIndentedString(monthlyInstallmentsEnabled)).append("\n");
    sb.append("    monthlyInstallmentsOptions: ").append(toIndentedString(monthlyInstallmentsOptions)).append("\n");
    sb.append("    threeDsMode: ").append(toIndentedString(threeDsMode)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    needsShippingContact: ").append(toIndentedString(needsShippingContact)).append("\n");
    sb.append("    onDemandEnabled: ").append(toIndentedString(onDemandEnabled)).append("\n");
    sb.append("    orderTemplate: ").append(toIndentedString(orderTemplate)).append("\n");
    sb.append("    paymentsLimitCount: ").append(toIndentedString(paymentsLimitCount)).append("\n");
    sb.append("    recurrent: ").append(toIndentedString(recurrent)).append("\n");
    sb.append("    type: ").append(toIndentedString(type)).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    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy