feat(settings): add appointment fee configuration and update payment logic
This commit is contained in:
@@ -23,6 +23,7 @@ class SiteConfigController extends BaseController
|
||||
'tax_enabled',
|
||||
'tax_percent',
|
||||
'sms_panel_fee_rials',
|
||||
'appointment_fee_rials',
|
||||
'site_name',
|
||||
'support_phone',
|
||||
'max_cancel_hours_before',
|
||||
|
||||
@@ -16,7 +16,8 @@ class SiteConfigRepository extends ServiceEntityRepository
|
||||
'upgrade_commission_percent' => '20',
|
||||
'tax_enabled' => '0',
|
||||
'tax_percent' => '10',
|
||||
'sms_panel_fee_rials' => '1500000',
|
||||
'sms_panel_fee_rials' => '150',
|
||||
'appointment_fee_rials' => '15000',
|
||||
'site_name' => 'ClinicPro',
|
||||
'support_phone' => '',
|
||||
'max_cancel_hours_before' => '24',
|
||||
|
||||
@@ -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