Skip to content

Commit

Permalink
Fix status not being set for ignoreB2BInvoice.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinverschoor committed Aug 25, 2021
1 parent 54f9a57 commit 104ac0d
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions Controller/Checkout/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,8 @@ private function processPaidOrder(Transaction $transaction, Order $order)
$order->setTotalPaid($order->getGrandTotal());
$order->setBaseTotalPaid($order->getBaseGrandTotal());

$newStatus = ($transaction->isAuthorized()) ? $this->config->getAuthorizedStatus($paymentMethod) : $this->config->getPaidStatus($paymentMethod);
$order->setStatus(!empty($newStatus) ? $newStatus : Order::STATE_PROCESSING);
$order->addStatusHistoryComment(__('B2B Setting: Skipped creating invoice'));
$this->orderRepository->save($order);
return $this->result->setContents("TRUE| " . $message . " (B2B: No invoice created)");
Expand All @@ -356,13 +358,8 @@ private function processPaidOrder(Transaction $transaction, Order $order)
$payment->registerCaptureNotification($paidAmount, $this->config->isSkipFraudDetection());
}

if ($transaction->isAuthorized()) {
$statusAuthorized = $this->config->getAuthorizedStatus($paymentMethod);
$order->setStatus(!empty($statusAuthorized) ? $statusAuthorized : Order::STATE_PROCESSING);
} else {
$statusPaid = $this->config->getPaidStatus($paymentMethod);
$order->setStatus(!empty($statusPaid) ? $statusPaid : Order::STATE_PROCESSING);
}
$newStatus = ($transaction->isAuthorized()) ? $this->config->getAuthorizedStatus($paymentMethod) : $this->config->getPaidStatus($paymentMethod);
$order->setStatus(!empty($newStatus) ? $newStatus : Order::STATE_PROCESSING);

$this->orderRepository->save($order);

Expand Down

0 comments on commit 104ac0d

Please sign in to comment.