feat(settings): add appointment fee configuration and update payment logic
This commit is contained in:
@@ -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'),
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user