Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgergo committed Feb 1, 2024
1 parent 11c6980 commit e845584
Showing 1 changed file with 5 additions and 13 deletions.
18 changes: 5 additions & 13 deletions src/StripeDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,11 @@ public function handleCheckout(Request $request, Order $order): Response
*/
public function resolveOrderForCapture(Request $request): Order
{
return Order::query()->where('uuid', $this->session->client_reference_id)->firstOrFail();
$this->session = $this->client->checkout->sessions->retrieve(
$request->input('session_id')
);

return Order::proxy()->newQuery()->where('uuid', $this->session->client_reference_id)->firstOrFail();
}

/**
Expand All @@ -132,18 +136,6 @@ public function capture(Request $request, Order $order): Order
return $order;
}

/**
* {@inheritdoc}
*/
public function handleCapture(Request $request, Order $order): Response
{
$this->session = $this->client->checkout->sessions->retrieve(
$request->input('session_id')
);

return parent::handleCapture($request, $order);
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit e845584

Please sign in to comment.