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

tech.carpentum.sdk.payment.internal.generated.model.P2AV2MethodResponseImpl Maven / Gradle / Ivy

There is a newer version: 2.1021.0
Show newest version
//THE FILE IS GENERATED, DO NOT MODIFY IT MANUALLY!!!
package tech.carpentum.sdk.payment.internal.generated.model;

import com.squareup.moshi.JsonClass;
import java.util.Objects;
import java.util.Optional;
import org.jetbrains.annotations.NotNull;
import tech.carpentum.sdk.payment.internal.generated.model.*;
import tech.carpentum.sdk.payment.model.*;

/** 
 *
 * The account parameters for this payment method are used to show payment instructions to the customer.
 *
 * 
 *
 * The model class is immutable.
 * Use static {@link #builder} method to create a new {@link Builder} instance to build the model class instance.
 *
 */
@JsonClass(generateAdapter = false)
public class P2AV2MethodResponseImpl implements P2AV2MethodResponse {
    private final IdPayin idPayin;

    @Override
    public IdPayin getIdPayin() {
        return idPayin;
    }


    private final IdPayment idPayment;

    @Override
    public IdPayment getIdPayment() {
        return idPayment;
    }


    private final AccountResponseP2AV2 account;

    @Override
    public AccountResponseP2AV2 getAccount() {
        return account;
    }


    private final Money money;

    @Override
    public Money getMoney() {
        return money;
    }


    private final String merchantName;

    @Override
    public String getMerchantName() {
        return merchantName;
    }


    private final PaymentAddress paymentAddress;

    @Override
    public PaymentAddress getPaymentAddress() {
        return paymentAddress;
    }


    /** Name of the QR code image which is supposed to be scanned by the wallet or payment service compatible with this payment method. QR code of the image can be labeled by this qrName to increase a clarity of the payment instruction.
If this parameter contains any value then show it to your customer in the payment instructions. */
    private final String qrName;

    @Override
    public String getQrName() {
        return qrName;
    }


    /** URL to QR code image which is supposed to be scanned by the wallet or payment service compatible with this payment method. QR code encodes the payment instructions to make a payment.
If this parameter contains any value then show it to your customer in the payment instructions. */
    private final String qrCode;

    @Override
    public String getQrCode() {
        return qrCode;
    }


    /** Reference number of transaction. */
    private final String reference;

    @Override
    public String getReference() {
        return reference;
    }


    /** This is the URL where the customers will be redirected after completing a payment.

The URL must be either IP or domain-based. */
    private final String returnUrl;

    @Override
    public String getReturnUrl() {
        return returnUrl;
    }


    /** Date and time when payment was accepted. */
    private final java.time.OffsetDateTime acceptedAt;

    @Override
    public java.time.OffsetDateTime getAcceptedAt() {
        return acceptedAt;
    }


    /** Date and time of payment expiration. If no money has been transferred to this time, payment is considered failed and callback with status change event will shortly follow. */
    private final java.time.OffsetDateTime expireAt;

    @Override
    public java.time.OffsetDateTime getExpireAt() {
        return expireAt;
    }


    @Override public PaymentMethodCode getPaymentMethodCode() { return PAYMENT_METHOD_CODE; }

    private final int hashCode;
    private final String toString;

    private P2AV2MethodResponseImpl(BuilderImpl builder) {
        this.idPayin = Objects.requireNonNull(builder.idPayin, "Property 'idPayin' is required.");
        this.idPayment = Objects.requireNonNull(builder.idPayment, "Property 'idPayment' is required.");
        this.account = Objects.requireNonNull(builder.account, "Property 'account' is required.");
        this.money = Objects.requireNonNull(builder.money, "Property 'money' is required.");
        this.merchantName = Objects.requireNonNull(builder.merchantName, "Property 'merchantName' is required.");
        this.paymentAddress = Objects.requireNonNull(builder.paymentAddress, "Property 'paymentAddress' is required.");
        this.qrName = Objects.requireNonNull(builder.qrName, "Property 'qrName' is required.");
        this.qrCode = Objects.requireNonNull(builder.qrCode, "Property 'qrCode' is required.");
        this.reference = Objects.requireNonNull(builder.reference, "Property 'reference' is required.");
        this.returnUrl = Objects.requireNonNull(builder.returnUrl, "Property 'returnUrl' is required.");
        this.acceptedAt = Objects.requireNonNull(builder.acceptedAt, "Property 'acceptedAt' is required.");
        this.expireAt = Objects.requireNonNull(builder.expireAt, "Property 'expireAt' is required.");

        this.hashCode = Objects.hash(idPayin, idPayment, account, money, merchantName, paymentAddress, qrName, qrCode, reference, returnUrl, acceptedAt, expireAt);
        this.toString = builder.type + "(" +
                "idPayin=" + idPayin +
                ", idPayment=" + idPayment +
                ", account=" + account +
                ", money=" + money +
                ", merchantName=" + merchantName +
                ", paymentAddress=" + paymentAddress +
                ", qrName=" + qrName +
                ", qrCode=" + qrCode +
                ", reference=" + reference +
                ", returnUrl=" + returnUrl +
                ", acceptedAt=" + acceptedAt +
                ", expireAt=" + expireAt +
                ')';
    }

