Skip to content

Commit

Permalink
Merge pull request #19 from ndeet/fix-redirect
Browse files Browse the repository at this point in the history
Fix error on redirect if invoice already settled.
  • Loading branch information
woutersamaey authored Jul 5, 2023
2 parents 86b24c0 + f83576a commit 1564f30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Controller/Redirect/ReturnAfterPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,15 @@ public function execute()
$invoice = $this->btcPayService->getInvoice($btcPayInvoiceId, $btcPayStoreId, $magentoStoreId);
$isInvoiceExpired = $invoice->isExpired();
$isInvoiceProcessing = $invoice->isProcessing();
$isInvoiceSettled = $invoice->isSettled();
}
} else {
// Order cannot be found
$order = null;
}

if ($order && $valid) {
if ($isInvoiceProcessing) {
if ($isInvoiceProcessing || $isInvoiceSettled) {
$this->checkoutSession->setLastQuoteId($order->getQuoteId());
$this->checkoutSession->setLastSuccessQuoteId($order->getQuoteId());
$this->checkoutSession->setLastOrderId($order->getId());
Expand Down

0 comments on commit 1564f30

Please sign in to comment.