3 Commits

Author SHA1 Message Date
masoodafar-web 749cfeb8f4 Merge branch 'kub-stage' into production
Build and Deploy to Production / build-and-deploy (push) Failing after 1s
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-23 15:12:58 +03:30
masoodafar-web 6f573c0a29 fix(payment): set TwentyCard package amounts and send rials to gateway
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 2s
Gateway 11,200,000 toman and wallet credit 12,656,000 toman; multiply by 10 when posting to TwentyCard API.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-23 15:12:08 +03:30
masoodafar-web 9b82b45e46 chore(staging): point registry and K8S to 185.252.31.44 after server migration
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 50s
2026-09-22 22:18:43 +03:30
12 changed files with 44 additions and 42 deletions
+6 -6
View File
@@ -6,15 +6,15 @@ on:
- kub-stage
env:
REGISTRY: 194.5.195.53:30080
REGISTRY: 185.252.31.44:30080
IMAGE_NAME: admin/cms
K8S_SERVER: 194.5.195.53
K8S_SERVER: 185.252.31.44
jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: 194.5.195.53:32082/docker-sshpass:latest
image: 185.252.31.44:32082/docker-sshpass:latest
options: --privileged
steps:
- name: Start Docker daemon
@@ -22,7 +22,7 @@ jobs:
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
}
DAEMON
echo "🚀 Starting Docker daemon..."
@@ -52,14 +52,14 @@ jobs:
- name: Login to Docker registries
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
- name: Publish Protobuf packages
run: |
echo "📦 Publishing Protobuf packages..."
docker run --rm --network host -e CI=true -v $(pwd):/src -w /src \
194.5.195.53:32082/dotnet/sdk:9.0 sh -c '
185.252.31.44:32082/dotnet/sdk:9.0 sh -c '
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
echo "📦 $proj"
dotnet restore "$proj" --configfile src/NuGet.config
+6 -6
View File
@@ -6,7 +6,7 @@ on:
- production
env:
REGISTRY: 194.5.195.53:30080
REGISTRY: 185.252.31.44:30080
IMAGE_NAME: admin/cms
K8S_SERVER: 45.149.79.127
@@ -14,7 +14,7 @@ jobs:
build-and-deploy:
runs-on: ubuntu-latest
container:
image: 194.5.195.53:32082/docker-sshpass:latest
image: 185.252.31.44:32082/docker-sshpass:latest
options: --privileged
steps:
- name: Start Docker daemon
@@ -22,7 +22,7 @@ jobs:
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << 'DAEMON'
{
"insecure-registries": ["194.5.195.53:30080", "194.5.195.53:32500", "194.5.195.53:32082"]
"insecure-registries": ["185.252.31.44:30080", "185.252.31.44:32500", "185.252.31.44:32082"]
}
DAEMON
echo "🚀 Starting Docker daemon..."
@@ -50,14 +50,14 @@ jobs:
- name: Login to Docker registries
run: |
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 194.5.195.53:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login 185.252.31.44:32082 -u admin --password-stdin
echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login ${{ env.REGISTRY }} -u admin --password-stdin
- name: Publish Protobuf packages
run: |
echo "📦 Publishing Protobuf packages..."
docker run --rm --network host -v $(pwd):/src -w /src \
194.5.195.53:32082/dotnet/sdk:9.0 sh -c '
185.252.31.44:32082/dotnet/sdk:9.0 sh -c '
for proj in $(find . -name "*Protobuf*.csproj" -type f); do
echo "📦 $proj"
dotnet restore "$proj" --configfile src/NuGet.config
@@ -65,7 +65,7 @@ jobs:
dotnet pack "$proj" -c Release --no-build -o "$(dirname $proj)/nupkg"
for nupkg in $(dirname $proj)/nupkg/*.nupkg; do
[ -f "$nupkg" ] && dotnet nuget push "$nupkg" \
--source "http://194.5.195.53:32081/repository/foursat-nuget-hosted/index.json" \
--source "http://185.252.31.44:32081/repository/foursat-nuget-hosted/index.json" \
--api-key "admin:87zH26nbqT" \
--skip-duplicate --allow-insecure-connections || true
done
+2 -2
View File
@@ -1,4 +1,4 @@
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
FROM 185.252.31.44:32082/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy NuGet config first
@@ -11,7 +11,7 @@ COPY src/ ./
RUN dotnet restore "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" --configfile NuGet.config
RUN dotnet publish "CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj" -c Release -o /app/publish --no-restore
FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS runtime
FROM 185.252.31.44:32082/dotnet/aspnet:9.0 AS runtime
WORKDIR /app
COPY --from=build /app/publish .
ENV ASPNETCORE_URLS=http://+:8080
+4 -4
View File
@@ -33,12 +33,12 @@ stringData:
"DefaultEmail": "info@kbs2.ir",
"Packages": {
"4": {
"GatewayAmountToman": 9700000,
"WalletCreditToman": 13000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
},
"1": {
"GatewayAmountToman": 97000000,
"WalletCreditToman": 130000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
}
}
},
+1 -1
View File
@@ -35,7 +35,7 @@ spec:
spec:
containers:
- name: cms
image: 194.5.195.53:30080/admin/cms:prod
image: 185.252.31.44:30080/admin/cms:prod
imagePullPolicy: Always
ports:
- containerPort: 8080
+5 -5
View File
@@ -34,12 +34,12 @@ stringData:
"DefaultEmail": "info@kbs2.ir",
"Packages": {
"4": {
"GatewayAmountToman": 1000,
"WalletCreditToman": 13000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
},
"1": {
"GatewayAmountToman": 1000,
"WalletCreditToman": 130000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
}
}
},
@@ -53,7 +53,7 @@ stringData:
"JwtAudience": "https://localhost",
"JwtExpiryInDays": 5,
"ConnectionStrings": {
"DefaultConnection": "Data Source=194.5.195.53,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
"DefaultConnection": "Data Source=185.252.31.44,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
"providerName": "System.Data.SqlClient"
},
"Otp": {
+1 -1
View File
@@ -35,7 +35,7 @@ spec:
spec:
containers:
- name: cms
image: 194.5.195.53:30080/admin/cms:latest
image: 185.252.31.44:30080/admin/cms:latest
imagePullPolicy: Always
ports:
- containerPort: 8080
@@ -58,7 +58,9 @@ public class TwentyCardPaymentService : IPaymentGatewayService
{
try
{
var amount = ((long)request.Amount).ToString();
// ۲۰کارت amount را به ریال می‌گیرد (تومان × ۱۰)
var amountRial = ((long)request.Amount) * 10L;
var amount = amountRial.ToString();
var payerName = string.IsNullOrWhiteSpace(request.Name)
? (string.IsNullOrWhiteSpace(request.Mobile) ? "کاربر" : request.Mobile)
: request.Name.Trim();
@@ -85,8 +87,8 @@ public class TwentyCardPaymentService : IPaymentGatewayService
AddFormField(content, "national_id", request.NationalId);
_logger.LogInformation(
"TwentyCard payment request: Amount={Amount} Toman, User={UserId}, Invoice={Invoice}",
amount, request.UserId, invoice);
"TwentyCard payment request: Amount={AmountToman} Toman ({AmountRial} Rial), User={UserId}, Invoice={Invoice}",
(long)request.Amount, amountRial, request.UserId, invoice);
var response = await _httpClient.PostAsync("api/pgw/merchant/request", content, cancellationToken);
var responseBody = await response.Content.ReadAsStringAsync(cancellationToken);
@@ -169,7 +171,7 @@ public class TwentyCardPaymentService : IPaymentGatewayService
["terminal_username"] = _terminalUsername,
["terminal_password"] = _terminalPassword,
["authority"] = refId,
["amount"] = ((long)amountInToman).ToString()
["amount"] = (((long)amountInToman) * 10L).ToString()
});
var response = await _httpClient.PostAsync("api/pgw/merchant/verify", content, cancellationToken);
+2 -2
View File
@@ -1,12 +1,12 @@
#See https://aka.ms/customizecontainer to learn how to customize your debug container and how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM 194.5.195.53:32082/dotnet/aspnet:9.0 AS base
FROM 185.252.31.44:32082/dotnet/aspnet:9.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM 194.5.195.53:32082/dotnet/sdk:9.0 AS build
FROM 185.252.31.44:32082/dotnet/sdk:9.0 AS build
WORKDIR /src
COPY ["CMSMicroservice.WebApi/CMSMicroservice.WebApi.csproj", "CMSMicroservice.WebApi/"]
COPY ["CMSMicroservice.Application/CMSMicroservice.Application.csproj", "CMSMicroservice.Application/"]
@@ -14,12 +14,12 @@
"DefaultEmail": "info@kbs2.ir",
"Packages": {
"4": {
"GatewayAmountToman": 1000,
"WalletCreditToman": 13000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
},
"1": {
"GatewayAmountToman": 1000,
"WalletCreditToman": 130000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
}
}
},
@@ -33,7 +33,7 @@
"JwtAudience": "https://localhost",
"JwtExpiryInDays": 5,
"ConnectionStrings": {
"DefaultConnection": "Data Source=194.5.195.53,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
"DefaultConnection": "Data Source=185.252.31.44,31433; Initial Catalog=Foursat;User ID=sa;Password=87zH26nbqT;Connection Timeout=300000;MultipleActiveResultSets=True;Encrypt=False",
"providerName": "System.Data.SqlClient"
},
"Otp": {
+4 -4
View File
@@ -13,12 +13,12 @@
"DefaultEmail": "info@kbs2.ir",
"Packages": {
"4": {
"GatewayAmountToman": 9700000,
"WalletCreditToman": 13000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
},
"1": {
"GatewayAmountToman": 97000000,
"WalletCreditToman": 130000000
"GatewayAmountToman": 11200000,
"WalletCreditToman": 12656000
}
}
},
+2 -2
View File
@@ -3,8 +3,8 @@
<packageSources>
<clear />
<!-- Nexus (hosts FourSat packages + proxies nuget.org) -->
<add key="Nexus" value="http://194.5.195.53:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
<add key="foursat-hosted" value="http://194.5.195.53:32081/repository/foursat-nuget-hosted/index.json" allowInsecureConnections="true" />
<add key="Nexus" value="http://185.252.31.44:32081/repository/nuget-all/index.json" allowInsecureConnections="true" />
<add key="foursat-hosted" value="http://185.252.31.44:32081/repository/foursat-nuget-hosted/index.json" allowInsecureConnections="true" />
</packageSources>
<packageSourceCredentials>
<Nexus>