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

com.conekta.model.CheckoutRequest 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.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;


/**
 * [Checkout](https://developers.conekta.com/v2.1.0/reference/payment-link) details 
 */
@JsonPropertyOrder({
  CheckoutRequest.JSON_PROPERTY_ALLOWED_PAYMENT_METHODS,
  CheckoutRequest.JSON_PROPERTY_EXPIRES_AT,
  CheckoutRequest.JSON_PROPERTY_FAILURE_URL,
  CheckoutRequest.JSON_PROPERTY_MONTHLY_INSTALLMENTS_ENABLED,
  CheckoutRequest.JSON_PROPERTY_MONTHLY_INSTALLMENTS_OPTIONS,
  CheckoutRequest.JSON_PROPERTY_NAME,
  CheckoutRequest.JSON_PROPERTY_ON_DEMAND_ENABLED,
  CheckoutRequest.JSON_PROPERTY_REDIRECTION_TIME,
  CheckoutRequest.JSON_PROPERTY_SUCCESS_URL,
  CheckoutRequest.JSON_PROPERTY_TYPE
})
@JsonTypeName("checkout_request")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.5.0")
public class CheckoutRequest {
  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_FAILURE_URL = "failure_url";
  private String failureUrl;

  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_NAME = "name";
  private String name;

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

  public static final String JSON_PROPERTY_REDIRECTION_TIME = "redirection_time";
  private Integer redirectionTime;

  public static final String JSON_PROPERTY_SUCCESS_URL = "success_url";
  private String successUrl;

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

  public CheckoutRequest() { 
  }

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

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

   /**
   * Are the payment methods available for this 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 CheckoutRequest expiresAt(Long expiresAt) {
    this.expiresAt = expiresAt;
    return this;
  }

   /**
   * Unix timestamp of checkout expiration
   * @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 CheckoutRequest failureUrl(String failureUrl) {
    this.failureUrl = failureUrl;
    return this;
  }

   /**
   * Redirection url back to the site in case of failed payment, applies only to HostedPayment.
   * @return failureUrl
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_FAILURE_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getFailureUrl() {
    return failureUrl;
  }


  @JsonProperty(JSON_PROPERTY_FAILURE_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setFailureUrl(String failureUrl) {
    this.failureUrl = failureUrl;
  }


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

   /**
   * Get monthlyInstallmentsEnabled
   * @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 CheckoutRequest monthlyInstallmentsOptions(List monthlyInstallmentsOptions) {
    this.monthlyInstallmentsOptions = monthlyInstallmentsOptions;
    return this;
  }

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

   /**
   * Get monthlyInstallmentsOptions
   * @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 CheckoutRequest name(String name) {
    this.name = name;
    return this;
  }

   /**
   * Reason for payment
   * @return name
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_NAME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getName() {
    return name;
  }


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


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

   /**
   * Get onDemandEnabled
   * @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 CheckoutRequest redirectionTime(Integer redirectionTime) {
    this.redirectionTime = redirectionTime;
    return this;
  }

   /**
   * number of seconds to wait before redirecting to the success_url
   * @return redirectionTime
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_REDIRECTION_TIME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public Integer getRedirectionTime() {
    return redirectionTime;
  }


  @JsonProperty(JSON_PROPERTY_REDIRECTION_TIME)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setRedirectionTime(Integer redirectionTime) {
    this.redirectionTime = redirectionTime;
  }


  public CheckoutRequest successUrl(String successUrl) {
    this.successUrl = successUrl;
    return this;
  }

   /**
   * Redirection url back to the site in case of successful payment, applies only to HostedPayment
   * @return successUrl
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_SUCCESS_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getSuccessUrl() {
    return successUrl;
  }


  @JsonProperty(JSON_PROPERTY_SUCCESS_URL)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setSuccessUrl(String successUrl) {
    this.successUrl = successUrl;
  }


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

   /**
   * This field represents the type of checkout
   * @return type
  **/
  @javax.annotation.Nullable
  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

  public String getType() {
    return type;
  }


  @JsonProperty(JSON_PROPERTY_TYPE)
  @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
  public void setType(String type) {
    this.type = type;
  }


  /**
   * Return true if this checkout_request object is equal to o.
   */
  @Override
  public boolean equals(Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    CheckoutRequest checkoutRequest = (CheckoutRequest) o;
    return Objects.equals(this.allowedPaymentMethods, checkoutRequest.allowedPaymentMethods) &&
        Objects.equals(this.expiresAt, checkoutRequest.expiresAt) &&
        Objects.equals(this.failureUrl, checkoutRequest.failureUrl) &&
        Objects.equals(this.monthlyInstallmentsEnabled, checkoutRequest.monthlyInstallmentsEnabled) &&
        Objects.equals(this.monthlyInstallmentsOptions, checkoutRequest.monthlyInstallmentsOptions) &&
        Objects.equals(this.name, checkoutRequest.name) &&
        Objects.equals(this.onDemandEnabled, checkoutRequest.onDemandEnabled) &&
        Objects.equals(this.redirectionTime, checkoutRequest.redirectionTime) &&
        Objects.equals(this.successUrl, checkoutRequest.successUrl) &&
        Objects.equals(this.type, checkoutRequest.type);
  }

  @Override
  public int hashCode() {
    return Objects.hash(allowedPaymentMethods, expiresAt, failureUrl, monthlyInstallmentsEnabled, monthlyInstallmentsOptions, name, onDemandEnabled, redirectionTime, successUrl, type);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class CheckoutRequest {\n");
    sb.append("    allowedPaymentMethods: ").append(toIndentedString(allowedPaymentMethods)).append("\n");
    sb.append("    expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
    sb.append("    failureUrl: ").append(toIndentedString(failureUrl)).append("\n");
    sb.append("    monthlyInstallmentsEnabled: ").append(toIndentedString(monthlyInstallmentsEnabled)).append("\n");
    sb.append("    monthlyInstallmentsOptions: ").append(toIndentedString(monthlyInstallmentsOptions)).append("\n");
    sb.append("    name: ").append(toIndentedString(name)).append("\n");
    sb.append("    onDemandEnabled: ").append(toIndentedString(onDemandEnabled)).append("\n");
    sb.append("    redirectionTime: ").append(toIndentedString(redirectionTime)).append("\n");
    sb.append("    successUrl: ").append(toIndentedString(successUrl)).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