Example #1
0
 public void MergeFrom(NotPresentPaymentCard other)
 {
     if (other == null)
     {
         return;
     }
     if (other.CardNumber.Length != 0)
     {
         CardNumber = other.CardNumber;
     }
     if (other.Cvc.Length != 0)
     {
         Cvc = other.Cvc;
     }
     if (other.ExpiryMonth != 0)
     {
         ExpiryMonth = other.ExpiryMonth;
     }
     if (other.FourDigitExpiryYear != 0)
     {
         FourDigitExpiryYear = other.FourDigitExpiryYear;
     }
     if (other.Zipcode.Length != 0)
     {
         Zipcode = other.Zipcode;
     }
     if (other.CardholderName.Length != 0)
     {
         CardholderName = other.CardholderName;
     }
     if (other.IsVirtualCard != false)
     {
         IsVirtualCard = other.IsVirtualCard;
     }
     if (other.virtualCardLimit_ != null)
     {
         if (virtualCardLimit_ == null)
         {
             virtualCardLimit_ = new global::HOLMS.Types.Primitive.MonetaryAmount();
         }
         VirtualCardLimit.MergeFrom(other.VirtualCardLimit);
     }
     if (other.virtualCardAvailableOn_ != null)
     {
         if (virtualCardAvailableOn_ == null)
         {
             virtualCardAvailableOn_ = new global::HOLMS.Types.Primitive.PbLocalDate();
         }
         VirtualCardAvailableOn.MergeFrom(other.VirtualCardAvailableOn);
     }
     if (other.virtualCardExpiresOn_ != null)
     {
         if (virtualCardExpiresOn_ == null)
         {
             virtualCardExpiresOn_ = new global::HOLMS.Types.Primitive.PbLocalDate();
         }
         VirtualCardExpiresOn.MergeFrom(other.VirtualCardExpiresOn);
     }
 }
Example #2
0
        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);
        }