Monitor.

@return bool true if successful
@throws PaysafeException
168583
public function monitor()
    {
        $request = new Request(array(
            'method' => Request::GET,
            'uri' => 'customervault/monitor'
        ));

        $response = $this->client->processRequest($request);
        return ($response['status'] == 'READY');
    }
942568
public function getQueueMonitor(): ?Monitor
    {
        if (!$this->hasQueueMonitor()) {
            $this->setQueueMonitor($this->getDefaultQueueMonitor());
        }
        return $this->queueMonitor;
    }
178213
public function isPaid()
    {
        $response = array_get($this->data, 'response');
        if ($response) {
            $trade = array_get($response, 'trade');
            if (array_get($trade, 'trade_status')) {
                if (array_get($trade, 'trade_status') == 'TRADE_SUCCESS') {
                    return true;
                } elseif (array_get($trade, 'trade_status') == 'TRADE_FINISHED') {
                    return true;
                } else {
                    return false;
                }
            } else {
                return false;
            }
        } else {
            return false;
        }
    }
1297084
public function isAlive()
    {
        if ($this->getStatus() == Aoe_Scheduler_Model_Schedule::STATUS_RUNNING) {
            if (time() - strtotime($this->getLastSeen()) < 2 * 60) { // TODO: make this configurable
                return true;
            } elseif ($this->getHost() == gethostname()) {
                if ($this->checkPid()) {
                    $this
                        ->setLastSeen(strftime('%Y-%m-%d %H:%M:%S', time()))
                        ->save();
                    return true;
                } else {
                    $this->markAsDisappeared(sprintf('Process "%s" on host "%s" cannot be found anymore', $this->getPid(), $this->getHost()));
                    return false; // dead
                }
            } else {
                // we don't know because the task is running on a different server
                return null;
            }
        }
        return false;
    }
936802
public function beginTransaction(): bool
    {
        if(!$this->inTransaction())
        {
            $result = $this->instance->beginTransaction();
            if(!$result)
            {
                return $result;
            }
        }
        $this->exec('SAVEPOINT P' . $this->getTransactionLevels());
        $this->__tBeginTransaction();
        return true;
    }
3888
public function paymentSuccessful() {
    if ($this->requestHasSucceeded() && $this->requestMethod->isDirectPayment()) {
      return $this->requestMethod->getTransactionSuccessfulCode() == $this->response['resultPayment'];
    }

    return false;
  }
1174947
protected function verifyPayment()
	{

		$fields = array(
			'MerchantID' => $this->config->get('gateway.zarinpal.merchant-id'),
			'Authority' => $this->refId,
			'Amount' => $this->amount,
		);

		try {
			$soap = new SoapClient($this->serverUrl, ['encoding' => 'UTF-8']);
			$response = $soap->PaymentVerification($fields);

		} catch (\SoapFault $e) {
			$this->transactionFailed();
			$this->newLog('SoapFault', $e->getMessage());
			throw $e;
		}

		if ($response->Status != 100 && $response->Status != 101) {
			$this->transactionFailed();
			$this->newLog($response->Status, ZarinpalException::$errors[$response->Status]);
			throw new ZarinpalException($response->Status);
		}

		$this->trackingCode = $response->RefID;
		$this->transactionSucceed();
		$this->newLog($response->Status, Enum::TRANSACTION_SUCCEED_TEXT);
		return true;
	}
831433
public function checkHas() {
        /* @var $model Record */
        $model = get_called_class();
        $model = $model::get($this->getPk());
        if ($model) {
            $this->isUpdate(true);
            return true;
        }
        return false;
    }
654994
public function isWorking()
    {
        $numPending = count($this->getPending());
        $numRunning = count($this->getRunning());
        return $numPending > 0 || $numRunning > 0;
    }
2017
public function capture()
    {
        $storage = new Storage();
        $config = new Config($storage->getAccount());

        if ($config->getDriver() == 'database') {
            return PayuPayment::find($storage->getPayment());
        }

        return new PayuPayment($storage->getPayment());
    }
731627
public function next()
    {
        $this->position++;
        if (!$this->valid() && $this->nextPage) {
            $request = new \Paysafe\Request($this->nextPage);
            $this->nextPage = null;
            $response = $this->client->processRequest($request);
            $this->parseResponse($response);
        }
    }
476019
public function isOnReturn()
	{
		if ($this->idLastReturn != null) {
			$currentStatusReturn = $this->PayReturn()->find($this->idLastReturn)->status;

			return $currentStatusReturn == 'onReturn';
		}

		return false;
	}
1302351
function check() {
    global $db;
    if (IS_ADMIN_FLAG === true) {
      global $sniffer;
      if ($sniffer->field_exists(TABLE_PAYPAL, 'zen_order_id'))  $db->Execute("ALTER TABLE " . TABLE_PAYPAL . " CHANGE COLUMN zen_order_id order_id int(11) NOT NULL default '0'");
    }
    if (!isset($this->_check)) {
      $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_PAYMENT_PAYPAL_STATUS'");
      $this->_check = $check_query->RecordCount();
    }
    return $this->_check;
  }
1118535
protected function userPayment()
    {
        $status = Input::get('status');
        $transId = Input::get('transId');
        $this->cardNumber = Input::get('cardNumber');
        $message = Input::get('message');
        if (is_numeric($status) && $status > 0) {
            $this->trackingCode = $transId;
            return true;
        }
        $this->transactionFailed();
        $this->newLog(-5, $message);
        throw new PayirReceiveException(-5);
    }
387566
public function isSuccessful()
    {
        $successful = false;

        $errorCode = $this->getErrorCode();
        if ($errorCode === 200 || $errorCode === 0) {
            $successful = true;
        }

        return $successful;
    }
115495
public function check()
    {
        $this->state = self::STATE_UNCHECKED;
        
        // check all conditions
        /* @var $processor \Sokil\FraudDetector\ProcessorInterface */
        foreach($this->processorDeclarationList->getKeys() as $processorName) {
            $processor = $this->getProcessor($processorName);

            if($processor->isPassed()) {
                $processor->afterCheckPassed();
                $this->trigger(self::STATE_PASSED . ':' . $processorName);
                
                // check passed if all processors passes their cheks
                if ($this->state === self::STATE_UNCHECKED) {
                    $this->state = self::STATE_PASSED;
                }
            } else {
                $processor->afterCheckFailed();
                $this->trigger(self::STATE_FAILED . ':' . $processorName);
                // if any processor failed - all check failed
                $this->state = self::STATE_FAILED;
            }
        }

        $this->trigger($this->state);
    }
1229491
public function doneAnything()
    {
        $output = false;
        foreach( $this->status as $transaction => $transactionStatus ) {
            foreach( $transactionStatus as $status ) {
                $output = ( $output || $status === self::SUCCESS );
            }
        }
        return $output;
    }