Paypal specific status checking.

If status comes as OK, lets check real paypal payment state,
and if really ok, so lets set it, otherwise dont change status.

@param string $status order transaction status
769029
protected function _setOrderStatus($status)
    {
        $paymentTypeObject = $this->getPaymentType();
        $paymentType = $paymentTypeObject ? $paymentTypeObject->getFieldData('oxpaymentsid') : null;
        if ($paymentType != 'oxidpaypal' || $status != self::OEPAYPAL_TRANSACTION_STATUS_OK) {
            parent::_setOrderStatus($status);
        }
    }
754736
public function withStatus($status)
    {
        if (is_int($status) && $status >= 100 && $status < 600) {
            $this->status = $status;
        } else {
            $this->status = 500;
        }

        return $this;
    }
1265920
protected function _checkPaymentStatus( $value )
	{
		$temp = (int) $value;

		if( $temp < MShop_Order_Item_Abstract::PAY_UNFINISHED || $temp > MShop_Order_Item_Abstract::PAY_RECEIVED ) {
			throw new MShop_Order_Exception( sprintf( 'Order payment status "%1$s" not within allowed range', $value ) );
		}
	}
159853
public function setStatus($status)
    {
        if (!in_array($status, array(
            self::STATUS_OPEN,
            self::STATUS_RUNNING,
            self::STATUS_CLOSED,
            self::STATUS_ERROR,
        ))) {
            throw new \InvalidArgumentException("Invalid status in ".get_class($this).".");
        }

        $this->status = $status;

        return $this;
    }
1220898
public function setStatus(Result\ResultStatus $status)
    {
        if (Result\ResultStatus::UNPROCESSED !== $status->getValue()) {
            $this->transacted = true;
            $this->dateTransacted = new DateTime();
        }

        if (!$this->transaction->isParent()
            && Result\ResultStatus::ERROR !== $status->getValue()
            && Result\ResultStatus::UNPROCESSED !== $status->getValue())  {
            $this->transaction->getParent()->setStatus($status);
        }

        $this->transaction->setStatus($status);
        $this->status = $status;
    }
1253455
public function setStatus($status)
    {
        if (!in_array($status, $this->statusList)) {
            throw new \InvalidArgumentException(sprintf('Invalid status for %s.', __CLASS__));
        }
        $this->status = $status;

        return $this;
    }
376828
public function updateStatus($status)
    {
        if(empty($this->payload['id'])) {
            return;
        }

        $statusInstance = new Status($this->payload['id']);
        $statusInstance->update($status);
    }
969159
public function setOrderStatus(StatusInterface $orderStatus)
    {
        $this->orderStatusCode = $orderStatus->getCode();
        $this->orderStatusLabel = $orderStatus->getLabel();
    }
940945
protected function getPaymentStatus($status)
    {
        switch ($status) {
            // https://developer.paypal.com/docs/api/payments/v1/
            // sale status
            case 'completed':
                return new Status('paid');
            case 'pending':
                return new Status('pending');
            case 'partially_refunded':
                return new Status('partially_refunded');
            case 'refunded':
                return new Status('refunded');
            case 'denied':
                return new Status('declined');
            // payment general status
            case 'created':
            case 'approved':
                return new Status('pending');
            case 'failed':
                return new Status('failed');
            // IPN status
            case 'Completed':
            case 'Processed':
                return new Status('paid');
            case 'Pending':
            case 'In-Progress':
                return new Status('pending');
            case 'Canceled_Reversal':
                return new Status('canceled');
            case 'Failed':
                return new Status('failed');
            case 'Declined':
                return new Status('declined');
            case 'Expired':
                return new Status('expired');
            case 'Refunded':
                return new Status('refunded');
            case 'Partially_Refunded':
                return new Status('partially_refunded');
            case 'Reversed':
                return new Status('charged_back');
            case 'Voided':
                return new Status('voided');

            default:
                return new Status('failed');
        }
    }
527688
protected function hasPaymentWithStatus($status)
    {
        $hasStatus = false;
        $payments = $this->getArray();

        foreach ($payments as $payment) {
            if ($status == $payment->getStatus()) {
                $hasStatus = true;
                break;
            }
        }

        return $hasStatus;
    }
209381
public static function switchStatus(string $status)
    {
        if ($status == "off") {
            self::$status = "off";
        } elseif ($status == "on") {
            self::$status = "on";
        } else {
            die("TaskBar : Undefined status '$status'. Status must be 'on' or 'off'. ");
        }
        return (1);
    }
1059945
public function setStatus($status)
    {
        if (!$status instanceof Status) {
            $status = new Status($status);
        }
        $this->status = $status;
    }
546634
public function setStatus($status) {
        if (!in_array($status, array(self::STATUS_INACTIVE, self::STATUS_PUBLISHED))) {
            throw new \InvalidArgumentException("Invalid status");
        }
        $this->status = $status;
    }
1060178
public function setStatus($status)
    {
        if (!in_array($status, [self::STATUS_DRAFT, self::STATUS_PUBLISHED, self::STATUS_REVIEW, self::STATUS_OFFLINE])) {
            throw new \InvalidArgumentException('Invalid status');
        }
        $this->status = $status;

        return $this;
    }
664165
public function setStatus($status) {

        if ( !in_array($status, range(0, 3)) ) throw new InvalidArgumentException("Invalid status $status");

        $this->status = $status;

        return $this;

    }
1275328
public function setStatus($status)
    {
        if ($status) {
            $map = $this->mapStorage->getCurrentMap();
            $this->onStartMapStart(0, 0, 0, $map);
        }
    }
819465
public static function checkStatusFound(string $headers, string $status): bool
    {
        return (bool)preg_match('/HTTP\/[0-9\.]+ ' . $status . ' OK/i', $headers);
    }