tech.carpentum.sdk.payment.model.TopUp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of payment-client-v2 Show documentation
Show all versions of payment-client-v2 Show documentation
Carpentum Payment system Java SDK
The newest version!
//THE FILE IS GENERATED, DO NOT MODIFY IT MANUALLY!!!
package tech.carpentum.sdk.payment.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.*;
/** TopUp
*
* For every payment method there is appropriate payment specific request object in `paymentMethod` attribute.
If you have used the [`POST /topups/!availablePaymentOptions`](#operations-Incoming_payments-availablePaymentOptions) API to get the list of the available payment options, then it is expected that you use the same input data here to make sure that the payment will be accepted.
*
*
*
* 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 interface TopUp {
@NotNull TopUpRequested getTopUpRequested();
@NotNull PayinMethod getPaymentMethod();
/** This is the URL where the system will send the transaction final status after payment has been completed.
The URL must be either IP or domain-based. */
@NotNull Optional getCallbackUrl();
/** This is the URL where the customers will be redirected after completing a payment.
The URL must be either IP or domain-based. */
@NotNull String getReturnUrl();
/** The IP address of the customer making the payment in either the IPv4 or IPv6 format.
The IP address is used for validating against the IP address whitelists and blacklists from the merchant settings. */
@NotNull Optional getCustomerIp();
@NotNull static Builder builder(TopUp copyOf) {
Builder builder = builder();
builder.topUpRequested(copyOf.getTopUpRequested());
builder.paymentMethod(copyOf.getPaymentMethod());
builder.callbackUrl(copyOf.getCallbackUrl().orElse(null));
builder.returnUrl(copyOf.getReturnUrl());
builder.customerIp(copyOf.getCustomerIp().orElse(null));
return builder;
}
@NotNull static Builder builder() {
return new TopUpImpl.BuilderImpl();
}
/** Builder for {@link TopUp} model class. */
interface Builder {
/**
* Set {@link TopUp#getTopUpRequested} property.
*
*
*/
@NotNull Builder topUpRequested(TopUpRequested topUpRequested);
/**
* Set {@link TopUp#getPaymentMethod} property.
*
*
*/
@NotNull Builder paymentMethod(PayinMethod paymentMethod);
/**
* Set {@link TopUp#getCallbackUrl} property.
*
* This is the URL where the system will send the transaction final status after payment has been completed.
The URL must be either IP or domain-based.
*/
@NotNull Builder callbackUrl(String callbackUrl);
/**
* Set {@link TopUp#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.
*/
@NotNull Builder returnUrl(String returnUrl);
/**
* Set {@link TopUp#getCustomerIp} property.
*
* The IP address of the customer making the payment in either the IPv4 or IPv6 format.
The IP address is used for validating against the IP address whitelists and blacklists from the merchant settings.
*/
@NotNull Builder customerIp(String customerIp);
/**
* Create new instance of {@link TopUp} model class with the builder instance properties.
*
* @throws NullPointerException in case required properties are not specified.
*/
@NotNull TopUp build();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy