payment_logic = new PaymentLogic(); } /** * 缴费 * @param Request $request * @param string $patient_id * @return JsonResponse * @throws GeneralException */ public function payment(Request $request, string $patient_id): JsonResponse { $validated = $request->validate([ 'prescription_ids' => 'required', ], [ 'prescription_ids.required' => '请选择要缴纳的处方', ]); $response = $this->payment_logic->payment($patient_id, $validated['prescription_ids']); return jsonResponse(Response::HTTP_OK, 'success', $response); } }