    @Override
    public int hashCode() {
        return hashCode;
    }

    @Override
    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }

        if (!(obj instanceof P2AV2MethodResponseImpl)) {
            return false;
        }

        P2AV2MethodResponseImpl that = (P2AV2MethodResponseImpl) obj;
        if (!this.idPayin.equals(that.idPayin)) return false;
        if (!this.idPayment.equals(that.idPayment)) return false;
        if (!this.account.equals(that.account)) return false;
        if (!this.money.equals(that.money)) return false;
        if (!this.merchantName.equals(that.merchantName)) return false;
        if (!this.paymentAddress.equals(that.paymentAddress)) return false;
        if (!this.qrName.equals(that.qrName)) return false;
        if (!this.qrCode.equals(that.qrCode)) return false;
        if (!this.reference.equals(that.reference)) return false;
        if (!this.returnUrl.equals(that.returnUrl)) return false;
        if (!this.acceptedAt.equals(that.acceptedAt)) return false;
        if (!this.expireAt.equals(that.expireAt)) return false;

        return true;
    }

    @Override
    public String toString() {
        return toString;
    }

    /** Builder for {@link P2AV2MethodResponse} model class. */
    public static class BuilderImpl implements P2AV2MethodResponse.Builder {
        private IdPayin idPayin = null;
        private IdPayment idPayment = null;
        private AccountResponseP2AV2 account = null;
        private Money money = null;
        private String merchantName = null;
        private PaymentAddress paymentAddress = null;
        private String qrName = null;
        private String qrCode = null;
        private String reference = null;
        private String returnUrl = null;
        private java.time.OffsetDateTime acceptedAt = null;
        private java.time.OffsetDateTime expireAt = null;

        private final String type;

        public BuilderImpl(String type) {
            this.type = type;
        }

        public BuilderImpl() {
            this("P2AV2MethodResponse");
        }

        /**
          * Set {@link P2AV2MethodResponse#getIdPayin} property.
          *
          * 
          */
        @Override
        public BuilderImpl idPayin(IdPayin idPayin) {
            this.idPayin = idPayin;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getIdPayment} property.
          *
          * 
          */
        @Override
        public BuilderImpl idPayment(IdPayment idPayment) {
            this.idPayment = idPayment;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getAccount} property.
          *
          * 
          */
        @Override
        public BuilderImpl account(AccountResponseP2AV2 account) {
            this.account = account;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getMoney} property.
          *
          * 
          */
        @Override
        public BuilderImpl money(Money money) {
            this.money = money;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getMerchantName} property.
          *
          * 
          */
        @Override
        public BuilderImpl merchantName(String merchantName) {
            this.merchantName = merchantName;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getPaymentAddress} property.
          *
          * 
          */
        @Override
        public BuilderImpl paymentAddress(PaymentAddress paymentAddress) {
            this.paymentAddress = paymentAddress;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getQrName} property.
          *
          * Name of the QR code image which is supposed to be scanned by the wallet or payment service compatible with this payment method. QR code of the image can be labeled by this qrName to increase a clarity of the payment instruction.
If this parameter contains any value then show it to your customer in the payment instructions.
          */
        @Override
        public BuilderImpl qrName(String qrName) {
            this.qrName = qrName;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getQrCode} property.
          *
          * URL to QR code image which is supposed to be scanned by the wallet or payment service compatible with this payment method. QR code encodes the payment instructions to make a payment.
If this parameter contains any value then show it to your customer in the payment instructions.
          */
        @Override
        public BuilderImpl qrCode(String qrCode) {
            this.qrCode = qrCode;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getReference} property.
          *
          * Reference number of transaction.
          */
        @Override
        public BuilderImpl reference(String reference) {
            this.reference = reference;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getReturnUrl} property.
          *
          * This is the URL where the customers will be redirected after completing a payment.

The URL must be either IP or domain-based.
          */
        @Override
        public BuilderImpl returnUrl(String returnUrl) {
            this.returnUrl = returnUrl;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getAcceptedAt} property.
          *
          * Date and time when payment was accepted.
          */
        @Override
        public BuilderImpl acceptedAt(java.time.OffsetDateTime acceptedAt) {
            this.acceptedAt = acceptedAt;
            return this;
        }

        /**
          * Set {@link P2AV2MethodResponse#getExpireAt} property.
          *
          * Date and time of payment expiration. If no money has been transferred to this time, payment is considered failed and callback with status change event will shortly follow.
          */
        @Override
        public BuilderImpl expireAt(java.time.OffsetDateTime expireAt) {
            this.expireAt = expireAt;
            return this;
        }

        /**
         * Create new instance of {@link P2AV2MethodResponse} model class with the builder instance properties.
         *
         * @throws NullPointerException in case required properties are not specified.
         */
        @Override
        public P2AV2MethodResponseImpl build() {
            return new P2AV2MethodResponseImpl(this);
        }

    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy