feat(payment): add GetUnverifiedAuthoritiesAsync method to IPaymentGatewayService and ZarinPalPaymentService for payment reconciliation
Build and Deploy to Kubernetes / build-and-deploy (push) Failing after 8m7s

- Introduced GetUnverifiedAuthoritiesAsync method to retrieve authorities with unverified payments.
- Implemented ZarinPal-specific logic for fetching unverified authorities from the new endpoint.
- Added background job for Zarinpal payment reconciliation every 30 minutes.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
masoodafar-web
2026-05-21 18:26:49 +03:30
parent aac0d4271d
commit bc52240a41
4 changed files with 481 additions and 0 deletions
+19
View File
@@ -433,6 +433,25 @@ using (var scope = app.Services.CreateScope())
cronExpression: "*/5 * * * *",
options: new RecurringJobOptions { TimeZone = TimeZoneInfo.Local });
app.Logger.LogInformation("✅ Hangfire recurring job 'chatika-account-activation' registered (Cron: */5 * * * * - Every 5 minutes)");
// Zarinpal Payment Reconciliation: Every 30 minutes
// Verifies payments older than 30 min whose return-URL callback was never received
var zarinpalReconciliationEnabled = app.Configuration.GetValue<bool>(
"BackgroundJobs:ZarinpalReconciliation:Enabled", true);
if (zarinpalReconciliationEnabled)
{
recurringJobManager.AddOrUpdate<CMSMicroservice.Infrastructure.BackgroundJobs.ZarinpalReconciliationJob>(
recurringJobId: "zarinpal-reconciliation",
methodCall: job => job.ExecuteAsync(CancellationToken.None),
cronExpression: "*/30 * * * *",
options: new RecurringJobOptions { TimeZone = TimeZoneInfo.Local });
app.Logger.LogInformation("✅ Hangfire recurring job 'zarinpal-reconciliation' registered (Cron: */30 * * * * - Every 30 minutes)");
}
else
{
recurringJobManager.RemoveIfExists("zarinpal-reconciliation");
app.Logger.LogInformation("⚠️ Hangfire recurring job 'zarinpal-reconciliation' is DISABLED in configuration");
}
}
app.Run();