Status request

@param StatusRequest $statusRequest
@return StatusResponse
491394
public function status(StatusRequest $statusRequest)
    {
      // Extract SimplePay user from request
      $user = $statusRequest->getUser();
      $transaction = $statusRequest->getTransaction();

      // Create request
      $request = new StdClass();
      $request->User = new StdClass();
      $request->User->Uuid = $user->getUuid()->getValue();
      $request->User->Hash = $user->getHash();

      $request->Transaction = new StdClass();
      $request->Transaction->Uuid = $transaction->getValue();

      // Send request
      $response = $this->getSoapClient()->status($request);

      $uuid = new Uuid($response->Transaction->Uuid);
      $status = $response->Transaction->Status;

      // Create Transaction
      $transaction = new Transaction($uuid, $status);

      $reference = $response->Payment->Reference;
      $amount = $response->Payment->Amount;
      $currency = $response->Payment->Currency;

      // Create Payment
      $payment = new Payment($reference, $amount, $currency);

      if(isset($response->Payment->Description))
        $payment->setDescription($response->Payment->Description);

      $statusResponse = new StatusResponse($transaction, $payment);

      return $statusResponse;
    }
1262952
public function prepareResponse($content, $status = null)
    {
        $response = new Response;

        $response->setContent($content);

        if (isset($status)) {
            $response->setStatusCode($status);
        }

        return $response->send();
    }
1281056
public function setStatusCode(int $statusCode): void {
		if ($this->compiled) {
			throw new ResponseException("Attempt to alter response after compilation.", ResponseException::AFTER_COMPILE_ALTERATION);
		}
		
		if (!in_array($statusCode, array_keys($this->phrases))) {
			throw new ResponseException("Unknown status code: $statusCode.");
		}
		
		$this->statusCode = $statusCode;
	}
1211904
public function status($status = null)
    {
        $this->reloadQueryAdapter();
        $this->activeQuery->status($status);
        return $this;
    }
916547
protected function statusCodes($statusCode, $customDescription = null)
    {
        if ($customDescription) {
            $description = $customDescription;
        }
        if ($customDescription !== null || array_key_exists($statusCode, $this->defaultStatusCodes)) {
            if (!isset($description)) {
                $description = $this->defaultStatusCodes[$statusCode];
            }
            $description = !is_array($description) ? [$description] : $description;
            $this->addStatusCode($statusCode, $description);
        }

        return $this;
    }
261318
public function redirect($location, $statusCode = 302) {
        $this->response->setHeader('Location', $location, true, $statusCode);
        return $this;
    }
312473
public function status($status)
    {
        if (!($status instanceof Status)) {
            $status = new Status($status);
        }

        $this->status = $status;

        return $this;
    }
401161
public function index(Request $request, $status = null)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin', 'editor']);

        $status = $request->get('status');
        $query = $request->get('query');

        $pages = Page::ofStatus($status)
            ->orderBy('updated_at', 'desc')
            ->orderBy('created_at', 'desc')
            ->with('pagetype')
            ->paginate(self::PAGINATION_ITEMS);

        return view('page::pages.index', [
            'pages' => $pages,
            'status' => $status,
            'query' => $query
        ]);
    }
215939
public function setStatus($statusCode, $reasonPhrase = '')
    {
        $this->statusCode = (int) $statusCode;

        if (!$reasonPhrase && isset(self::$statusTexts[$this->statusCode])) {
            $this->reasonPhrase = self::$statusTexts[$this->statusCode];
        } else {
            $this->reasonPhrase = $reasonPhrase;
        }

        return $this;
    }
1198370
protected function processCurlResponse(int $statusCode, $curlHandle)
    {
        foreach ($this->runningRequests as $index => $request) {
            if ($request->getCurl()->getHandle() === $curlHandle) {
                $this->parseResponse($request, $statusCode)
                     ->triggerCallback($request->getOnCompleteCallback(), $request);

                $this->multiCurl->removeCurl($request->getCurl());
                unset($this->runningRequests[$index]);
                break;
            }
        }
        return $this;
    }
4930
public function setStatus($statusLine)
    {
        $parts = explode(' ', $statusLine, 3);
        if (count($parts) < 2 || 0 !== strpos(strtolower($parts[0]), 'http/')) {
            throw new \InvalidArgumentException(
                sprintf('"%s" is not a valid HTTP status line', $statusLine)
            );
        }

        $reasonPhrase = count($parts) > 2 ? $parts[2] : '';
        $this->response = $this->response
            ->withStatus((int) $parts[1], $reasonPhrase)
            ->withProtocolVersion(substr($parts[0], 5));

        return $this;
    }
1349479
public static function statusClassFor(int $statusCode): string
    {
        $class = substr((string) $statusCode, 0, 1);
        return self::$statusClass[$class] ?? self::STATUS_CLASS_UNKNOWN;
    }
831819
public function update(OrderStatus $orderstatus, UpdateOrderStatusRequest $request)
    {
        $this->orderstatus->update($orderstatus, $request->all());

        return redirect()->route('admin.order.orderstatus.index')
            ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('order::orderstatuses.title.orderstatuses')]));
    }
405317
public function respond(Status $status, $content = '')
    {
        $this->header($status);

        if (!empty($content)) {
            $this->send($content);
        }

        return $this;
    }
1188419
protected function validateStatusCode($statusCode) : void
	{
		if (! \is_int($statusCode))
		{
			throw new \InvalidArgumentException('HTTP status-code must be an integer');
		}
		else if (! ($statusCode >= 100 && $statusCode <= 599))
		{
			throw new \InvalidArgumentException(\sprintf('The given status-code "%d" is not valid', $statusCode));
		}
	}
303106
public final function withStatus(
       $code,
       $reasonPhrase = ""): ResponseInterface
   {
       try {
           $response = $this->with("statusCode", $code);
           $response->setStatus((int) $code, $reasonPhrase);
       } catch (InvalidArgumentException $e) {
           throw new InvalidArgumentException(
               "Can't get instance for status: " . $e->getMessage());
       }
       return $response;
   }
479111
public function setStatus(int $statusCode):ResponseBuilder
    {
        if ($statusCode < 400 || $statusCode >= 600) {
            throw new InvalidArgumentException("{$statusCode} is not a valid error HTTP status code.");
        }
        return parent::setStatus($statusCode);
    }