feat: Update payment processing and callback mechanisms
Build and Deploy to Kubernetes / build-and-deploy (push) Successful in 8m22s

- Refactor ActivateClubMembershipCommandHandler to use UserPackagePurchases instead of UserOrders for package activation.
- Modify PlaceOrderCommandHandler to redirect payment callbacks to the front office.
- Update ChargeDiscountWalletCommandHandler and ChargeMagicWalletCommandHandler to direct payment callbacks to the front office.
- Remove PaymentCallbackController and integrate payment verification directly into DiscountOrderService and UserWalletService.
- Add CustomerVerifyDiscountOrderPayment RPC to DiscountOrderService for verifying discount order payments.
- Implement VerifyMagicCharge and VerifyDiscountCharge methods in UserWalletService for wallet charge verifications.
- Update appsettings.json to use local URLs for development.
- Remove appsettings.Development.json as it is no longer needed.
- Comment out history tracking methods in ClubMembershipCycle and Package classes.
- Update PackageService to automatically activate club membership after successful payment verification.
- Adjust UserService to generate JWT tokens with user details.
This commit is contained in:
masoodafar-web
2026-02-28 03:27:46 +03:30
parent 01073084ab
commit 1e7c17f090
17 changed files with 363 additions and 334 deletions
@@ -351,6 +351,24 @@ public class PackageService : PackageContract.PackageContractBase
await _context.SaveChangesAsync(context.CancellationToken);
// فعالسازی خودکار باشگاه مشتریان بعد از تأیید پرداخت موفق
if (verifyResult.IsSuccess)
{
try
{
await _sender.Send(new CMSMicroservice.Application.ClubMembershipCQ.Commands.ActivateClubMembership.ActivateClubMembershipCommand
{
UserId = purchase.UserId,
ForceActivation = false
}, context.CancellationToken);
}
catch (Exception ex)
{
// لاگ خطا ولی پرداخت موفق بوده — کاربر می‌تونه دستی فعالسازی کنه
System.Console.WriteLine($"Auto club activation failed for UserId {purchase.UserId}: {ex.Message}");
}
}
return new CustomerVerifyPackagePurchaseResponse
{
Success = verifyResult.IsSuccess,