public function execute() { $resultRedirect = $this->resultRedirectFactory->create(); $payuplOrderId = $this->context->getRequest()->getParam('id'); $orderId = $this->paymentHelper->getOrderIdIfCanRepeat($payuplOrderId); if ($orderId) { $resultRedirect->setPath('orba_payupl/payment/repeat_start'); $this->session->setLastOrderId($orderId); } else { $resultRedirect->setPath('orba_payupl/payment/repeat_error'); $this->messageManager->addError(__('The repeat payment link is invalid.')); } return $resultRedirect; }
/** * @return string|false */ public function getPaymentUrl() { $orderId = $this->session->getLastOrderId(); if ($orderId) { $repeatPaymentUrl = $this->paymentHelper->getRepeatPaymentUrl($orderId); if (!$repeatPaymentUrl) { return $this->paymentHelper->getStartPaymentUrl($orderId); } return $repeatPaymentUrl; } return false; }