public async Task <IActionResult> Processing(PaymeSuccessCallback model, [FromServices] ICommandBus commandBus, [FromServices] TelemetryClient logger, CancellationToken token) { if (model.Status.Equals("success", StringComparison.OrdinalIgnoreCase)) { var command = new ConfirmPaymentCommand(model.UserId); await commandBus.DispatchAsync(command, token); } else { var values = Request.Form.ToDictionary(s => s.Key, x => x.Value.ToString()); values.Add("userId", model.UserId.ToString()); logger.TrackTrace("Credit Card Process Failed", values); } return(View("Processing", model)); }
public void Handle(ICommandContext context, ConfirmPaymentCommand command) { context.Get <Order>(command.AggregateRootId).ConfirmPayment( command.PayInfo, command.IsPaymentSuccess); }