/** * @param string $payuplOrderId * @return bool */ public function getOrderIdIfCanRepeat($payuplOrderId = null) { if ($payuplOrderId && $this->transactionResource->checkIfNewestByPayuplOrderId($payuplOrderId)) { return $this->transactionResource->getOrderIdByPayuplOrderId($payuplOrderId); } return false; }
public function testCheckIfNewestByPayuplOrderIdSuccess() { $payuplOrderId = '123'; $resultTableRow = ['newer_id' => null]; $this->internalTestCheckIfNewestByPayuplOrderId($payuplOrderId, $resultTableRow); $this->assertTrue($this->model->checkIfNewestByPayuplOrderId($payuplOrderId)); }
/** * @inheritDoc */ public function processNotification($payuplOrderId, $status, $amount) { /** * @var $result \Magento\Framework\Controller\Result\Raw */ $newest = $this->transactionResource->checkIfNewestByPayuplOrderId($payuplOrderId); $this->orderProcessor->processStatusChange($payuplOrderId, $status, $amount, $newest); $result = $this->rawResultFactory->create(); $result->setHttpResponseCode(200)->setContents('OK'); return $result; }