package com.hbc.api.fraud.v0.models; import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.core.JsonProcessingException; import java.io.IOException; import java.lang.Integer; import java.lang.Object; import java.lang.Override; import java.lang.String; import java.math.BigDecimal; /** * Generated by API Builder - https://www.apibuilder.io * Service version: 0.0.2 * User agent: apibuilder app.apibuilder.io/hbc/api-fraud/0.0.2/android_client * * WARNING: not all features (notably unions) and data types work with android generator yet. * Android generator is designed to be used in an android application, but should work in any java codebase as long as you import jackson and retrofit2 libraries. * If you are considering using this library, would like to request/discuss features, or would like to share how you're using it, please contact android-feedback@gilt.com * * A customer's complete credit card information */ @JsonIgnoreProperties( ignoreUnknown = true ) public class CreditCard { private final String nameOnCard; private final Address billingAddress; private final String cardType; private final String cardNumber; private final BigDecimal authorizedAmount; private final BigDecimal fullAmount; private final String expiryDate; private final String authCode; private final Integer responseCode; private final Integer merchantId; private final String registerNumber; private final String transactionNumber; private final String avsResponse; @JsonCreator public CreditCard(@JsonProperty("nameOnCard") String nameOnCard, @JsonProperty("billingAddress") Address billingAddress, @JsonProperty("cardType") String cardType, @JsonProperty("cardNumber") String cardNumber, @JsonProperty("authorizedAmount") BigDecimal authorizedAmount, @JsonProperty("fullAmount") BigDecimal fullAmount, @JsonProperty("expiryDate") String expiryDate, @JsonProperty("authCode") String authCode, @JsonProperty("responseCode") Integer responseCode, @JsonProperty("merchantId") Integer merchantId, @JsonProperty("registerNumber") String registerNumber, @JsonProperty("transactionNumber") String transactionNumber, @JsonProperty("avsResponse") String avsResponse) { this.nameOnCard = nameOnCard; this.billingAddress = billingAddress; this.cardType = cardType; this.cardNumber = cardNumber; this.authorizedAmount = authorizedAmount; this.fullAmount = fullAmount; this.expiryDate = expiryDate; this.authCode = authCode; this.responseCode = responseCode; this.merchantId = merchantId; this.registerNumber = registerNumber; this.transactionNumber = transactionNumber; this.avsResponse = avsResponse; } public String getNameOnCard() { return nameOnCard; } public Address getBillingAddress() { return billingAddress; } public String getCardType() { return cardType; } public String getCardNumber() { return cardNumber; } public BigDecimal getAuthorizedAmount() { return authorizedAmount; } public BigDecimal getFullAmount() { return fullAmount; } /** * MM-YY that the credit card expires */ public String getExpiryDate() { return expiryDate; } /** * CVV code on the back of the card */ public String getAuthCode() { return authCode; } public Integer getResponseCode() { return responseCode; } public Integer getMerchantId() { return merchantId; } public String getRegisterNumber() { return registerNumber; } public String getTransactionNumber() { return transactionNumber; } /** * Address Verification System response, Codes are available here: https://www.chasepaymentech.com/address_verification_service.html */ public String getAvsResponse() { return avsResponse; } @Override public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; CreditCard that = (CreditCard) o; if (nameOnCard != null ? !nameOnCard.equals(that.nameOnCard) : that.nameOnCard != null) return false; if (billingAddress != null ? !billingAddress.equals(that.billingAddress) : that.billingAddress != null) return false; if (cardType != null ? !cardType.equals(that.cardType) : that.cardType != null) return false; if (cardNumber != null ? !cardNumber.equals(that.cardNumber) : that.cardNumber != null) return false; if (authorizedAmount != null ? !authorizedAmount.equals(that.authorizedAmount) : that.authorizedAmount != null) return false; if (fullAmount != null ? !fullAmount.equals(that.fullAmount) : that.fullAmount != null) return false; if (expiryDate != null ? !expiryDate.equals(that.expiryDate) : that.expiryDate != null) return false; if (authCode != null ? !authCode.equals(that.authCode) : that.authCode != null) return false; if (responseCode != null ? !responseCode.equals(that.responseCode) : that.responseCode != null) return false; if (merchantId != null ? !merchantId.equals(that.merchantId) : that.merchantId != null) return false; if (registerNumber != null ? !registerNumber.equals(that.registerNumber) : that.registerNumber != null) return false; if (transactionNumber != null ? !transactionNumber.equals(that.transactionNumber) : that.transactionNumber != null) return false; if (avsResponse != null ? !avsResponse.equals(that.avsResponse) : that.avsResponse != null) return false; return true; } @Override public int hashCode() { int result = 0; result = 31 * result + (nameOnCard != null ? nameOnCard.hashCode() : 0); result = 31 * result + (billingAddress != null ? billingAddress.hashCode() : 0); result = 31 * result + (cardType != null ? cardType.hashCode() : 0); result = 31 * result + (cardNumber != null ? cardNumber.hashCode() : 0); result = 31 * result + (authorizedAmount != null ? authorizedAmount.hashCode() : 0); result = 31 * result + (fullAmount != null ? fullAmount.hashCode() : 0); result = 31 * result + (expiryDate != null ? expiryDate.hashCode() : 0); result = 31 * result + (authCode != null ? authCode.hashCode() : 0); result = 31 * result + (responseCode != null ? responseCode.hashCode() : 0); result = 31 * result + (merchantId != null ? merchantId.hashCode() : 0); result = 31 * result + (registerNumber != null ? registerNumber.hashCode() : 0); result = 31 * result + (transactionNumber != null ? transactionNumber.hashCode() : 0); result = 31 * result + (avsResponse != null ? avsResponse.hashCode() : 0); return result; } public String toJsonString() throws JsonProcessingException { return com.hbc.api.fraud.v0.android.ApiBuilderObjectMapper.getInstance().writeValueAsString(this); } public static CreditCard parseJson(String json) throws IOException { return com.hbc.api.fraud.v0.android.ApiBuilderObjectMapper.getInstance().readValue( json, CreditCard.class); } }