Beispiel #1
0
        /// <summary>
        /// Constructs Payment Description
        /// </summary>
        /// <param name="transId"></param>
        /// <param name="ps"></param>
        /// <returns></returns>
        private static string GetPaymentDescription(int transId, PaymentStatus ps)
        {
            string _paymentType = string.Empty;

            if (ps.Equals(PaymentStatus.PENDING_PAYMENT))
            {
                _paymentType = "Pending";
            }
            else if (ps.Equals(PaymentStatus.PURCHASE_PAYMENT) || ps.Equals(PaymentStatus.PURCHASEREVERSAL_PAYMENT))
            {
                _paymentType = "Purchase";
            }
            else if (ps.Equals(PaymentStatus.SALE_PAYMENT) || ps.Equals(PaymentStatus.SALEREVERSAL_PAYMENT))
            {
                _paymentType = "Sale";
            }
            else if (ps.Equals(PaymentStatus.SUPPORT_PAYMENT) || ps.Equals(PaymentStatus.SUPPORTREVERSAL_PAYMENT))
            {
                _paymentType = "Support";
            }
            else
            {
                _paymentType = "";
            }
            return($"{_paymentType} from transId : {Convert.ToString(transId)}");
        }
Beispiel #2
0
        /// <summary>
        /// Returns true if Transaction instances are equal
        /// </summary>
        /// <param name="other">Instance of Transaction to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(Transaction other)
        {
            if (ReferenceEquals(null, other))
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     TransactionID == other.TransactionID ||
                     TransactionID != null &&
                     TransactionID.Equals(other.TransactionID)
                     ) &&
                 (
                     BuyerFirstName == other.BuyerFirstName ||
                     BuyerFirstName != null &&
                     BuyerFirstName.Equals(other.BuyerFirstName)
                 ) &&
                 (
                     BuyerLastName == other.BuyerLastName ||
                     BuyerLastName != null &&
                     BuyerLastName.Equals(other.BuyerLastName)
                 ) &&
                 (
                     BuyerAddress == other.BuyerAddress ||
                     BuyerAddress != null &&
                     BuyerAddress.Equals(other.BuyerAddress)
                 ) &&
                 (
                     BuyerCity == other.BuyerCity ||
                     BuyerCity != null &&
                     BuyerCity.Equals(other.BuyerCity)
                 ) &&
                 (
                     BuyerEmail == other.BuyerEmail ||
                     BuyerEmail != null &&
                     BuyerEmail.Equals(other.BuyerEmail)
                 ) &&
                 (
                     BuyerUserId == other.BuyerUserId ||
                     BuyerUserId != null &&
                     BuyerUserId.Equals(other.BuyerUserId)
                 ) &&
                 (
                     PaymentStatus == other.PaymentStatus ||
                     PaymentStatus != null &&
                     PaymentStatus.Equals(other.PaymentStatus)
                 ) &&
                 (
                     PaymentReferenceId == other.PaymentReferenceId ||
                     PaymentReferenceId != null &&
                     PaymentReferenceId.Equals(other.PaymentReferenceId)
                 ) &&
                 (
                     TotalAmount == other.TotalAmount ||
                     TotalAmount != null &&
                     TotalAmount.Equals(other.TotalAmount)
                 ));
        }