Пример #1
0
 /// <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 (Card != null)
         {
             hashCode = hashCode * 59 + Card.GetHashCode();
         }
         if (ExternalCardholderAuthenticationData != null)
         {
             hashCode = hashCode * 59 + ExternalCardholderAuthenticationData.GetHashCode();
         }
         if (IsRecurring != null)
         {
             hashCode = hashCode * 59 + IsRecurring.GetHashCode();
         }
         if (ReturnUrl != null)
         {
             hashCode = hashCode * 59 + ReturnUrl.GetHashCode();
         }
         return(hashCode);
     }
 }
Пример #2
0
        /// <summary>
        /// Returns true if CardPaymentMethodSpecificInput instances are equal
        /// </summary>
        /// <param name="other">Instance of CardPaymentMethodSpecificInput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CardPaymentMethodSpecificInput other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Card == other.Card ||
                     Card != null &&
                     Card.Equals(other.Card)
                     ) &&
                 (
                     ExternalCardholderAuthenticationData == other.ExternalCardholderAuthenticationData ||
                     ExternalCardholderAuthenticationData != null &&
                     ExternalCardholderAuthenticationData.Equals(other.ExternalCardholderAuthenticationData)
                 ) &&
                 (
                     IsRecurring == other.IsRecurring ||
                     IsRecurring != null &&
                     IsRecurring.Equals(other.IsRecurring)
                 ) &&
                 (
                     ReturnUrl == other.ReturnUrl ||
                     ReturnUrl != null &&
                     ReturnUrl.Equals(other.ReturnUrl)
                 ));
        }