Phase 7b: Embed orderId in callback URL for CustomerPurchasePackage

- CustomerPurchasePackage: append orderId to callback URL before sending to gateway
- Ensures PaymentCallback page receives orderId via query string for verification
This commit is contained in:
masoodafar-web
2026-02-26 02:34:47 +03:30
parent 469d97bb60
commit 161f796cd4
@@ -207,13 +207,17 @@ public class PackageService : PackageContract.PackageContractBase
.Select(u => new { u.Mobile })
.FirstOrDefaultAsync(context.CancellationToken);
// Embed orderId in callback URL so FrontOffice can pass it back for verification
var separator = request.CallbackUrl.Contains('?') ? "&" : "?";
var callbackWithOrder = $"{request.CallbackUrl}{separator}orderId={purchase.Id}";
var paymentResult = await _paymentGateway.InitiatePaymentAsync(new PaymentRequest
{
Amount = package.Price,
UserId = userId,
Mobile = user?.Mobile ?? string.Empty,
Description = $"خرید پکیج {package.Title}",
CallbackUrl = request.CallbackUrl
CallbackUrl = callbackWithOrder
}, context.CancellationToken);
if (!paymentResult.IsSuccess)