Skip to content

Commit

Permalink
Merge pull request #17 from dystcz/fix/change-order-of-execution-duri…
Browse files Browse the repository at this point in the history
…ng-authorization

Fix: Create transaction before updating order status
  • Loading branch information
repl6669 authored Jan 16, 2025
2 parents d111e44 + a8bab05 commit 8e1662a
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ public function authorize(string $paymentType = 'offline'): PaymentAuthorize

$status = $this->data['authorized'] ?? null;

$this->createCaptureTransaction($paymentType);

$this->order->update([
'status' => $status ?? $this->config['authorized'] ?? 'payment-received',
'meta' => $meta,
'placed_at' => Carbon::now(),
]);

$this->createCaptureTransaction($paymentType);

$authorization = new PaymentAuthorize(
success: true,
orderId: $this->order->id,
Expand Down

0 comments on commit 8e1662a

Please sign in to comment.