Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Use constants for HTTP response status codes #1560

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/Checkout.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Controllers/WebhookController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down