From f68a5a232d41a6e3a4c9de665ce47440786cd694 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20M=C3=B6ller?= Date: Wed, 30 Aug 2023 22:24:50 +0200 Subject: [PATCH] Fix: Use constants for HTTP response status codes --- src/Checkout.php | 3 ++- src/Http/Controllers/WebhookController.php | 2 +- src/Invoice.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Checkout.php b/src/Checkout.php index 54c748a4..a9ab8a17 100644 --- a/src/Checkout.php +++ b/src/Checkout.php @@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Redirect; use JsonSerializable; use Stripe\Checkout\Session; +use Symfony\Component\HttpFoundation\Response; class Checkout implements Arrayable, Jsonable, JsonSerializable, Responsable { @@ -102,7 +103,7 @@ public static function create($owner, array $sessionOptions = [], array $custome */ public function redirect() { - return Redirect::to($this->session->url, 303); + return Redirect::to($this->session->url, Response::HTTP_SEE_OTHER); } /** diff --git a/src/Http/Controllers/WebhookController.php b/src/Http/Controllers/WebhookController.php index 5224569b..ffe173ee 100644 --- a/src/Http/Controllers/WebhookController.php +++ b/src/Http/Controllers/WebhookController.php @@ -319,7 +319,7 @@ protected function getUserByStripeId($stripeId) */ protected function successMethod($parameters = []) { - return new Response('Webhook Handled', 200); + return new Response('Webhook Handled', Response::HTTP_OK); } /** diff --git a/src/Invoice.php b/src/Invoice.php index 0364d01e..d1798d9c 100644 --- a/src/Invoice.php +++ b/src/Invoice.php @@ -824,7 +824,7 @@ public function download(array $data = []) */ public function downloadAs($filename, array $data = []) { - return new Response($this->pdf($data), 200, [ + return new Response($this->pdf($data), Response::HTTP_OK, [ 'Content-Description' => 'File Transfer', 'Content-Disposition' => 'attachment; filename="'.$filename.'.pdf"', 'Content-Transfer-Encoding' => 'binary',