Skip to content

Commit

Permalink
Improve code quality
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiasfabian committed Jun 17, 2024
1 parent c245ec5 commit 1313342
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Gateways.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ function completeStripePayment(OrderPage $virtualOrderPage, array $data): OrderP
$metadata = [
'order_uid' => (string)$virtualOrderPage->uid(),
];
// Capture Payment Intent

if ($paymentIntent->status === 'requires_capture') {
// Capture Payment Intent
$paymentIntent = $paymentIntent->capture([
'metadata' => $metadata,
]);
} else {
// Update Payment Intent
$paymentIntent = $paymentIntent->update($paymentIntentId, [
'metadata' => $metadata,
]);
Expand Down

0 comments on commit 1313342

Please sign in to comment.