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