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

com.klarna.rest.api.payments.model.PaymentsCreateOrderRequest Maven / Gradle / Ivy

The newest version!
/*
 * 
 * No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
 *
 * OpenAPI spec version: 1.0.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.klarna.rest.api.payments.model;

import java.util.Objects;
import java.util.Arrays;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import com.klarna.rest.api.payments.model.PaymentsAddress;
import com.klarna.rest.api.payments.model.PaymentsAttachment;
import com.klarna.rest.api.payments.model.PaymentsCustomer;
import com.klarna.rest.api.payments.model.PaymentsMerchantUrls;
import com.klarna.rest.api.payments.model.PaymentsOptions;
import com.klarna.rest.api.payments.model.PaymentsOrderLine;
import com.klarna.rest.api.payments.model.PaymentsPaymentMethodCategory;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.ArrayList;
import java.util.List;
import org.threeten.bp.OffsetDateTime;

/**
 * PaymentsCreateOrderRequest
 */
@javax.annotation.Generated(value = "io.swagger.codegen.languages.JavaClientCodegen", date = "2020-01-20T11:12:59.490Z")
public class PaymentsCreateOrderRequest {
  @JsonProperty("acquiring_channel")
  private String acquiringChannel = null;

  @JsonProperty("attachment")
  private PaymentsAttachment attachment = null;

  @JsonProperty("authorization_token")
  private String authorizationToken = null;

  @JsonProperty("auto_capture")
  private Boolean autoCapture = false;

  @JsonProperty("billing_address")
  private PaymentsAddress billingAddress = null;

  @JsonProperty("client_token")
  private String clientToken = null;

  @JsonProperty("custom_payment_method_ids")
  private List customPaymentMethodIds = null;

  @JsonProperty("customer")
  private PaymentsCustomer customer = null;

  @JsonProperty("design")
  private String design = null;

  @JsonProperty("expires_at")
  private OffsetDateTime expiresAt = null;

  @JsonProperty("locale")
  private String locale = null;

  @JsonProperty("merchant_data")
  private String merchantData = null;

  @JsonProperty("merchant_reference1")
  private String merchantReference1 = null;

  @JsonProperty("merchant_reference2")
  private String merchantReference2 = null;

  @JsonProperty("merchant_urls")
  private PaymentsMerchantUrls merchantUrls = null;

  @JsonProperty("options")
  private PaymentsOptions options = null;

  @JsonProperty("order_amount")
  private Long orderAmount = null;

  @JsonProperty("order_lines")
  private List orderLines = new ArrayList();

  @JsonProperty("order_tax_amount")
  private Long orderTaxAmount = null;

  @JsonProperty("payment_method_categories")
  private List paymentMethodCategories = null;

  @JsonProperty("purchase_country")
  private String purchaseCountry = null;

  @JsonProperty("purchase_currency")
  private String purchaseCurrency = null;

  @JsonProperty("shipping_address")
  private PaymentsAddress shippingAddress = null;

  /**
   * The current status of the session. Possible values: 'complete', 'incomplete' where 'complete' is set when the order has been placed.
   */
  public enum StatusEnum {
    COMPLETE("complete"),
    
    INCOMPLETE("incomplete");

    private String value;

    StatusEnum(String value) {
      this.value = value;
    }

    @JsonValue
    public String getValue() {
      return value;
    }

    @Override
    public String toString() {
      return String.valueOf(value);
    }

    @JsonCreator
    public static StatusEnum fromValue(String text) {
      for (StatusEnum b : StatusEnum.values()) {
        if (String.valueOf(b.value).equals(text)) {
          return b;
        }
      }
      return null;
    }
  }

  @JsonProperty("status")
  private StatusEnum status = null;

  public PaymentsCreateOrderRequest acquiringChannel(String acquiringChannel) {
    this.acquiringChannel = acquiringChannel;
    return this;
  }

   /**
   * Type of acquiring channel
   * @return acquiringChannel
  **/
  @ApiModelProperty(example = "in_store", value = "Type of acquiring channel")
  public String getAcquiringChannel() {
    return acquiringChannel;
  }

