Skip to content

Commit

Permalink
handle error
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Jul 30, 2024
1 parent 79424d7 commit 79a620c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/StripeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Stripe\Event;
use Stripe\StripeClient;
use Stripe\Webhook;
use Throwable;

class StripeDriver extends Driver
{
Expand Down Expand Up @@ -87,7 +88,11 @@ protected function createSession(Order $order): Session
*/
public function handleCheckout(Request $request, Order $order): Response
{
$session = $this->createSession($order);
try {
$session = $this->createSession($order);
} catch (Throwable $exception) {
return new Response($this->getFailureUrl($order), $order->toArray());
}

$response = parent::handleCheckout($request, $order);

Expand Down

0 comments on commit 79a620c

Please sign in to comment.