com.cardpay.sdk.model.PaymentRequestCard 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 lombok.Data;
@Data
public class PaymentRequestCard {
/**
* Gets or Sets acctType
*/
@JsonAdapter(AcctTypeEnum.Adapter.class)
public enum AcctTypeEnum {
_01("01"),
_02("02"),
_03("03");
private String value;
AcctTypeEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static AcctTypeEnum fromValue(String text) {
for (AcctTypeEnum b : AcctTypeEnum.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 AcctTypeEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public AcctTypeEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return AcctTypeEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("acct_type")
private AcctTypeEnum acctType = null;
@SerializedName("expiration")
private String expiration = null;
@SerializedName("holder")
private String holder = null;
@SerializedName("network_token")
private Boolean networkToken = null;
@SerializedName("pan")
private String pan = null;
@SerializedName("pin_code")
private String pinCode = null;
@SerializedName("security_code")
private String securityCode = null;
@SerializedName("token_cryptogram")
private String tokenCryptogram = null;
public void setAcctType(AcctTypeEnum acctType) {
this.acctType = acctType;
}
/**
* @param acctType acctType
* @return bean instance
**/
public PaymentRequestCard acctType(AcctTypeEnum acctType) {
this.acctType = acctType;
return this;
}
public void setExpiration(String expiration) {
this.expiration = expiration;
}
/**
* @param expiration Customer's card expiration date. Format: `mm/yyyy`
* @return bean instance
**/
public PaymentRequestCard expiration(String expiration) {
this.expiration = expiration;
return this;
}
public void setHolder(String holder) {
this.holder = holder;
}
/**
* @param holder Customer's cardholder name. Any valid cardholder name
* @return bean instance
**/
public PaymentRequestCard holder(String holder) {
this.holder = holder;
return this;
}
public void setNetworkToken(Boolean networkToken) {
this.networkToken = networkToken;
}
/**
* @param networkToken networkToken
* @return bean instance
**/
public PaymentRequestCard networkToken(Boolean networkToken) {
this.networkToken = networkToken;
return this;
}
public void setPan(String pan) {
this.pan = pan;
}
/**
* @param pan Customer's card number (PAN). Any valid card number, may contain spaces
* @return bean instance
**/
public PaymentRequestCard pan(String pan) {
this.pan = pan;
return this;
}
public void setPinCode(String pinCode) {
this.pinCode = pinCode;
}
/**
* @param pinCode pinCode
* @return bean instance
**/
public PaymentRequestCard pinCode(String pinCode) {
this.pinCode = pinCode;
return this;
}
public void setSecurityCode(String securityCode) {
this.securityCode = securityCode;
}
/**
* @param securityCode Customer's CVV2 / CVC2 / CAV2
* @return bean instance
**/
public PaymentRequestCard securityCode(String securityCode) {
this.securityCode = securityCode;
return this;
}
public void setTokenCryptogram(String tokenCryptogram) {
this.tokenCryptogram = tokenCryptogram;
}
/**
* @param tokenCryptogram tokenCryptogram
* @return bean instance
**/
public PaymentRequestCard tokenCryptogram(String tokenCryptogram) {
this.tokenCryptogram = tokenCryptogram;
return this;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("PaymentRequestCard( ");
if (acctType != null) sb.append("acctType=").append(acctType.toString()).append("; ");
if (expiration != null) sb.append("expiration=").append(expiration.toString()).append("; ");
if (holder != null) sb.append("holder=").append(holder.toString()).append("; ");
if (networkToken != null) sb.append("networkToken=").append(networkToken.toString()).append("; ");
if (pan != null) sb.append("pan=").append(pan.toString()).append("; ");
if (pinCode != null) sb.append("pinCode=").append(pinCode.toString()).append("; ");
if (securityCode != null) sb.append("securityCode=").append(securityCode.toString()).append("; ");
if (tokenCryptogram != null) sb.append("tokenCryptogram=").append(tokenCryptogram.toString()).append("; ");
sb.append(")");
return sb.toString();
}
}