com.cardpay.sdk.model.RecurringData 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.annotations.SerializedName;
import java.math.BigDecimal;
import lombok.Data;
@Data
public class RecurringData {
@SerializedName("contract_number")
private String contractNumber = null;
@SerializedName("initial_amount")
private BigDecimal initialAmount = null;
@SerializedName("plan")
private Plan plan = null;
@SerializedName("subscription_start")
private String subscriptionStart = null;
@SerializedName("type")
private String type = null;
public void setContractNumber(String contractNumber) {
this.contractNumber = contractNumber;
}
/**
* @param contractNumber Contract number between customer and merchant. Required for Mexican merchants
* @return bean instance
**/
public RecurringData contractNumber(String contractNumber) {
this.contractNumber = contractNumber;
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 RecurringData initialAmount(BigDecimal initialAmount) {
this.initialAmount = initialAmount;
return this;
}
public void setPlan(Plan plan) {
this.plan = plan;
}
/**
* @param plan Plan data
* @return bean instance
**/
public RecurringData plan(Plan plan) {
this.plan = plan;
return this;
}
public void setSubscriptionStart(String 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 RecurringData subscriptionStart(String subscriptionStart) {
this.subscriptionStart = subscriptionStart;
return this;
}
public void setType(String type) {
this.type = type;
}
/**
* @param type Scheduled payment type attribute. Supported values are: `SM` - value for scheduled by merchant case `SA` - value for scheduled by acquirer case The default value is SA
* @return bean instance
**/
public RecurringData type(String type) {
this.type = type;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("RecurringData( ");
if (contractNumber != null) sb.append("contractNumber=").append(contractNumber.toString()).append("; ");
if (initialAmount != null) sb.append("initialAmount=").append(initialAmount.toString()).append("; ");
if (plan != null) sb.append("plan=").append(plan.toString()).append("; ");
if (subscriptionStart != null) sb.append("subscriptionStart=").append(subscriptionStart.toString()).append("; ");
if (type != null) sb.append("type=").append(type.toString()).append("; ");
sb.append(")");
return sb.toString();
}
}