  public void setAcquiringChannel(String acquiringChannel) {
    this.acquiringChannel = acquiringChannel;
  }

  public PaymentsCreateOrderRequest attachment(PaymentsAttachment attachment) {
    this.attachment = attachment;
    return this;
  }

   /**
   * Additional purchase information required for some industries.
   * @return attachment
  **/
  @ApiModelProperty(value = "Additional purchase information required for some industries.")
  public PaymentsAttachment getAttachment() {
    return attachment;
  }

  public void setAttachment(PaymentsAttachment attachment) {
    this.attachment = attachment;
  }

   /**
   * Authorization token.
   * @return authorizationToken
  **/
  @ApiModelProperty(value = "Authorization token.")
  public String getAuthorizationToken() {
    return authorizationToken;
  }

  public PaymentsCreateOrderRequest autoCapture(Boolean autoCapture) {
    this.autoCapture = autoCapture;
    return this;
  }

   /**
   * Allow merchant to trigger auto capturing.
   * @return autoCapture
  **/
  @ApiModelProperty(value = "Allow merchant to trigger auto capturing.")
  public Boolean isAutoCapture() {
    return autoCapture;
  }

  public void setAutoCapture(Boolean autoCapture) {
    this.autoCapture = autoCapture;
  }

  public PaymentsCreateOrderRequest billingAddress(PaymentsAddress billingAddress) {
    this.billingAddress = billingAddress;
    return this;
  }

   /**
   * Once the customer has provided any data in the checkout iframe, updates to this object will be ignored (without generating an error).
   * @return billingAddress
  **/
  @ApiModelProperty(value = "Once the customer has provided any data in the checkout iframe, updates to this object will be ignored (without generating an error).")
  public PaymentsAddress getBillingAddress() {
    return billingAddress;
  }

  public void setBillingAddress(PaymentsAddress billingAddress) {
    this.billingAddress = billingAddress;
  }

