feat(settings): add appointment fee configuration and update payment logic

This commit is contained in:
hamed
2026-06-24 20:25:58 +03:30
parent 93fa0fc2c9
commit 763ad82b69
6 changed files with 27 additions and 4 deletions
+4 -2
View File
@@ -186,7 +186,8 @@ class PaymentController extends BaseController
return $this->error(ErrorCodes::ERR_PAYMENT_001, ErrorCodes::message(ErrorCodes::ERR_PAYMENT_001), 503);
}
$payment = new Payment($user, 150000, $gatewayName, Payment::TYPE_APPOINTMENT, $frontendAddress);
$feeRials = (int) $this->configRepo->get('appointment_fee_rials');
$payment = new Payment($user, $feeRials, $gatewayName, Payment::TYPE_APPOINTMENT, $frontendAddress);
$payment->setAppointment($appointment);
$this->paymentRepo->save($payment);
@@ -519,7 +520,8 @@ class PaymentController extends BaseController
public function config(): JsonResponse
{
return $this->success([
'test_mode' => $this->configRepo->get('payment_test_mode') === '1',
'test_mode' => $this->configRepo->get('payment_test_mode') === '1',
'appointment_fee_rials' => (int) $this->configRepo->get('appointment_fee_rials'),
]);
}