d44e99f4ab
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 22m27s
- Added support for return URL handling in ChargeCreditWallet to improve user experience after payment. - Introduced a "Continue Shopping" button that allows users to navigate back to their previous shopping session after successfully charging their wallet. - Updated the component to manage pending return URLs and ensure they are saved and retrieved correctly. These changes enhance the functionality of the ChargeCreditWallet page, providing a smoother transition for users post-transaction.
127 lines
6.6 KiB
Plaintext
127 lines
6.6 KiB
Plaintext
@attribute [Route(RouteConstants.Profile.ChargeCreditWallet)]
|
|
@attribute [Authorize]
|
|
|
|
<PageTitle>شارژ کیفپول اصلی</PageTitle>
|
|
|
|
<MudContainer MaxWidth="MaxWidth.Medium" Class="py-6">
|
|
<MudStack Spacing="3">
|
|
<PageHeader Title="💳 شارژ کیفپول اصلی" BackHref="@RouteConstants.Profile.Wallet" />
|
|
|
|
@if (_paymentResult != null)
|
|
{
|
|
<MudAlert Severity="@(_paymentResult == "success" ? MudBlazor.Severity.Success : MudBlazor.Severity.Error)"
|
|
Class="rounded-lg" Variant="Variant.Filled">
|
|
@if (_paymentResult == "success")
|
|
{
|
|
<MudStack Spacing="2">
|
|
<span>شارژ کیف پول اصلی با موفقیت انجام شد! ✅</span>
|
|
<MudButton Variant="Variant.Filled"
|
|
Color="Color.Primary"
|
|
Size="Size.Small"
|
|
StartIcon="@Icons.Material.Filled.ShoppingCart"
|
|
OnClick="ContinueShoppingAsync">
|
|
ادامه خرید
|
|
</MudButton>
|
|
</MudStack>
|
|
}
|
|
else if (_paymentResult == "cancelled")
|
|
{
|
|
<span>پرداخت توسط شما لغو شد.</span>
|
|
}
|
|
else
|
|
{
|
|
<span>پرداخت ناموفق بود. لطفاً دوباره تلاش کنید.</span>
|
|
}
|
|
</MudAlert>
|
|
}
|
|
|
|
<MudPaper Elevation="2" Class="pa-5 rounded-lg">
|
|
<MudText Typo="Typo.h6" Class="mb-3">
|
|
<MudIcon Icon="@Icons.Material.Filled.AccountBalanceWallet" Class="ml-1" />
|
|
شارژ موجودی اصلی
|
|
</MudText>
|
|
|
|
<MudAlert Severity="MudBlazor.Severity.Info" Dense="true" Class="mb-3" Icon="@Icons.Material.Filled.Info">
|
|
مبلغ وارد شده (به تومان) از طریق درگاه پرداخت به موجودی اصلی شما اضافه میشود.
|
|
از موجودی اصلی برای خرید از فروشگاه عادی و پرداخت سفارش استفاده میشود.
|
|
</MudAlert>
|
|
|
|
<MudStack Spacing="2">
|
|
<MudNumericField @bind-Value="_chargeAmount"
|
|
Label="مبلغ (تومان)"
|
|
Variant="Variant.Outlined"
|
|
Min="10_000"
|
|
Max="1_000_000_000"
|
|
Format="N0"
|
|
Adornment="Adornment.Start"
|
|
AdornmentIcon="@Icons.Material.Filled.Payments"
|
|
HelperText="حداقل ۱۰,۰۰۰ و حداکثر ۱,۰۰۰,۰۰۰,۰۰۰ تومان" />
|
|
|
|
<MudStack Row="true" Spacing="1" Class="flex-wrap">
|
|
@foreach (var preset in _presetAmounts)
|
|
{
|
|
<MudButton Variant="Variant.Outlined" Size="Size.Small"
|
|
Color="@(_chargeAmount == preset ? Color.Primary : Color.Default)"
|
|
OnClick="() => _chargeAmount = preset"
|
|
Class="rounded-pill">
|
|
@FormatToman(preset)
|
|
</MudButton>
|
|
}
|
|
</MudStack>
|
|
|
|
@if (_chargeAmount > 0)
|
|
{
|
|
<MudPaper Outlined="true" Class="pa-3 rounded-lg" Style="background: #eff6ff;">
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Typo="Typo.body2">مبلغ پرداخت:</MudText>
|
|
<MudText Typo="Typo.body2"><strong>@FormatToman(_chargeAmount)</strong></MudText>
|
|
</MudStack>
|
|
<MudStack Row="true" Justify="Justify.SpaceBetween">
|
|
<MudText Typo="Typo.body2">موجودی دریافتی:</MudText>
|
|
<MudText Typo="Typo.body2" Color="Color.Primary"><strong>@FormatToman(_chargeAmount)</strong></MudText>
|
|
</MudStack>
|
|
</MudPaper>
|
|
}
|
|
|
|
<MudButton Variant="Variant.Filled"
|
|
Color="Color.Primary"
|
|
Size="Size.Large"
|
|
FullWidth="true"
|
|
Disabled="@(_isProcessing || _chargeAmount < 10_000)"
|
|
OnClick="StartCreditCharge"
|
|
StartIcon="@Icons.Material.Filled.Payment"
|
|
Class="rounded-lg mt-2">
|
|
@if (_isProcessing)
|
|
{
|
|
<MudProgressCircular Size="Size.Small" Indeterminate="true" Class="me-2" />
|
|
<span>در حال انتقال به درگاه...</span>
|
|
}
|
|
else
|
|
{
|
|
<span>پرداخت با کارت بانکی</span>
|
|
}
|
|
</MudButton>
|
|
</MudStack>
|
|
</MudPaper>
|
|
|
|
<MudExpansionPanels Elevation="1" Class="rounded-lg">
|
|
<MudExpansionPanel Text="قوانین شارژ کیف پول اصلی" MaxHeight="500" IsInitiallyExpanded="false">
|
|
<MudList T="string" Dense="true">
|
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
|
موجودی اصلی برای خرید از فروشگاه عادی و پرداخت سفارش قابل استفاده است
|
|
</MudListItem>
|
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
|
حداقل مبلغ شارژ: ۱۰,۰۰۰ تومان
|
|
</MudListItem>
|
|
<MudListItem T="string" Icon="@Icons.Material.Filled.CheckCircle" IconColor="Color.Success">
|
|
مبلغ واریزی بدون ضریب به موجودی اضافه میشود (۱:۱)
|
|
</MudListItem>
|
|
<MudListItem T="string" Icon="@Icons.Material.Filled.Info" IconColor="Color.Info">
|
|
پرداخت از طریق درگاه بانکی انجام میشود
|
|
</MudListItem>
|
|
</MudList>
|
|
</MudExpansionPanel>
|
|
</MudExpansionPanels>
|
|
</MudStack>
|
|
</MudContainer>
|