   /**
   * Token to be passed to the JS client
   * @return clientToken
  **/
  @ApiModelProperty(example = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.ewogICJzZXNzaW9uX2lkIiA6ICIw", value = "Token to be passed to the JS client")
  public String getClientToken() {
    return clientToken;
  }

  public PaymentsCreateOrderRequest customPaymentMethodIds(List customPaymentMethodIds) {
    this.customPaymentMethodIds = customPaymentMethodIds;
    return this;
  }

  public PaymentsCreateOrderRequest addCustomPaymentMethodIdsItem(String customPaymentMethodIdsItem) {
    if (this.customPaymentMethodIds == null) {
      this.customPaymentMethodIds = new ArrayList();
    }
    this.customPaymentMethodIds.add(customPaymentMethodIdsItem);
    return this;
  }

   /**
   * Ids for custom payment methods available in a given order. Only applicable in GB/US sessions.
   * @return customPaymentMethodIds
  **/
  @ApiModelProperty(value = "Ids for custom payment methods available in a given order. Only applicable in GB/US sessions.")
  public List getCustomPaymentMethodIds() {
    return customPaymentMethodIds;
  }

  public void setCustomPaymentMethodIds(List customPaymentMethodIds) {
    this.customPaymentMethodIds = customPaymentMethodIds;
  }

  public PaymentsCreateOrderRequest customer(PaymentsCustomer customer) {
    this.customer = customer;
    return this;
  }

   /**
   * Information about the liable customer of the order.
   * @return customer
  **/
  @ApiModelProperty(value = "Information about the liable customer of the order.")
  public PaymentsCustomer getCustomer() {
    return customer;
  }

  public void setCustomer(PaymentsCustomer customer) {
    this.customer = customer;
  }

  public PaymentsCreateOrderRequest design(String design) {
    this.design = design;
    return this;
  }

   /**
   * Get design
   * @return design
  **/
  @ApiModelProperty(value = "")
  public String getDesign() {
    return design;
  }

  public void setDesign(String design) {
    this.design = design;
  }

   /**
   * Session expiration date
   * @return expiresAt
  **/
  @ApiModelProperty(value = "Session expiration date")
  public OffsetDateTime getExpiresAt() {
    return expiresAt;
  }

  public PaymentsCreateOrderRequest locale(String locale) {
    this.locale = locale;
    return this;
  }

   /**
   * RFC 1766 customer's locale.
   * @return locale
  **/
  @ApiModelProperty(example = "en-US", required = true, value = "RFC 1766 customer's locale.")
  public String getLocale() {
    return locale;
  }

  public void setLocale(String locale) {
    this.locale = locale;
  }

  public PaymentsCreateOrderRequest merchantData(String merchantData) {
    this.merchantData = merchantData;
    return this;
  }

   /**
   * Pass through field (max 1024 characters).
   * @return merchantData
  **/
  @ApiModelProperty(example = "{\"order_speicif\":[{\"substore\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}", value = "Pass through field (max 1024 characters).")
  public String getMerchantData() {
    return merchantData;
  }

  public void setMerchantData(String merchantData) {
    this.merchantData = merchantData;
  }

  public PaymentsCreateOrderRequest merchantReference1(String merchantReference1) {
    this.merchantReference1 = merchantReference1;
    return this;
  }

   /**
   * Used for storing merchant's internal order number or other reference. If set, will be shown on the confirmation page as \"order number\" and send to the customer in the confirmation mail after a successful direct bank transfer payment. It will also be included in the payments description in the customer's bank account (max 255 characters).
   * @return merchantReference1
  **/
  @ApiModelProperty(example = "45aa52f387871e3a210645d4", value = "Used for storing merchant's internal order number or other reference. If set, will be shown on the confirmation page as \"order number\" and send to the customer in the confirmation mail after a successful direct bank transfer payment. It will also be included in the payments description in the customer's bank account (max 255 characters).")
  public String getMerchantReference1() {
    return merchantReference1;
  }

  public void setMerchantReference1(String merchantReference1) {
    this.merchantReference1 = merchantReference1;
  }

  public PaymentsCreateOrderRequest merchantReference2(String merchantReference2) {
    this.merchantReference2 = merchantReference2;
    return this;
  }

   /**
   * Used for storing merchant's internal order number or other reference (max 255 characters).
   * @return merchantReference2
  **/
  @ApiModelProperty(example = "45aa52f387871e3a210645d4", value = "Used for storing merchant's internal order number or other reference (max 255 characters).")
  public String getMerchantReference2() {
    return merchantReference2;
  }

  public void setMerchantReference2(String merchantReference2) {
    this.merchantReference2 = merchantReference2;
  }

  public PaymentsCreateOrderRequest merchantUrls(PaymentsMerchantUrls merchantUrls) {
    this.merchantUrls = merchantUrls;
    return this;
  }

   /**
   * The merchant_urls object.
   * @return merchantUrls
  **/
  @ApiModelProperty(value = "The merchant_urls object.")
  public PaymentsMerchantUrls getMerchantUrls() {
    return merchantUrls;
  }

  public void setMerchantUrls(PaymentsMerchantUrls merchantUrls) {
    this.merchantUrls = merchantUrls;
  }

  public PaymentsCreateOrderRequest options(PaymentsOptions options) {
    this.options = options;
    return this;
  }

   /**
   * Options for this purchase.
   * @return options
  **/
  @ApiModelProperty(value = "Options for this purchase.")
  public PaymentsOptions getOptions() {
    return options;
  }

  public void setOptions(PaymentsOptions options) {
    this.options = options;
  }

  public PaymentsCreateOrderRequest orderAmount(Long orderAmount) {
    this.orderAmount = orderAmount;
    return this;
  }

   /**
   * Non-negative, minor units. Total amount of the order, including tax and any discounts.
   * minimum: 0
   * @return orderAmount
  **/
  @ApiModelProperty(required = true, value = "Non-negative, minor units. Total amount of the order, including tax and any discounts.")
  public Long getOrderAmount() {
    return orderAmount;
  }

  public void setOrderAmount(Long orderAmount) {
    this.orderAmount = orderAmount;
  }

  public PaymentsCreateOrderRequest orderLines(List orderLines) {
    this.orderLines = orderLines;
    return this;
  }

  public PaymentsCreateOrderRequest addOrderLinesItem(PaymentsOrderLine orderLinesItem) {
    this.orderLines.add(orderLinesItem);
    return this;
  }

   /**
   * The applicable order lines (max 1000)
   * @return orderLines
  **/
  @ApiModelProperty(required = true, value = "The applicable order lines (max 1000)")
  public List getOrderLines() {
    return orderLines;
  }

  public void setOrderLines(List orderLines) {
    this.orderLines = orderLines;
  }

  public PaymentsCreateOrderRequest orderTaxAmount(Long orderTaxAmount) {
    this.orderTaxAmount = orderTaxAmount;
    return this;
  }

   /**
   * Non-negative, minor units. The total tax amount of the order.
   * minimum: 0
   * @return orderTaxAmount
  **/
  @ApiModelProperty(required = true, value = "Non-negative, minor units. The total tax amount of the order.")
  public Long getOrderTaxAmount() {
    return orderTaxAmount;
  }

  public void setOrderTaxAmount(Long orderTaxAmount) {
    this.orderTaxAmount = orderTaxAmount;
  }

   /**
   * Available payment method categories
   * @return paymentMethodCategories
  **/
  @ApiModelProperty(value = "Available payment method categories")
  public List getPaymentMethodCategories() {
    return paymentMethodCategories;
  }

  public PaymentsCreateOrderRequest purchaseCountry(String purchaseCountry) {
    this.purchaseCountry = purchaseCountry;
    return this;
  }

   /**
   * ISO 3166 alpha-2 purchase country.
   * @return purchaseCountry
  **/
  @ApiModelProperty(example = "US", required = true, value = "ISO 3166 alpha-2 purchase country.")
  public String getPurchaseCountry() {
    return purchaseCountry;
  }

  public void setPurchaseCountry(String purchaseCountry) {
    this.purchaseCountry = purchaseCountry;
  }

  public PaymentsCreateOrderRequest purchaseCurrency(String purchaseCurrency) {
    this.purchaseCurrency = purchaseCurrency;
    return this;
  }

   /**
   * ISO 4217 purchase currency.
   * @return purchaseCurrency
  **/
  @ApiModelProperty(example = "USD", required = true, value = "ISO 4217 purchase currency.")
  public String getPurchaseCurrency() {
    return purchaseCurrency;
  }

  public void setPurchaseCurrency(String purchaseCurrency) {
    this.purchaseCurrency = purchaseCurrency;
  }

  public PaymentsCreateOrderRequest shippingAddress(PaymentsAddress shippingAddress) {
    this.shippingAddress = shippingAddress;
    return this;
  }

   /**
   * Unless the customer has explicitly chosen to enter a separate shipping address, this is a clone of billing_address.
   * @return shippingAddress
  **/
  @ApiModelProperty(value = "Unless the customer has explicitly chosen to enter a separate shipping address, this is a clone of billing_address.")
  public PaymentsAddress getShippingAddress() {
    return shippingAddress;
  }

  public void setShippingAddress(PaymentsAddress shippingAddress) {
    this.shippingAddress = shippingAddress;
  }

   /**
   * The current status of the session. Possible values: 'complete', 'incomplete' where 'complete' is set when the order has been placed.
   * @return status
  **/
  @ApiModelProperty(example = "complete", value = "The current status of the session. Possible values: 'complete', 'incomplete' where 'complete' is set when the order has been placed.")
  public StatusEnum getStatus() {
    return status;
  }


  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    PaymentsCreateOrderRequest createOrderRequest = (PaymentsCreateOrderRequest) o;
    return Objects.equals(this.acquiringChannel, createOrderRequest.acquiringChannel) &&
        Objects.equals(this.attachment, createOrderRequest.attachment) &&
        Objects.equals(this.authorizationToken, createOrderRequest.authorizationToken) &&
        Objects.equals(this.autoCapture, createOrderRequest.autoCapture) &&
        Objects.equals(this.billingAddress, createOrderRequest.billingAddress) &&
        Objects.equals(this.clientToken, createOrderRequest.clientToken) &&
        Objects.equals(this.customPaymentMethodIds, createOrderRequest.customPaymentMethodIds) &&
        Objects.equals(this.customer, createOrderRequest.customer) &&
        Objects.equals(this.design, createOrderRequest.design) &&
        Objects.equals(this.expiresAt, createOrderRequest.expiresAt) &&
        Objects.equals(this.locale, createOrderRequest.locale) &&
        Objects.equals(this.merchantData, createOrderRequest.merchantData) &&
        Objects.equals(this.merchantReference1, createOrderRequest.merchantReference1) &&
        Objects.equals(this.merchantReference2, createOrderRequest.merchantReference2) &&
        Objects.equals(this.merchantUrls, createOrderRequest.merchantUrls) &&
        Objects.equals(this.options, createOrderRequest.options) &&
        Objects.equals(this.orderAmount, createOrderRequest.orderAmount) &&
        Objects.equals(this.orderLines, createOrderRequest.orderLines) &&
        Objects.equals(this.orderTaxAmount, createOrderRequest.orderTaxAmount) &&
        Objects.equals(this.paymentMethodCategories, createOrderRequest.paymentMethodCategories) &&
        Objects.equals(this.purchaseCountry, createOrderRequest.purchaseCountry) &&
        Objects.equals(this.purchaseCurrency, createOrderRequest.purchaseCurrency) &&
        Objects.equals(this.shippingAddress, createOrderRequest.shippingAddress) &&
        Objects.equals(this.status, createOrderRequest.status);
  }

