Skip to content

Commit

Permalink
Rename to AdminPanel and fix some display issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Kwok He Chu committed Nov 13, 2023
1 parent 288e021 commit 8b28de9
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ await _posCardAcquisitionAbortService.SendAbortRequestAfterSignUpAsync(
serviceId: IdUtility.GetRandomAlphanumericId(10),
poiId: _poiId,
saleId: _saleId,
textTitle: "Welcome back!",
textTitle: "Hi again!",
textDescription: "We've discounted your pizza!",
cancellationToken: cancellationToken);
}
Expand All @@ -371,8 +371,8 @@ await _posCardAcquisitionAbortService.SendAbortRequestAfterSignUpAsync(
serviceId: IdUtility.GetRandomAlphanumericId(10),
poiId: _poiId,
saleId: _saleId,
textTitle: "Welcome back!",
textDescription: $"You need {200 - existingCustomer.LoyaltyPoints} loyalty points to get your next discount!",
textTitle: "Hi again!",
textDescription: $"{200 - existingCustomer.LoyaltyPoints} points until next discount!",
cancellationToken: cancellationToken);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ public IActionResult Error()
return View();
}

[Route("shoppers")]
public IActionResult Shoppers()
[Route("adminpanel")]
public IActionResult AdminPanel()
{
ViewBag.Shoppers = _shopperRepository.Shoppers.Select(kvp => kvp.Value).ToList();
return View();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
using Adyen.Model.Notification;
using Adyen.Util;
using adyen_dotnet_in_person_payments_loyalty_example.Models;
using adyen_dotnet_in_person_payments_loyalty_example.Options;
using adyen_dotnet_in_person_payments_loyalty_example.Repositories;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
namespace adyen_dotnet_in_person_payments_loyalty_example.Models
{
public class CardAcquisitionModel
{
public AdditionalData AdditionalData { get; set; }
public string Message { get; set; }
public string Store { get; set; }
}

/// <summary>
/// See https://docs.adyen.com/point-of-sale/card-acquisition/identifiers/#example for a list of additionalData properties.
/// </summary>
Expand All @@ -11,11 +18,4 @@ public class AdditionalData
public string ShopperReference { get; set; }
public bool GiftcardIndicator { get; set; }
}

public class CardAcquisitionModel
{
public AdditionalData AdditionalData { get; set; }
public string Message { get; set; }
public string Store { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{
public class ApiResponse
{
public string Result { get; set; }
public string RefusalReason { get; set; }
public string Result { get; init; }
public string RefusalReason { get; init; }
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@using adyen_dotnet_in_person_payments_loyalty_example.Models
@{
ViewData["Title"] = "Your loyal shoppers";
ViewData["Title"] = "Admin Panel - Your loyal shoppers";
List<ShopperModel> shoppers = ViewBag.Shoppers;
}

Expand Down
7 changes: 3 additions & 4 deletions in-person-payments-loyalty-example/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
@{
ViewData["Title"] = "Adyen In-person Payment Demo";
ViewData["Title"] = "Adyen In-person Payment Loyalty Demo";
}
<div class="container">
<main role="main" class="pb-3">

<div class="main-container" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<div class="main-container">
<div class="info">
<h1>
Adyen In-person Payments — Loyalty Demo
Expand All @@ -26,7 +25,7 @@

<p>
To learn more about card acquisitions loyalty, check out our <a href="https://docs.adyen.com/point-of-sale/loyalty/#synchronous-flow">documentation</a>. <br/>
<i>Note:</i> The asynchronous flow is similar and can be found <a href="https://docs.adyen.com/point-of-sale/loyalty/#asynchronous-flow">here</a>. In this flow, you can't apply discounts or other loyalty benefits on the spot before the payment.
<i>Note:</i> The asynchronous flow is similar and can be found <a href="https://docs.adyen.com/point-of-sale/loyalty/#asynchronous-flow">here</a>.
</p>

<ul class="integration-list">
Expand Down
6 changes: 5 additions & 1 deletion in-person-payments-loyalty-example/Views/Home/Result.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,17 @@
{
<img src="~/images/thank-you.svg" class="status-image" alt="" />
}
<p class="status-message">@ViewBag.Msg</p>
@if (ViewBag.Status == "failure")
{
<p class="status-message">@ViewBag.Msg</p>
<p class="status-message-generic">
Learn how to resolve Terminal API errors and handle declined payments in <a href="https://docs.adyen.com/point-of-sale/error-scenarios/">our documentation.</a>
</p>
}
else
{
<p class="status-message-generic">@ViewBag.Msg</p>
}
<a class="button" href="/" to="#/">Return</a>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<div class="container">
<main role="main" class="pb-3">

<div class="status-container">
<div class="status">
<h2>Transaction Status</h2>
Expand Down Expand Up @@ -38,7 +37,7 @@
@errorMessage
</p>
}
<a class="button" href="/shoppers" to="#/">Return</a>
<a class="button" href="/AdminPanel" to="#/">Return</a>
</div>
</div>
</main>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<!-- start Navigation Menu -->
<nav class="navMenu">
<a asp-area="" asp-controller="Home" asp-action="Index">Home</a>
<a asp-area="" asp-controller="Home" asp-action="Shoppers">Admin Panel</a>
<a asp-area="" asp-controller="Home" asp-action="AdminPanel">Admin Panel</a>
</nav>
<!-- end Navigation Menu -->
</header>
Expand Down
4 changes: 4 additions & 0 deletions in-person-payments-loyalty-example/wwwroot/css/site.css
Original file line number Diff line number Diff line change
Expand Up @@ -723,6 +723,10 @@ a:hover {
border: 2px solid #00bf53;
}

li {
padding: 8px;
}

/* Transaction Status button end */

.highlight {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ function bindButtons() {
{
// Hides loading animation component and allow user to select tables again
hideLoadingComponent();
window.location.href = "/cashregister";
window.location.href = "/cash-register";
}
else
{
Expand Down

0 comments on commit 8b28de9

Please sign in to comment.