This commit is contained in:
@@ -29,6 +29,7 @@ public partial class Checkout()
|
||||
private decimal ShippingCost = 0;
|
||||
private bool IsSameAddress = true;
|
||||
|
||||
public string? OrderNotes { get; set; }
|
||||
private Dictionary<string, string> CheckoutPayload { get; set; } = [];
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
@@ -38,6 +39,9 @@ public partial class Checkout()
|
||||
|
||||
Navigation.LocationChanged += OnLocationChanged;
|
||||
CartService.OnCartChanged += CartService_OnCartChanged;
|
||||
|
||||
if (CartService.ShoppingCart.Items.Count == 0)
|
||||
await CartService.LoadCartFromStorageAsync();
|
||||
}
|
||||
|
||||
private async void CartService_OnCartChanged() => await InvokeAsync(StateHasChanged);
|
||||
@@ -113,7 +117,7 @@ public partial class Checkout()
|
||||
|
||||
if (paymentGen.IsSuccess) paymentId = paymentGen.Value;
|
||||
|
||||
if(paymentGen.IsFailed)
|
||||
if (paymentGen.IsFailed)
|
||||
{
|
||||
var paymentFetch = await PaymentService.GetOrderPaymentAsync(orderId, CancellationToken);
|
||||
|
||||
@@ -161,7 +165,7 @@ public partial class Checkout()
|
||||
|
||||
await JSRuntime.InvokeVoidAsync("eval", "document.getElementById('payfastForm').submit();");
|
||||
}
|
||||
catch(Exception ex)
|
||||
catch (Exception ex)
|
||||
{
|
||||
ToastService.ShowError($"Failed to perform checkout: {ex.Message}", "Checkout");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user