Skip to content

Commit

Permalink
Merge pull request #26 from Hypernova-Oy/fix_forced_processing_status
Browse files Browse the repository at this point in the history
Fix online capture forcing processing status order
  • Loading branch information
renatocason authored Sep 12, 2022
2 parents f312d2a + 623c642 commit b2468d6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Model/InvoiceProcess.php
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,14 @@ public function invoice(InvoiceProcessItemInterface $item)
$invoice->setRequestedCaptureCase($item->getCaptureMode());
$invoice->register();

if ($order->getStatus() !== $item->getDestinationStatus()) {
// Capture may overwrite order status, reset it
$order->setStatus($item->getDestinationStatus());
if ($state) {
$order->setState($state);
}
}

$transactionSave = $this->transactionFactory->create()
->addObject($invoice)
->addObject($order);
Expand Down

0 comments on commit b2468d6

Please sign in to comment.