/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (CardholderName != null) { hashCode = hashCode * 59 + CardholderName.GetHashCode(); } if (Cryptogram != null) { hashCode = hashCode * 59 + Cryptogram.GetHashCode(); } if (Dpan != null) { hashCode = hashCode * 59 + Dpan.GetHashCode(); } if (Eci != null) { hashCode = hashCode * 59 + Eci.GetHashCode(); } if (ExpiryDate != null) { hashCode = hashCode * 59 + ExpiryDate.GetHashCode(); } return(hashCode); } }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is Card other && ((Id == null && other.Id == null) || (Id?.Equals(other.Id) == true)) && ((CardBrand == null && other.CardBrand == null) || (CardBrand?.Equals(other.CardBrand) == true)) && ((Last4 == null && other.Last4 == null) || (Last4?.Equals(other.Last4) == true)) && ((ExpMonth == null && other.ExpMonth == null) || (ExpMonth?.Equals(other.ExpMonth) == true)) && ((ExpYear == null && other.ExpYear == null) || (ExpYear?.Equals(other.ExpYear) == true)) && ((CardholderName == null && other.CardholderName == null) || (CardholderName?.Equals(other.CardholderName) == true)) && ((BillingAddress == null && other.BillingAddress == null) || (BillingAddress?.Equals(other.BillingAddress) == true)) && ((Fingerprint == null && other.Fingerprint == null) || (Fingerprint?.Equals(other.Fingerprint) == true)) && ((CardType == null && other.CardType == null) || (CardType?.Equals(other.CardType) == true)) && ((PrepaidType == null && other.PrepaidType == null) || (PrepaidType?.Equals(other.PrepaidType) == true)) && ((Bin == null && other.Bin == null) || (Bin?.Equals(other.Bin) == true))); }
public override int GetHashCode() { int hashCode = 1509386817; if (CardNonce != null) { hashCode += CardNonce.GetHashCode(); } if (BillingAddress != null) { hashCode += BillingAddress.GetHashCode(); } if (CardholderName != null) { hashCode += CardholderName.GetHashCode(); } if (VerificationToken != null) { hashCode += VerificationToken.GetHashCode(); } return(hashCode); }
public virtual int _GetUniqueIdentifier() { var hashCode = 399326290; hashCode = hashCode * -1521134295 + (Id?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (PaymentMethod?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (CardholderName?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (CardNumber?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (CCV?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (ExpirationMonth?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (ExpirationYear?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (IBANNumber?.GetHashCode() ?? 0); hashCode = hashCode * -1521134295 + (BankName?.GetHashCode() ?? 0); return(hashCode); }
/// <summary> /// Gets the hash code /// </summary> /// <returns>Hash code</returns> public override int GetHashCode() { unchecked // Overflow is fine, just wrap { var hashCode = 41; // Suitable nullity checks etc, of course :) if (CardholderName != null) { hashCode = hashCode * 59 + CardholderName.GetHashCode(); } if (IssueNumber != null) { hashCode = hashCode * 59 + IssueNumber.GetHashCode(); } return(hashCode); } }
public override int GetHashCode() { int hash = 1; if (CardNumber.Length != 0) { hash ^= CardNumber.GetHashCode(); } if (Cvc.Length != 0) { hash ^= Cvc.GetHashCode(); } if (ExpiryMonth != 0) { hash ^= ExpiryMonth.GetHashCode(); } if (FourDigitExpiryYear != 0) { hash ^= FourDigitExpiryYear.GetHashCode(); } if (Zipcode.Length != 0) { hash ^= Zipcode.GetHashCode(); } if (CardholderName.Length != 0) { hash ^= CardholderName.GetHashCode(); } if (IsVirtualCard != false) { hash ^= IsVirtualCard.GetHashCode(); } if (virtualCardLimit_ != null) { hash ^= VirtualCardLimit.GetHashCode(); } if (virtualCardAvailableOn_ != null) { hash ^= VirtualCardAvailableOn.GetHashCode(); } if (virtualCardExpiresOn_ != null) { hash ^= VirtualCardExpiresOn.GetHashCode(); } return(hash); }
public override bool Equals(object obj) { if (obj == null) { return(false); } if (obj == this) { return(true); } return(obj is CreateCustomerCardRequest other && ((CardNonce == null && other.CardNonce == null) || (CardNonce?.Equals(other.CardNonce) == true)) && ((BillingAddress == null && other.BillingAddress == null) || (BillingAddress?.Equals(other.BillingAddress) == true)) && ((CardholderName == null && other.CardholderName == null) || (CardholderName?.Equals(other.CardholderName) == true)) && ((VerificationToken == null && other.VerificationToken == null) || (VerificationToken?.Equals(other.VerificationToken) == true))); }
/// <summary> /// Returns true if DecryptedPaymentData instances are equal /// </summary> /// <param name="other">Instance of DecryptedPaymentData to be compared</param> /// <returns>Boolean</returns> public bool Equals(DecryptedPaymentData other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CardholderName == other.CardholderName || CardholderName != null && CardholderName.Equals(other.CardholderName) ) && ( Cryptogram == other.Cryptogram || Cryptogram != null && Cryptogram.Equals(other.Cryptogram) ) && ( Dpan == other.Dpan || Dpan != null && Dpan.Equals(other.Dpan) ) && ( Eci == other.Eci || Eci != null && Eci.Equals(other.Eci) ) && ( ExpiryDate == other.ExpiryDate || ExpiryDate != null && ExpiryDate.Equals(other.ExpiryDate) )); }
/// <summary> /// Returns true if CardWithoutCvv instances are equal /// </summary> /// <param name="other">Instance of CardWithoutCvv to be compared</param> /// <returns>Boolean</returns> public bool Equals(CardWithoutCvv other) { if (ReferenceEquals(null, other)) { return(false); } if (ReferenceEquals(this, other)) { return(true); } return (( CardholderName == other.CardholderName || CardholderName != null && CardholderName.Equals(other.CardholderName) ) && ( IssueNumber == other.IssueNumber || IssueNumber != null && IssueNumber.Equals(other.IssueNumber) )); }
public override int GetHashCode() { int hashCode = 1370361237; if (Id != null) { hashCode += Id.GetHashCode(); } if (CardBrand != null) { hashCode += CardBrand.GetHashCode(); } if (Last4 != null) { hashCode += Last4.GetHashCode(); } if (ExpMonth != null) { hashCode += ExpMonth.GetHashCode(); } if (ExpYear != null) { hashCode += ExpYear.GetHashCode(); } if (CardholderName != null) { hashCode += CardholderName.GetHashCode(); } if (BillingAddress != null) { hashCode += BillingAddress.GetHashCode(); } if (Fingerprint != null) { hashCode += Fingerprint.GetHashCode(); } if (CardType != null) { hashCode += CardType.GetHashCode(); } if (PrepaidType != null) { hashCode += PrepaidType.GetHashCode(); } if (Bin != null) { hashCode += Bin.GetHashCode(); } return(hashCode); }