This commit is contained in:
@@ -29,10 +29,13 @@ public partial class PaymentFailed
|
|||||||
User = authState!.User;
|
User = authState!.User;
|
||||||
|
|
||||||
if (User?.Identity?.IsAuthenticated == false) Navigation.NavigateTo("/login");
|
if (User?.Identity?.IsAuthenticated == false) Navigation.NavigateTo("/login");
|
||||||
|
}
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(PaymentReference)) return;
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (!firstRender) return;
|
||||||
|
|
||||||
long orderId = HashService.DecodeLongIdHash(PaymentReference).Value;
|
long orderId = HashService.DecodeLongIdHash(PaymentReference!).Value;
|
||||||
|
|
||||||
var customerEmail = User!.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Email)!.Value!;
|
var customerEmail = User!.Claims.FirstOrDefault(c => c.Type == ClaimTypes.Email)!.Value!;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
using LiteCharms.Features;
|
using LiteCharms.Features;
|
||||||
using LiteCharms.Features.Hasher;
|
using LiteCharms.Features.Hasher;
|
||||||
using LiteCharms.Features.MidrandBooks.Customers;
|
using LiteCharms.Features.MidrandBooks.Customers;
|
||||||
using LiteCharms.Features.MidrandBooks.Orders;
|
|
||||||
using LiteCharms.Features.MidrandBooks.Payments;
|
using LiteCharms.Features.MidrandBooks.Payments;
|
||||||
using LiteCharms.Features.MidrandBooks.Payments.Models;
|
using LiteCharms.Features.MidrandBooks.Payments.Models;
|
||||||
|
|
||||||
@@ -10,7 +9,6 @@ namespace MidrandBookshop.Components.Pages;
|
|||||||
public partial class PaymentSuccess
|
public partial class PaymentSuccess
|
||||||
{
|
{
|
||||||
[Inject] private CartService CartService { get; set; } = default!;
|
[Inject] private CartService CartService { get; set; } = default!;
|
||||||
[Inject] private OrderService OrderService { get; set; } = default!;
|
|
||||||
[Inject] private CustomerService CustomerService { get; set; } = default!;
|
[Inject] private CustomerService CustomerService { get; set; } = default!;
|
||||||
[Inject] private PaymentService PaymentService { get; set; } = default!;
|
[Inject] private PaymentService PaymentService { get; set; } = default!;
|
||||||
[Inject] private HashService HashService { get; set; } = default!;
|
[Inject] private HashService HashService { get; set; } = default!;
|
||||||
@@ -31,6 +29,11 @@ public partial class PaymentSuccess
|
|||||||
User = authState!.User;
|
User = authState!.User;
|
||||||
|
|
||||||
if (User?.Identity?.IsAuthenticated == false) Navigation.NavigateTo("/login");
|
if (User?.Identity?.IsAuthenticated == false) Navigation.NavigateTo("/login");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override async Task OnAfterRenderAsync(bool firstRender)
|
||||||
|
{
|
||||||
|
if (!firstRender) return;
|
||||||
|
|
||||||
long orderId = HashService.DecodeLongIdHash(PaymentReference!).Value;
|
long orderId = HashService.DecodeLongIdHash(PaymentReference!).Value;
|
||||||
string orderHash = HashService.HashEncodeLongId(orderId).Value;
|
string orderHash = HashService.HashEncodeLongId(orderId).Value;
|
||||||
|
|||||||
Reference in New Issue
Block a user