feat: ChargeDiscountWallet UI - page, route, client method & wallet link
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled

- Add ChargeDiscountWallet.razor page with charge form and preset amounts
- Add ChargeDiscountWallet.razor.cs code-behind with gateway redirect logic
- Add InitiateDiscountChargeAsync client method in WalletService
- Add ChargeDiscountWallet route constant
- Add charge button link on main Wallet page
This commit is contained in:
masoodafar-web
2026-02-22 20:22:52 +03:30
parent a2e1e1fead
commit 28695a88f8
5 changed files with 212 additions and 0 deletions
@@ -23,6 +23,7 @@ public static class RouteConstants
public const string Tree = "/profile/tree";
public const string Wallet = "/profile/wallet";
public const string MagicWallet = "/profile/magic-wallet";
public const string ChargeDiscountWallet = "/profile/charge-discount-wallet";
public const string WithdrawalRequests = "/profile/withdrawal-requests";
}
@@ -243,6 +243,26 @@ public class WalletService
}
}
public async Task<(bool Success, string? GatewayUrl, string? Error)> InitiateDiscountChargeAsync(long amount)
{
try
{
var response = await _client.InitiateDiscountChargeAsync(new InitiateDiscountChargeRequest
{
Amount = amount
});
if (response.IsSuccess)
return (true, response.GatewayUrl, null);
return (false, null, response.ErrorMessage);
}
catch (Grpc.Core.RpcException ex)
{
return (false, null, ex.Status.Detail ?? "خطا در ارتباط با سرور");
}
}
public int GetWalletMode()
{
try