AssertRequest::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 6
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 0
dl 0
loc 6
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ticketpark\SaferpayJson\Request\PaymentPage;
6
7
use JMS\Serializer\Annotation\SerializedName;
8
use Ticketpark\SaferpayJson\Request\Request;
9
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait;
10
use Ticketpark\SaferpayJson\Request\RequestConfig;
11
use Ticketpark\SaferpayJson\Response\PaymentPage\AssertResponse;
12
13
final class AssertRequest extends Request
14
{
15
    use RequestCommonsTrait;
16
    public const API_PATH = '/Payment/v1/PaymentPage/Assert';
17
    public const RESPONSE_CLASS = AssertResponse::class;
18
19
    /**
20
     * @var string
21
     * @SerializedName("Token")
22
     */
23
    private $token;
24
25
    public function __construct(
26
        RequestConfig $requestConfig,
27
        string $token
28
    ) {
29
        $this->token = $token;
30
31
        parent::__construct($requestConfig);
32
    }
33
34
    public function getToken(): string
35
    {
36
        return $this->token;
37
    }
38
39
    public function setToken(string $token): self
40
    {
41
        $this->token = $token;
42
43
        return $this;
44
    }
45
46
    public function execute(): AssertResponse
47
    {
48
        /** @var AssertResponse $response */
49
        $response = $this->doExecute();
50
51
        return $response;
52
    }
53
}
54