feat(payment): implement PaymentManager for handling payment logic and callbacks

- Refactor PaymentController to delegate payment processing to PaymentManager.
- Add findByOrderIdForUpdate method in PaymentRepository for pessimistic locking.
- Create PaymentLog entity and repository for auditing payment actions.
- Implement startGatewayHandoff and processCallback methods in PaymentManager.
- Introduce transaction handling and logging for payment verification.
- Update payment flow to ensure idempotency and prevent race conditions.
- Enhance security by logging sensitive actions without exposing credentials.
- Update database schema with migration for payment_logs table.
- Document changes in payment flow architecture.
This commit is contained in:
hamed
2026-07-02 15:36:08 +03:30
parent ca71c49451
commit c247ac2c80
12 changed files with 761 additions and 378 deletions
+4
View File
@@ -88,6 +88,10 @@ services:
$appBaseUrl: '%env(APP_BASE_URL)%'
$allowedFrontendHosts: '%env(ALLOWED_FRONTEND_HOSTS)%'
App\Payment\Service\PaymentManager:
arguments:
$appBaseUrl: '%env(APP_BASE_URL)%'
App\Sms\Provider\KavehNegarProvider:
arguments:
$apiKey: '%env(default::KAVENEGAR_API_KEY)%'