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

com.adyen.model.checkout.CheckoutCreateOrderRequest Maven / Gradle / Ivy

There is a newer version: 28.4.0
Show newest version
/*
 *                       ######
 *                       ######
 * ############    ####( ######  #####. ######  ############   ############
 * #############  #####( ######  #####. ######  #############  #############
 *        ######  #####( ######  #####. ######  #####  ######  #####  ######
 * ###### ######  #####( ######  #####. ######  #####  #####   #####  ######
 * ###### ######  #####( ######  #####. ######  #####          #####  ######
 * #############  #############  #############  #############  #####  ######
 *  ############   ############  #############   ############  #####  ######
 *                                      ######
 *                               #############
 *                               ############
 *
 * Adyen Java API Library
 *
 * Copyright (c) 2020 Adyen B.V.
 * This file is open source and available under the MIT license.
 * See the LICENSE file for more info.
 */
package com.adyen.model.checkout;

import java.util.Objects;

import com.adyen.model.Amount;
import com.google.gson.annotations.SerializedName;

/**
 * CheckoutCreateOrderRequest
 */

public class CheckoutCreateOrderRequest {
    @SerializedName("amount")
    private Amount amount = null;

    @SerializedName("expiresAt")
    private String expiresAt = null;

    @SerializedName("merchantAccount")
    private String merchantAccount = null;

    @SerializedName("reference")
    private String reference = null;

    public CheckoutCreateOrderRequest amount(Amount amount) {
        this.amount = amount;
        return this;
    }

    /**
     * Get amount
     *
     * @return amount
     **/
    public Amount getAmount() {
        return amount;
    }

    public void setAmount(Amount amount) {
        this.amount = amount;
    }

    public CheckoutCreateOrderRequest expiresAt(String expiresAt) {
        this.expiresAt = expiresAt;
        return this;
    }

    /**
     * The date that order expires; e.g. 2019-03-23T12:25:28Z. If not provided, the default expiry duration is 1 day.
     *
     * @return expiresAt
     **/
    public String getExpiresAt() {
        return expiresAt;
    }

    public void setExpiresAt(String expiresAt) {
        this.expiresAt = expiresAt;
    }

    public CheckoutCreateOrderRequest merchantAccount(String merchantAccount) {
        this.merchantAccount = merchantAccount;
        return this;
    }

    /**
     * The merchant account identifier, with which you want to process the order.
     *
     * @return merchantAccount
     **/
    public String getMerchantAccount() {
        return merchantAccount;
    }

    public void setMerchantAccount(String merchantAccount) {
        this.merchantAccount = merchantAccount;
    }

    public String getReference() {
        return reference;
    }

    public void setReference(String reference) {
        this.reference = reference;
    }

    public CheckoutCreateOrderRequest reference(String reference) {
        this.reference = reference;
        return this;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        CheckoutCreateOrderRequest checkoutCreateOrderRequest = (CheckoutCreateOrderRequest) o;
        return Objects.equals(this.amount, checkoutCreateOrderRequest.amount) &&
                Objects.equals(this.expiresAt, checkoutCreateOrderRequest.expiresAt) &&
                Objects.equals(this.reference, checkoutCreateOrderRequest.reference) &&
                Objects.equals(this.merchantAccount, checkoutCreateOrderRequest.merchantAccount);
    }

    @Override
    public int hashCode() {
        return Objects.hash(amount, expiresAt, reference, merchantAccount);
    }


    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("class CheckoutCreateOrderRequest {\n");

        sb.append("    amount: ").append(toIndentedString(amount)).append("\n");
        sb.append("    expiresAt: ").append(toIndentedString(expiresAt)).append("\n");
        sb.append("    reference: ").append(toIndentedString(reference)).append("\n");
        sb.append("    merchantAccount: ").append(toIndentedString(merchantAccount)).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