diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml new file mode 100644 index 00000000..94c08676 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml @@ -0,0 +1,59 @@ +@page "{orderNo:int}" +@using System.Globalization +@model EShopOnAbp.PublicWeb.Pages.OrderReceivedModel +@{ + decimal orderTotal = 0; + Model.ReceivedOrder.Items.ForEach(q => orderTotal += q.Units * q.UnitPrice); + string orderTotalString = orderTotal.ToString("C", new CultureInfo("en-US")); // We work with USD any ways + string orderNoString = Model.ReceivedOrder.OrderNo.ToString("N0", new NumberFormatInfo() {NumberGroupSeparator = " "}); +} + +@section styles{ + +} + +@{ + var paymentIcon = Model.ReceivedOrder.PaymentType == "paypal" ? "fa-cc-paypal" : "fa-credit-card"; +} + + + + + + + + +
+

Sipariş alındı!

+

Siparişiniz ile ilgili detaylar @Model.ReceivedOrder.Buyer.Email adresine gönderildi. Siparişlerime git

+
+
+ +
+ + +
Sipariş Numarası
+
+ @orderNoString +
+
+ +
Teslimat Adresi
+
+ @Model.ReceivedOrder.Address.Description +
+
@Model.ReceivedOrder.Address.Street - @Model.ReceivedOrder.Address.ZipCode
+
@Model.ReceivedOrder.Address.City / @Model.ReceivedOrder.Address.Country
+
+ +
Ödenen Tutar
+
@orderTotalString
+
+ +
+
+
+ +
+
+
\ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml.cs new file mode 100644 index 00000000..2e64bbb6 --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/OrderReceived.cshtml.cs @@ -0,0 +1,23 @@ +using System.Threading.Tasks; +using EShopOnAbp.OrderingService.Orders; +using Microsoft.AspNetCore.Mvc; +using Volo.Abp.AspNetCore.Mvc.UI.RazorPages; + +namespace EShopOnAbp.PublicWeb.Pages; + +public class OrderReceivedModel : AbpPageModel +{ + private readonly IOrderAppService _orderAppService; + [BindProperty(SupportsGet = true)] public int OrderNo { get; set; } + public OrderDto ReceivedOrder { get; set; } + + public OrderReceivedModel(IOrderAppService orderAppService) + { + _orderAppService = orderAppService; + } + + public async Task OnGet(int orderNo) + { + ReceivedOrder = await _orderAppService.GetByOrderNoAsync(orderNo); + } +} \ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs index 797aac15..54aeeb96 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/Payment.cshtml.cs @@ -58,6 +58,7 @@ public class PaymentModel : AbpPageModel var paymentRequest = await _paymentRequestAppService.CreateAsync(new PaymentRequestCreationDto { OrderId = placedOrder.Id.ToString(), + OrderNo = placedOrder.OrderNo, BuyerId = CurrentUser.GetId().ToString(), Currency = EShopOnAbpPaymentConsts.Currency, Products = ObjectMapper.Map, List>(basket.Items) @@ -80,7 +81,7 @@ public class PaymentModel : AbpPageModel { City = address.City, Country = address.Country, - Description = address.Description, + Description = address.Type, Street = address.Street, ZipCode = address.ZipCode }; diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml index 05ac76cb..df66d0c7 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml @@ -1,24 +1,16 @@ @page @model EShopOnAbp.PublicWeb.Pages.PaymentCompletedModel -@section styles{ -} -
- - @if (Model.IsSuccessful) - { - - - @* Card image cap *@ - -

Order Recieved!

-

Thank you for your payment. Your purchase is completed.

-

You can check our recommended products below.

- Continue Shopping -
-
-
- } - + + + @* Card image cap *@ + +

Order Failed!

+

It seems there is a problem with your payment

+

Please check your payment method!

+ Continue Shopping +
+
+
\ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml.cs b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml.cs index 6898ee2d..e313939d 100644 --- a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml.cs +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/PaymentCompleted.cshtml.cs @@ -22,10 +22,16 @@ public class PaymentCompletedModel : AbpPageModel public bool IsSuccessful { get; private set; } - public async Task OnGetAsync() + public async Task OnGetAsync() { PaymentRequest = await _paymentRequestAppService.CompleteAsync(Token); IsSuccessful = PaymentRequest.State == PaymentRequestState.Completed; + if (IsSuccessful) + { + return RedirectToPage("OrderReceived", new { orderNo = PaymentRequest.OrderNo }); + } + + return Page(); } } \ No newline at end of file diff --git a/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/orderReceived.css b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/orderReceived.css new file mode 100644 index 00000000..5d5e6ccb --- /dev/null +++ b/apps/public-web/src/EShopOnAbp.PublicWeb/Pages/orderReceived.css @@ -0,0 +1,19 @@ +.ro-title { + text-transform: uppercase; + font-weight: 500; + color: crimson; + padding-bottom: .5em; +} + +.ro-body { + font-weight: bold; +} + +.ro-ono { + font-size: x-large; +} + +.ro-large { + font-size: larger; + padding-bottom: .5rem; +} \ No newline at end of file