  @Override
  public int hashCode() {
    return Objects.hash(acquiringChannel, attachment, authorizationToken, autoCapture, billingAddress, clientToken, customPaymentMethodIds, customer, design, expiresAt, locale, merchantData, merchantReference1, merchantReference2, merchantUrls, options, orderAmount, orderLines, orderTaxAmount, paymentMethodCategories, purchaseCountry, purchaseCurrency, shippingAddress, status);
  }


  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class PaymentsCreateOrderRequest {\n");
    
    sb.append("    acquiringChannel: ").append(toIndentedString(acquiringChannel)).append("\n");
    sb.append("    attachment: ").append(toIndentedString(attachment)).append("\n");
    sb.append("    authorizationToken: ").append(toIndentedString(authorizationToken)).append("\n");
    sb.append("    autoCapture: ").append(toIndentedString(autoCapture)).append("\n");
    sb.append("    billingAddress: ").append(toIndentedString(billingAddress)).append("\n");
    sb.append("    clientToken: ").append(toIndentedString(clientToken)).append("\n");
    sb.append("    customPaymentMethodIds: ").append(toIndentedString(customPaymentMethodIds)).append("\n");
    sb.append("    customer: ").append(toIndentedString(customer)).append("\n");
    sb.append("    design: ").append(toIndentedString(design)).append("\n");
    sb.append("    expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
    sb.append("    locale: ").append(toIndentedString(locale)).append("\n");
    sb.append("    merchantData: ").append(toIndentedString(merchantData)).append("\n");
    sb.append("    merchantReference1: ").append(toIndentedString(merchantReference1)).append("\n");
    sb.append("    merchantReference2: ").append(toIndentedString(merchantReference2)).append("\n");
    sb.append("    merchantUrls: ").append(toIndentedString(merchantUrls)).append("\n");
    sb.append("    options: ").append(toIndentedString(options)).append("\n");
    sb.append("    orderAmount: ").append(toIndentedString(orderAmount)).append("\n");
    sb.append("    orderLines: ").append(toIndentedString(orderLines)).append("\n");
    sb.append("    orderTaxAmount: ").append(toIndentedString(orderTaxAmount)).append("\n");
    sb.append("    paymentMethodCategories: ").append(toIndentedString(paymentMethodCategories)).append("\n");
    sb.append("    purchaseCountry: ").append(toIndentedString(purchaseCountry)).append("\n");
    sb.append("    purchaseCurrency: ").append(toIndentedString(purchaseCurrency)).append("\n");
    sb.append("    shippingAddress: ").append(toIndentedString(shippingAddress)).append("\n");
    sb.append("    status: ").append(toIndentedString(status)).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(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }

}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy