# give/4.18.0/src/Framework/PaymentGateways/Traits/HasRequest.php

GiveWP – Donation Plugin and Fundraising Platform, version 4.18.0. 34 lines.

- Page: https://pluginprobe.com/plugins/give/4.18.0/code/src/Framework/PaymentGateways/Traits/HasRequest.php
- Raw: https://pluginprobe.com/plugins/give/4.18.0/raw/src/Framework/PaymentGateways/Traits/HasRequest.php
- Modified: 2023-10-16T17:55:46+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/give/4.18.0/code/src/Framework/PaymentGateways/Traits/HasRequest.php#L10-L20`.

```php
<?php

namespace Give\Framework\PaymentGateways\Traits;

trait HasRequest {
    /**
     * @var array
     */
    private $request;

    /**
     * @since 3.0.0
     * @return mixed
     */
    public function get(string $key)
    {
        return $this->request[$key];
    }

    /**
     *
     * @since 3.0.0
     * @return $this
     */
    public function request(): self
    {
        $request = file_get_contents('php://input');

        $this->request = json_decode($request, true);

        return $this;
    }
}

```
