diff --git a/imphnen-dimentorin/src/payments/application/payment_service.rs b/imphnen-dimentorin/src/payments/application/payment_service.rs index 7a14b61..b8171b8 100644 --- a/imphnen-dimentorin/src/payments/application/payment_service.rs +++ b/imphnen-dimentorin/src/payments/application/payment_service.rs @@ -142,9 +142,16 @@ impl PaymentService for PaymentServiceImpl { "Payment is not pending".into(), )); } - self.payment_repo + let paid = self.payment_repo .update_status(id, "paid", Some(payment.external_ref.clone().unwrap_or_default())) - .await + .await?; + // Confirm the linked session so mentor/mentee can proceed with the call. + if let Some(mut session) = self.session_repo.find_by_id(payment.session_id).await? { + session.status = "confirmed".to_string(); + session.updated_at = Utc::now(); + self.session_repo.update(payment.session_id, session).await?; + } + Ok(paid) } async fn get_mentee_payments(