private Repositories.Models.Payment createNewPayment(string courseCatalogId, string courseName, string newSubscriptionId, PurchaseCourseViewModel model, double totalChargedAmount, DateTime currentTime, bool isPaymentSuccess)
        {
            var payment = new Repositories.Models.Payment
            {
                id                 = Guid.NewGuid().ToString(),
                FirstName          = model.CreditCardInfo.FirstName,
                LastName           = model.CreditCardInfo.LastName,
                Last4Digits        = model.CreditCardInfo.LastFourDigits,
                CardType           = model.CreditCardInfo.CardType.ToString(),
                CardNumber         = APIUtil.EncodeCreditCard(model.CreditCardInfo.CardNumber),
                TotalChargedAmount = totalChargedAmount,
                BillingAddress     = model.PrimaryAddress.Address,
                State              = model.PrimaryAddress.State,
                City               = model.PrimaryAddress.City,
                Country            = model.PrimaryAddress.Country.ToString(),
                ZipCode            = model.PrimaryAddress.ZipCode,
                CourseName         = courseName,
                IsCompleted        = isPaymentSuccess,
                CourseCatalogId    = courseCatalogId,
                SubscriptionId     = newSubscriptionId,
                CreatedDate        = currentTime,
            };

            return(payment);
        }
 private Repositories.Models.Payment createNewPayment(string courseCatalogId, string courseName, string newSubscriptionId, PurchaseCourseViewModel model, double totalChargedAmount, DateTime currentTime, bool isPaymentSuccess)
 {
     var payment = new Repositories.Models.Payment
     {
         id = Guid.NewGuid().ToString(),
         FirstName = model.CreditCardInfo.FirstName,
         LastName = model.CreditCardInfo.LastName,
         Last4Digits = model.CreditCardInfo.LastFourDigits,
         CardType = model.CreditCardInfo.CardType.ToString(),
         CardNumber = APIUtil.EncodeCreditCard(model.CreditCardInfo.CardNumber),
         TotalChargedAmount = totalChargedAmount,
         BillingAddress = model.PrimaryAddress.Address,
         State = model.PrimaryAddress.State,
         City = model.PrimaryAddress.City,
         Country = model.PrimaryAddress.Country.ToString(),
         ZipCode = model.PrimaryAddress.ZipCode,
         CourseName = courseName,
         IsCompleted = isPaymentSuccess,
         CourseCatalogId = courseCatalogId,
         SubscriptionId = newSubscriptionId,
         CreatedDate = currentTime,
     };
     return payment;
 }