diff --git a/Model/BPRedirect.php b/Model/BPRedirect.php index 7aaec64..647c2cc 100755 --- a/Model/BPRedirect.php +++ b/Model/BPRedirect.php @@ -20,6 +20,7 @@ use Magento\Framework\UrlInterface; use Magento\Sales\Api\Data\OrderInterface; use Magento\Framework\App\ResponseFactory; +use Magento\Framework\View\Result\Page; class BPRedirect { @@ -67,14 +68,14 @@ public function __construct( $this->logger = $logger; } - public function execute() + public function execute(Page $page) { $orderId = $this->checkoutSession->getData('last_order_id'); $order = $this->orderInterface->load($orderId); $incrementId = $order->getIncrementId(); $baseUrl = $this->config->getBaseUrl(); if ($order->getPayment()->getMethodInstance()->getCode() !== Config::BITPAY_PAYMENT_METHOD_NAME) { - return; + return $page; } try { diff --git a/Plugin/Onepage/SuccessPlugin.php b/Plugin/Onepage/SuccessPlugin.php index d7f7880..4824fdf 100755 --- a/Plugin/Onepage/SuccessPlugin.php +++ b/Plugin/Onepage/SuccessPlugin.php @@ -18,6 +18,6 @@ public function afterExecute( \Magento\Checkout\Controller\Onepage\Success $subject, \Magento\Framework\View\Result\Page $page ) { - $this->bpRedirect->execute(); + return $this->bpRedirect->execute($page); } }