public static void SetStartedStatus(PaymentAttempt paymentAttempt, CreditCardPaymentAttempt creditCardPayment, string reason) { creditCardPayment.IsStarted = true; var paymentStarted = new PaymentAttemptStatusStarted { Reason = reason, Time = DateTime.Now, PaymentAttempt = paymentAttempt }; }
public static void SetFailedStatus(PaymentAttempt paymentAttempt, CreditCardPaymentAttempt creditCardPayment, string reason) { creditCardPayment.IsFinished = true; creditCardPayment.IsSuccessful = false; var paymentStarted = new PaymentAttemptStatusFailed { Reason = reason, Time = DateTime.Now, PaymentAttempt = paymentAttempt }; }
public async Task <string> CreatePaymentAttemptAsync(string userId, int semesterId, decimal price) { var attempt = new PaymentAttempt { StudentId = userId, SemesterId = semesterId, Price = price, }; await this.paymentAttemptRepository.AddAsync(attempt); await this.paymentAttemptRepository.SaveChangesAsync(); return(attempt.Id); }