Exemplo n.º 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 (AuthorizationMode != null)
         {
             hashCode = hashCode * 59 + AuthorizationMode.GetHashCode();
         }
         if (DecryptedPaymentData != null)
         {
             hashCode = hashCode * 59 + DecryptedPaymentData.GetHashCode();
         }
         if (EncryptedPaymentData != null)
         {
             hashCode = hashCode * 59 + EncryptedPaymentData.GetHashCode();
         }
         if (RequiresApproval != null)
         {
             hashCode = hashCode * 59 + RequiresApproval.GetHashCode();
         }
         if (SkipFraudService != null)
         {
             hashCode = hashCode * 59 + SkipFraudService.GetHashCode();
         }
         if (TransactionId != null)
         {
             hashCode = hashCode * 59 + TransactionId.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 2
0
        /// <summary>
        /// Returns true if MobilePaymentMethodSpecificInput instances are equal
        /// </summary>
        /// <param name="other">Instance of MobilePaymentMethodSpecificInput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(MobilePaymentMethodSpecificInput other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     AuthorizationMode == other.AuthorizationMode ||
                     AuthorizationMode != null &&
                     AuthorizationMode.Equals(other.AuthorizationMode)
                     ) &&
                 (
                     DecryptedPaymentData == other.DecryptedPaymentData ||
                     DecryptedPaymentData != null &&
                     DecryptedPaymentData.Equals(other.DecryptedPaymentData)
                 ) &&
                 (
                     EncryptedPaymentData == other.EncryptedPaymentData ||
                     EncryptedPaymentData != null &&
                     EncryptedPaymentData.Equals(other.EncryptedPaymentData)
                 ) &&
                 (
                     RequiresApproval == other.RequiresApproval ||
                     RequiresApproval != null &&
                     RequiresApproval.Equals(other.RequiresApproval)
                 ) &&
                 (
                     SkipFraudService == other.SkipFraudService ||
                     SkipFraudService != null &&
                     SkipFraudService.Equals(other.SkipFraudService)
                 ) &&
                 (
                     TransactionId == other.TransactionId ||
                     TransactionId != null &&
                     TransactionId.Equals(other.TransactionId)
                 ));
        }