private CreatePayment CreatePaymentCommand(Order order) { var description = "Payment for the order of " + this.ConferenceAlias.Name; var paymentCommand = new CreatePayment { AggregateRootId = GuidUtil.NewSequentialId(), ConferenceId = this.ConferenceAlias.Id, OrderId = order.OrderId, Description = description, TotalAmount = order.TotalAmount, Lines = order.GetLines().Select(x => new PaymentLine { Id = x.SeatTypeId, Description = x.SeatTypeName, Amount = x.LineTotal }) }; return paymentCommand; }
private ActionResult CompleteRegistrationWithThirdPartyProcessorPayment(Order order) { var paymentCommand = CreatePaymentCommand(order); SendCommandAsync(paymentCommand); var paymentAcceptedUrl = this.Url.Action("ThankYou", new { conferenceCode = this.ConferenceAlias.Slug, order.OrderId }); var paymentRejectedUrl = this.Url.Action("ShowRejectedOrder", new { conferenceCode = this.ConferenceAlias.Slug, orderId = order.OrderId }); return RedirectToAction( "ThirdPartyProcessorPayment", "Payment", new { conferenceCode = this.ConferenceAlias.Slug, paymentId = paymentCommand.AggregateRootId, paymentAcceptedUrl, paymentRejectedUrl }); }