com.github.GBSEcom.model.PaymentCard Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of first-data-gateway Show documentation
Show all versions of first-data-gateway Show documentation
Java SDK to be used with a First Data Gateway account. This SDK has been created and packaged to offer the easiest way to integrate your application into the First Data Gateway. This SDK gives you the ability to run transactions such as sales, preauthorizations, postauthorizations, credits, voids, and returns; transaction inquiries; setting up scheduled payments and much more.
/*
* Payment Gateway API Specification
* Payment Gateway API for payment processing.
*
* OpenAPI spec version: 0.0.1
*
*
* 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.github.GBSEcom.model;
import java.util.Objects;
import com.github.GBSEcom.model.Expiration;
import com.github.GBSEcom.model.PaymentCardAuthenticationRequest;
import com.github.GBSEcom.model.PaymentCardAuthenticationResult;
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 io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.io.IOException;
/**
* PaymentCard
*/
public class PaymentCard {
@SerializedName("number")
private String number = null;
@SerializedName("expiryDate")
private Expiration expiryDate = null;
@SerializedName("securityCode")
private String securityCode = null;
/**
* Gets or Sets cardFunction
*/
@JsonAdapter(CardFunctionEnum.Adapter.class)
public enum CardFunctionEnum {
CREDIT("CREDIT"),
DEBIT("DEBIT");
private String value;
CardFunctionEnum(String value) {
this.value = value;
}
public String getValue() {
return value;
}
@Override
public String toString() {
return String.valueOf(value);
}
public static CardFunctionEnum fromValue(String text) {
for (CardFunctionEnum b : CardFunctionEnum.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 CardFunctionEnum enumeration) throws IOException {
jsonWriter.value(enumeration.getValue());
}
@Override
public CardFunctionEnum read(final JsonReader jsonReader) throws IOException {
String value = jsonReader.nextString();
return CardFunctionEnum.fromValue(String.valueOf(value));
}
}
}
@SerializedName("cardFunction")
private CardFunctionEnum cardFunction = CardFunctionEnum.CREDIT;
@SerializedName("cardholderName")
private String cardholderName = null;
@SerializedName("authenticationRequest")
private PaymentCardAuthenticationRequest authenticationRequest = null;
@SerializedName("authenticationResult")
private PaymentCardAuthenticationResult authenticationResult = null;
@SerializedName("brand")
private String brand = null;
public PaymentCard number(String number) {
this.number = number;
return this;
}
/**
* Payment card number
* @return number
**/
@ApiModelProperty(example = "4035874000424977", required = true, value = "Payment card number")
public String getNumber() {
return number;
}
public void setNumber(String number) {
this.number = number;
}
public PaymentCard expiryDate(Expiration expiryDate) {
this.expiryDate = expiryDate;
return this;
}
/**
* Get expiryDate
* @return expiryDate
**/
@ApiModelProperty(value = "")
public Expiration getExpiryDate() {
return expiryDate;
}
public void setExpiryDate(Expiration expiryDate) {
this.expiryDate = expiryDate;
}
public PaymentCard securityCode(String securityCode) {
this.securityCode = securityCode;
return this;
}
/**
* CVV
* @return securityCode
**/
@ApiModelProperty(example = "977", value = "CVV")
public String getSecurityCode() {
return securityCode;
}
public void setSecurityCode(String securityCode) {
this.securityCode = securityCode;
}
public PaymentCard cardFunction(CardFunctionEnum cardFunction) {
this.cardFunction = cardFunction;
return this;
}
/**
* Get cardFunction
* @return cardFunction
**/
@ApiModelProperty(value = "")
public CardFunctionEnum getCardFunction() {
return cardFunction;
}
public void setCardFunction(CardFunctionEnum cardFunction) {
this.cardFunction = cardFunction;
}
public PaymentCard cardholderName(String cardholderName) {
this.cardholderName = cardholderName;
return this;
}
/**
* Get cardholderName
* @return cardholderName
**/
@ApiModelProperty(example = "John Doe", value = "")
public String getCardholderName() {
return cardholderName;
}
public void setCardholderName(String cardholderName) {
this.cardholderName = cardholderName;
}
public PaymentCard authenticationRequest(PaymentCardAuthenticationRequest authenticationRequest) {
this.authenticationRequest = authenticationRequest;
return this;
}
/**
* Get authenticationRequest
* @return authenticationRequest
**/
@ApiModelProperty(value = "")
public PaymentCardAuthenticationRequest getAuthenticationRequest() {
return authenticationRequest;
}
public void setAuthenticationRequest(PaymentCardAuthenticationRequest authenticationRequest) {
this.authenticationRequest = authenticationRequest;
}
public PaymentCard authenticationResult(PaymentCardAuthenticationResult authenticationResult) {
this.authenticationResult = authenticationResult;
return this;
}
/**
* Get authenticationResult
* @return authenticationResult
**/
@ApiModelProperty(value = "")
public PaymentCardAuthenticationResult getAuthenticationResult() {
return authenticationResult;
}
public void setAuthenticationResult(PaymentCardAuthenticationResult authenticationResult) {
this.authenticationResult = authenticationResult;
}
public PaymentCard brand(String brand) {
this.brand = brand;
return this;
}
/**
* Optional, required only if using dual branded card
* @return brand
**/
@ApiModelProperty(example = "VISA", value = "Optional, required only if using dual branded card")
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
@Override
public boolean equals(java.lang.Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
PaymentCard paymentCard = (PaymentCard) o;
return Objects.equals(this.number, paymentCard.number) &&
Objects.equals(this.expiryDate, paymentCard.expiryDate) &&
Objects.equals(this.securityCode, paymentCard.securityCode) &&
Objects.equals(this.cardFunction, paymentCard.cardFunction) &&
Objects.equals(this.cardholderName, paymentCard.cardholderName) &&
Objects.equals(this.authenticationRequest, paymentCard.authenticationRequest) &&
Objects.equals(this.authenticationResult, paymentCard.authenticationResult) &&
Objects.equals(this.brand, paymentCard.brand);
}
@Override
public int hashCode() {
return Objects.hash(number, expiryDate, securityCode, cardFunction, cardholderName, authenticationRequest, authenticationResult, brand);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class PaymentCard {\n");
sb.append(" number: ").append(toIndentedString(number)).append("\n");
sb.append(" expiryDate: ").append(toIndentedString(expiryDate)).append("\n");
sb.append(" securityCode: ").append(toIndentedString(securityCode)).append("\n");
sb.append(" cardFunction: ").append(toIndentedString(cardFunction)).append("\n");
sb.append(" cardholderName: ").append(toIndentedString(cardholderName)).append("\n");
sb.append(" authenticationRequest: ").append(toIndentedString(authenticationRequest)).append("\n");
sb.append(" authenticationResult: ").append(toIndentedString(authenticationResult)).append("\n");
sb.append(" brand: ").append(toIndentedString(brand)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(java.lang.Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy