예제 #1
0
        public YahooHeaderRow(
            string prefix,
            Order order,
            Address billingAddress,
            string stateAbbreviation,
            string country,
            string decryptedCardName,
            string decryptedCardNumber,
            string decryptedExpirationMonth,
            string decryptedExpirationYear,
            string decryptedCvv2,
            decimal taxCharge,
            decimal total,
            string giftCard,
            decimal giftCardAmountUsed,
            string cardRefNo
            )
        {
            Id         = $"{prefix}{order.Id}+p";
            FullName   = $"{billingAddress.FirstName} {billingAddress.LastName}";
            FirstName  = billingAddress.FirstName;
            LastName   = billingAddress.LastName;
            Address1   = billingAddress.Address1;
            Address2   = billingAddress.Address2;
            City       = billingAddress.City;
            State      = stateAbbreviation;
            Zip        = billingAddress.ZipPostalCode;
            Country    = country;
            Phone      = billingAddress.PhoneNumber;
            Email      = billingAddress.Email;
            CardName   = decryptedCardName;
            CardNumber = decryptedCardNumber != null ?
                         new string(decryptedCardNumber.Where(c => char.IsDigit(c)).ToArray()) :
                         null;
            CardExpiry         = $"{decryptedExpirationMonth}/{decryptedExpirationYear}";
            CardCvv2           = decryptedCvv2;
            TaxCharge          = taxCharge;
            Total              = total;
            GiftCard           = giftCard;
            GiftCardAmountUsed = giftCardAmountUsed;

            AuthCode  = order.AuthorizationTransactionCode;
            CcRefNo   = cardRefNo;
            Datestamp = order.CreatedOnUtc.ToString();
            Ip        = order.CustomerIp;
            if (!string.IsNullOrWhiteSpace(Ip) && Ip.IndexOf(",") > 0)
            {
                var index = Ip.IndexOf(",");
                Ip = Ip.Substring(0, index - 1);
            }
        }