com.cardpay.sdk.model.ScheduledData Maven / Gradle / Ivy
/*
* CardPay REST API
* Welcome to the CardPay REST API. The CardPay API uses HTTP verbs and a [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) resources endpoint structure (see more info about REST). Request and response payloads are formatted as JSON. Merchant uses API to create payments, refunds, payouts or recurrings, check or update transaction status and get information about created transactions. In API authentication process based on [OAuth 2.0](https://oauth.net/2/) standard. For recent changes see changelog section.
*
* OpenAPI spec version: 3.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.cardpay.sdk.model;
import com.google.gson.TypeAdapter;
import com.google.gson.annotations.JsonAdapter;
import com.google.gson.annotations.SerializedName;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import java.io.IOException;
import java.math.BigDecimal;
import java.time.OffsetDateTime;
import lombok.Data;
@Data
public class ScheduledData {
@SerializedName("contract_number")
private String contractNumber = null;
@SerializedName("dynamic_descriptor")
private String dynamicDescriptor = null;
@SerializedName("encrypted_data")
private String encryptedData = null;
@SerializedName("generate_token")
private Boolean generateToken = null;
@SerializedName("initial_amount")
private BigDecimal initialAmount = null;
@SerializedName("initiator")
private String initiator = null;
@SerializedName("note")
private String note = null;
@SerializedName("plan")
private Plan plan = null;
@SerializedName("scheduled_type")
private String scheduledType = null;
@SerializedName("subscription_start")
private OffsetDateTime subscriptionStart = null;
@SerializedName("three_ds_challenge_indicator")
private String threeDsChallengeIndicator = null;
/**
* Gets or Sets transType
*/
@JsonAdapter(TransTypeEnum.Adapter.class)
public enum TransTypeEnum {
_01("01"),
_03("03"),
_10("10"),
_11("11"),
_28("28");
private String value;
TransTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static TransTypeEnum fromValue(String text) {
for (TransTypeEnum b : TransTypeEnum.values()) {
if (String.valueOf(b.value).equals(text)) {
return b;
}
}
return null;
}
public static class Adapter extends TypeAdapter {
@Override
public void write(final JsonWriter jsonWriter, final TransTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public TransTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return TransTypeEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("trans_type")
private TransTypeEnum transType = null;
@SerializedName("units")
private Integer units = null;
public void setContractNumber(String contractNumber) {
this.contractNumber = contractNumber;
}
/**
* @param contractNumber Contract number between customer and merchant. Required for Mexican merchants for scheduled payments.
* @return bean instance
**/
public ScheduledData contractNumber(String contractNumber) {
this.contractNumber = contractNumber;
return this;
}
public void setDynamicDescriptor(String dynamicDescriptor) {
this.dynamicDescriptor = dynamicDescriptor;
}
/**
* @param dynamicDescriptor Short description of the service or product, must be enabled by CardPay manager to be used.
* @return bean instance
**/
public ScheduledData dynamicDescriptor(String dynamicDescriptor) {
this.dynamicDescriptor = dynamicDescriptor;
return this;
}
public void setEncryptedData(String encryptedData) {
this.encryptedData = encryptedData;
}
/**
* @param encryptedData The encrypted payment credentials encoded in base64. *(for APPLEPAY payment method only)*
* @return bean instance
**/
public ScheduledData encryptedData(String encryptedData) {
this.encryptedData = encryptedData;
return this;
}
public void setGenerateToken(Boolean generateToken) {
this.generateToken = generateToken;
}
/**
* @param generateToken This attribute can be received only in first recurring request. In all requests with recurring_id card.token can't be generated. If set to 'true', Card token will be generated and returned in GET response. Will be generated only for successful transactions (not for declined).
* @return bean instance
**/
public ScheduledData generateToken(Boolean generateToken) {
this.generateToken = generateToken;
return this;
}
public void setInitialAmount(BigDecimal initialAmount) {
this.initialAmount = initialAmount;
}
/**
* @param initialAmount The amount of subscription initiated transaction in selected currency with dot as a decimal separator, must be less than 100 millions
* @return bean instance
**/
public ScheduledData initialAmount(BigDecimal initialAmount) {
this.initialAmount = initialAmount;
return this;
}
public void setInitiator(String initiator) {
this.initiator = initiator;
}
/**
* @param initiator Use `cit` for initiator attribute (cardholder initiated transaction).
* @return bean instance
**/
public ScheduledData initiator(String initiator) {
this.initiator = initiator;
return this;
}
public void setNote(String note) {
this.note = note;
}
/**
* @param note Note about the recurring that will not be displayed to customer.
* @return bean instance
**/
public ScheduledData note(String note) {
this.note = note;
return this;
}
public void setPlan(Plan plan) {
this.plan = plan;
}
/**
* @param plan Plan data
* @return bean instance
**/
public ScheduledData plan(Plan plan) {
this.plan = plan;
return this;
}
public void setScheduledType(String scheduledType) {
this.scheduledType = scheduledType;
}
/**
* @param scheduledType Scheduled payment type attribute. For typical scheduled payments should be absent or `SA` - scheduled by acquirer
* @return bean instance
**/
public ScheduledData scheduledType(String scheduledType) {
this.scheduledType = scheduledType;
return this;
}
public void setSubscriptionStart(OffsetDateTime subscriptionStart) {
this.subscriptionStart = subscriptionStart;
}
/**
* @param subscriptionStart The time in 'yyyy-MM-dd' format when subscription will actually become activated (grace period).Leave it empty to activate subscription at once without any grace period applied.
* @return bean instance
**/
public ScheduledData subscriptionStart(OffsetDateTime subscriptionStart) {
this.subscriptionStart = subscriptionStart;
return this;
}
public void setThreeDsChallengeIndicator(String threeDsChallengeIndicator) {
this.threeDsChallengeIndicator = threeDsChallengeIndicator;
}
/**
* @param threeDsChallengeIndicator threeDsChallengeIndicator
* @return bean instance
**/
public ScheduledData threeDsChallengeIndicator(String threeDsChallengeIndicator) {
this.threeDsChallengeIndicator = threeDsChallengeIndicator;
return this;
}
public void setTransType(TransTypeEnum transType) {
this.transType = transType;
}
/**
* @param transType transType
* @return bean instance
**/
public ScheduledData transType(TransTypeEnum transType) {
this.transType = transType;
return this;
}
public void setUnits(Integer units) {
this.units = units;
}
/**
* minimum: 1
* @param units Units quantity of the subscription, who can consume their service.
* @return bean instance
**/
public ScheduledData units(Integer units) {
this.units = units;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("ScheduledData( ");
if (contractNumber != null) sb.append("contractNumber=").append(contractNumber.toString()).append("; ");
if (dynamicDescriptor != null) sb.append("dynamicDescriptor=").append(dynamicDescriptor.toString()).append("; ");
if (encryptedData != null) sb.append("encryptedData=").append(encryptedData.toString()).append("; ");
if (generateToken != null) sb.append("generateToken=").append(generateToken.toString()).append("; ");
if (initialAmount != null) sb.append("initialAmount=").append(initialAmount.toString()).append("; ");
if (initiator != null) sb.append("initiator=").append(initiator.toString()).append("; ");
if (note != null) sb.append("note=").append(note.toString()).append("; ");
if (plan != null) sb.append("plan=").append(plan.toString()).append("; ");
if (scheduledType != null) sb.append("scheduledType=").append(scheduledType.toString()).append("; ");
if (subscriptionStart != null) sb.append("subscriptionStart=").append(subscriptionStart.toString()).append("; ");
if (threeDsChallengeIndicator != null) sb.append("threeDsChallengeIndicator=").append(threeDsChallengeIndicator.toString()).append("; ");
if (transType != null) sb.append("transType=").append(transType.toString()).append("; ");
if (units != null) sb.append("units=").append(units.toString()).append("; ");
sb.append(")");
return sb.toString();
}
}