/** * @SWG\Post( * path="/payments", * summary="Create a payment", * tags={"payment"}, * @SWG\Parameter( * in="body", * name="body", * @SWG\Schema(ref="#/definitions/Payment") * ), * @SWG\Response( * response=200, * description="New payment", * @SWG\Schema(type="object", @SWG\Items(ref="#/definitions/Payment")) * ), * @SWG\Response( * response="default", * description="an ""unexpected"" error" * ) * ) */ public function store(CreatePaymentAPIRequest $request) { $payment = $this->paymentRepo->save($request->input()); if (Input::get('email_receipt')) { $this->contactMailer->sendPaymentConfirmation($payment); } return $this->itemResponse($payment); }