public async Task <IActionResult> Order( [FromServices] IEmailSink emailSink, [FromServices] IWebHostEnvironment env, [FromServices] GetOrder getOrder) { if (env.IsProduction()) { return(Ok()); } var order = getOrder.Do("dummy"); var templatePath = Path.Combine(env.WebRootPath, "email-templates", "order.liquid"); var templateString = await System.IO.File.ReadAllTextAsync(templatePath); var template = Template.Parse(templateString); await emailSink.SendAsync(new EmailRequest { Subject = "Test", To = "*****@*****.**", Message = template.Render(Hash.FromAnonymousObject(ToAnon(order))), Html = true, }); return(Ok()); }
public IActionResult OnGet(string id, [FromServices] GetOrder getOrder) { if (string.IsNullOrEmpty(id)) { return(RedirectToPage("/Index")); } Order = getOrder.Do(id); if (Order == null) { return(RedirectToPage("/Index")); } return(Page()); }
private async Task <IActionResult> ReturnToPayment(string orderNumber) { var userType = GetUserType(); var isBusiness = userType != "user"; var PaymentReference = Guid.NewGuid().ToString(); var order = _getOrder.Do(orderNumber); var redirectUrl = _payment.GetRedirectLink(new OneOffPayment.Request { BuyerEmail = GetUserEmail(), //PaymentReference = PaymentReference, PaymentReference = order.OrderNumber, TotalValue = order.Subtotal }); return(Redirect(redirectUrl)); }
public IActionResult GetOrder( int id, [FromServices] GetOrder getOrder) => Ok(getOrder.Do(id));
public async Task OnGet([FromServices] GetOrder getOrder, string orderRef) { Order = await getOrder.Do(orderRef); }
public void OnGet([FromServices] GetOrder getOrder, string reference) { Order = getOrder.Do(reference); }
public void OnGet(string refrence, [FromServices] GetOrder getOrder) { Order = getOrder.Do(refrence); }
public async Task <IActionResult> GetOrder( int id, [FromServices] GetOrder getOrder) => Ok(await getOrder.Do(id));
public void OnGet(int id, [FromServices] GetOrder getOrder) { Order = getOrder.Do(id); }