feat(config): add CallbackBaseUrl to configuration for payment processing
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
Build and Deploy to Kubernetes / build-and-deploy (push) Has been cancelled
- Introduced CallbackBaseUrl in both cms-config.yaml and appsettings.Staging.json to support dynamic callback URLs for payment processing. - Updated PackageService to utilize the new CallbackBaseUrl for enhanced security and flexibility in payment integration.
This commit is contained in:
@@ -227,8 +227,13 @@ public class PackageService : PackageContract.PackageContractBase
|
||||
.FirstOrDefaultAsync(cancellationToken);
|
||||
|
||||
// Callback URL از config — نه از ورودی کاربر (امنیت)
|
||||
var frontOfficeBaseUrl = _configuration["FrontOfficeBaseUrl"] ?? "https://localhost:5268";
|
||||
var callbackUrl = $"{frontOfficeBaseUrl}/profile/payment-callback?orderId={purchase.Id}";
|
||||
// ۲۰کارت: CallbackBaseUrl اختیاری (مثلاً استیج → kbs2.ir چون دامنه استیج در ترمینال ثبت نیست)
|
||||
var frontOfficeBaseUrl = isTwentyCard
|
||||
? (_configuration["TwentyCard:CallbackBaseUrl"]
|
||||
?? _configuration["FrontOfficeBaseUrl"]
|
||||
?? "https://localhost:5268")
|
||||
: (_configuration["FrontOfficeBaseUrl"] ?? "https://localhost:5268");
|
||||
var callbackUrl = $"{frontOfficeBaseUrl.TrimEnd('/')}/profile/payment-callback?orderId={purchase.Id}";
|
||||
|
||||
var paymentGateway = _paymentGatewayResolver.Get(gatewayProvider);
|
||||
var payerName = $"{user?.FirstName} {user?.LastName}".Trim();
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
"TerminalUsername": "ea5y1biehi",
|
||||
"TerminalPassword": "SaLamAT@1404!",
|
||||
"CreditPortalUrl": "https://userpanel.20card.ir/",
|
||||
"CallbackBaseUrl": "https://kbs2.ir",
|
||||
"Packages": {
|
||||
"4": {
|
||||
"GatewayAmountToman": 9700000,
|
||||
|
||||
Reference in New Issue
Block a user