Exemplo n.º 1
0
        /// <summary>
        /// Returns true if CancelPaymentResponse instances are equal
        /// </summary>
        /// <param name="other">Instance of CancelPaymentResponse to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CancelPaymentResponse other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CardPaymentMethodSpecificOutput == other.CardPaymentMethodSpecificOutput ||
                     CardPaymentMethodSpecificOutput != null &&
                     CardPaymentMethodSpecificOutput.Equals(other.CardPaymentMethodSpecificOutput)
                     ) &&
                 (
                     MobilePaymentMethodSpecificOutput == other.MobilePaymentMethodSpecificOutput ||
                     MobilePaymentMethodSpecificOutput != null &&
                     MobilePaymentMethodSpecificOutput.Equals(other.MobilePaymentMethodSpecificOutput)
                 ) &&
                 (
                     Payment == other.Payment ||
                     Payment != null &&
                     Payment.Equals(other.Payment)
                 ));
        }
Exemplo n.º 2
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 (AmountPaid != null)
         {
             hashCode = hashCode * 59 + AmountPaid.GetHashCode();
         }
         if (CardPaymentMethodSpecificOutput != null)
         {
             hashCode = hashCode * 59 + CardPaymentMethodSpecificOutput.GetHashCode();
         }
         if (MobilePaymentMethodSpecificOutput != null)
         {
             hashCode = hashCode * 59 + MobilePaymentMethodSpecificOutput.GetHashCode();
         }
         if (PaymentMethod != null)
         {
             hashCode = hashCode * 59 + PaymentMethod.GetHashCode();
         }
         if (RedirectPaymentMethodSpecificOutput != null)
         {
             hashCode = hashCode * 59 + RedirectPaymentMethodSpecificOutput.GetHashCode();
         }
         return(hashCode);
     }
 }
Exemplo n.º 3
0
        /// <summary>
        /// Returns true if CaptureOutput instances are equal
        /// </summary>
        /// <param name="other">Instance of CaptureOutput to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(CaptureOutput other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     CardPaymentMethodSpecificOutput == other.CardPaymentMethodSpecificOutput ||
                     CardPaymentMethodSpecificOutput != null &&
                     CardPaymentMethodSpecificOutput.Equals(other.CardPaymentMethodSpecificOutput)
                     ) &&
                 (
                     MobilePaymentMethodSpecificOutput == other.MobilePaymentMethodSpecificOutput ||
                     MobilePaymentMethodSpecificOutput != null &&
                     MobilePaymentMethodSpecificOutput.Equals(other.MobilePaymentMethodSpecificOutput)
                 ) &&
                 (
                     PaymentMethod == other.PaymentMethod ||
                     PaymentMethod != null &&
                     PaymentMethod.Equals(other.PaymentMethod)
                 ) &&
                 (
                     RedirectPaymentMethodSpecificOutput == other.RedirectPaymentMethodSpecificOutput ||
                     RedirectPaymentMethodSpecificOutput != null &&
                     RedirectPaymentMethodSpecificOutput.Equals(other.RedirectPaymentMethodSpecificOutput)
                 ));
        }