File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 ViewData [" Title" ] = " Home page" ;
55}
66
7+ <section class =" esh-catalog-hero" >
8+ </section >
9+
710<div class =" text-center" >
8- <h1 class =" display-4" >Welcome</h1 >
9- <p >eShopOnContainers - Webhook client</p >
11+ <p >  ; </p >
12+ <img class =" esh-app-footer-brand" src =" ~/images/brand.png" />
13+ <h2 >eShopOnContainers - Order Management</h2 >
14+ <p >
15+ This is a <bold >sample</bold > web client that uses the Webhooks API to show you all orders that reached the "paid" status. This is accomplished by creating a Webhook
16+ that will be called by eShopOnContainers core when the order reached this "paid" status. If not created you can create this webhook going to <a asp-page =" RegisterWebhook" >webhook registration</a >.
17+ </p >
1018 @if (! User .Identity .IsAuthenticated )
1119 {
1220 <a class =" btn-primary btn" href =" @Url.Action(" SignIn " , " Account " )" >Login </a >
1523</div >
1624
1725<div class =" table" >
18- <h3 >Current webhooks received</h3 >
19- <p >(Data since last time web started up)<p >
26+ <h3 >Current webhooks received (orders paid) </h3 >
27+ <p >(Data since last time web started up). < strong >Note: </ strong >Must manually refresh this page. <p >
2028 <table class =" table" >
2129 @foreach ( var webhook in Model .WebHooksReceived )
2230 {
Original file line number Diff line number Diff line change 44 ViewData [" Title" ] = " RegisterWebhook" ;
55}
66
7- <h3 >Register webhook</h3 >
7+ <h3 >Register a new webhook</h3 >
88
9- <p >This page registers the "OrderPaid" Webhook by sending a POST to webhooks .</p >
9+ <p >This page registers the "OrderPaid" Webhook by sending a POST to the WebHooks API. Once the Webhook is set, you will be able to see new paid orders from the < a asp-page = " Index " >Index</ a > page .</p >
1010
1111<form method =" post" >
1212 <p >Token: <input type =" text" asp-for =" Token" /></p >
1515
1616@if (Model .ResponseCode != (int )System .Net .HttpStatusCode .OK )
1717{
18- <p >Error @Model.ResponseCode (@Model .ResponseMessage ) when calling the Webhooks API (@Model .RequestUrl ) with GrantUrl : @Model.GrantUrl) : (< / p >
18+ <p >Error @Model.ResponseCode (@Model .ResponseMessage ) when calling the Webhooks API (@Model .RequestUrl ) with GrantUrl : @Model.GrantUrl) </p >
19+ <p >Data sent to the webhooks API was <raw >@Model.RequestBodyJson </raw ></p >
1920}
Original file line number Diff line number Diff line change 1010using Microsoft . AspNetCore . Mvc ;
1111using Microsoft . AspNetCore . Mvc . RazorPages ;
1212using Microsoft . Extensions . Options ;
13+ using Newtonsoft . Json ;
1314using WebhookClient . Models ;
1415
1516namespace WebhookClient . Pages
@@ -27,7 +28,7 @@ public class RegisterWebhookModel : PageModel
2728 public string RequestUrl { get ; set ; }
2829 public string GrantUrl { get ; set ; }
2930 public string ResponseMessage { get ; set ; }
30-
31+ public string RequestBodyJson { get ; set ; }
3132
3233 public RegisterWebhookModel ( IOptions < Settings > settings , IHttpClientFactory httpClientFactory )
3334 {
@@ -69,6 +70,7 @@ public async Task<IActionResult> OnPost()
6970 }
7071 else
7172 {
73+ RequestBodyJson = JsonConvert . SerializeObject ( payload ) ;
7274 ResponseCode = ( int ) response . StatusCode ;
7375 ResponseMessage = response . ReasonPhrase ;
7476 GrantUrl = granturl ;
Original file line number Diff line number Diff line change 33<head >
44 <meta charset =" utf-8" />
55 <meta name =" viewport" content =" width=device-width, initial-scale=1.0" />
6- <title >@ViewData ["Title"] - WebhookClient </title >
6+ <title >@ViewData ["Title"] - Order Management </title >
77
88 <environment include =" Development" >
99 <link rel =" stylesheet" href =" ~/lib/bootstrap/dist/css/bootstrap.css" />
2121 <header >
2222 <nav class =" navbar navbar-expand-sm navbar-toggleable-sm navbar-light bg-white border-bottom box-shadow mb-3" >
2323 <div class =" container" >
24- <a class =" navbar-brand" asp-area =" " asp-page =" /Index" >WebhookClient </a >
24+ <a class =" navbar-brand" asp-area =" " asp-page =" /Index" >Order Management </a >
2525 <button class =" navbar-toggler" type =" button" data-toggle =" collapse" data-target =" .navbar-collapse" aria-controls =" navbarSupportedContent"
2626 aria-expanded =" false" aria-label =" Toggle navigation" >
2727 <span class =" navbar-toggler-icon" ></span >
5050
5151 <footer class =" border-top footer text-muted" >
5252 <div class =" container" >
53- © ; 2019 - WebhookClient - <a asp-area =" " asp-page =" /RegisterWebhook" >Register Webhook</a > | <a asp-area =" " asp-page =" /WebhooksList" >Webhooks registered in API</a >
53+ © ; 2019 - Order Management - <a asp-area =" " asp-page =" /RegisterWebhook" >Register Webhook</a > | <a asp-area =" " asp-page =" /WebhooksList" >Webhooks registered in API</a >
5454 </div >
5555 </footer >
5656
Original file line number Diff line number Diff line change @@ -54,3 +54,15 @@ body {
5454 height : 60px ;
5555 line-height : 60px ; /* Vertically center the text there */
5656}
57+
58+ .esh-catalog-hero {
59+ background-image : url ("../images/main_banner.png" );
60+ background-size : cover;
61+ height : 260px ;
62+ width : 100% ;
63+ }
64+
65+ .esh-app-footer-brand {
66+ height : 50px ;
67+ width : 230px ;
68+ }
You can’t perform that action at this time.
0 commit comments