Passed
Pull Request — master (#28)
by Manuel
02:43
created

AliasInsertDirectRequest   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 77
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 21
dl 0
loc 77
rs 10
c 0
b 0
f 0
wmc 8

8 Methods

Rating   Name   Duplication   Size   Complexity  
A getPaymentMeans() 0 3 1
A setCheck() 0 5 1
A __construct() 0 6 1
A execute() 0 6 1
A getRegisterAlias() 0 3 1
A setPaymentMeans() 0 5 1
A setRegisterAlias() 0 5 1
A getCheck() 0 3 1
1
<?php declare(strict_types=1);
2
3
namespace Ticketpark\SaferpayJson\Request\SecureCardData;
4
5
use JMS\Serializer\Annotation\SerializedName;
6
use JMS\Serializer\Annotation\Type;
7
use Ticketpark\SaferpayJson\Request\Container\Check;
8
use Ticketpark\SaferpayJson\Request\Container\PaymentMeans;
9
use Ticketpark\SaferpayJson\Request\Container\RegisterAlias;
10
use Ticketpark\SaferpayJson\Request\Request;
11
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait;
12
use Ticketpark\SaferpayJson\Request\RequestConfig;
13
use Ticketpark\SaferpayJson\Response\SecureCardData\AliasInsertDirectResponse;
14
15
final class AliasInsertDirectRequest extends Request
16
{
17
    const API_PATH = '/Payment/v1/Alias/InsertDirect';
18
    const RESPONSE_CLASS = AliasInsertDirectResponse::class;
19
20
    use RequestCommonsTrait;
21
22
    /**
23
     * @var RegisterAlias
24
     * @SerializedName("RegisterAlias")
25
     */
26
    private $registerAlias;
27
28
    /**
29
     * @var PaymentMeans
30
     * @SerializedName("PaymentMeans")
31
     * @Type("Ticketpark\SaferpayJson\Request\Container\PaymentMeans")
32
     */
33
    private $paymentMeans;
34
35
    /**
36
     * @var Check|null
37
     * @SerializedName("Check")
38
     * @Type("Ticketpark\SaferpayJson\Request\Container\Check")
39
     */
40
    private $check;
41
42
    public function __construct(RequestConfig $requestConfig, RegisterAlias $registerAlias, PaymentMeans $paymentMeans)
43
    {
44
        $this->registerAlias = $registerAlias;
45
        $this->paymentMeans = $paymentMeans;
46
47
        parent::__construct($requestConfig);
48
    }
49
50
    public function getRegisterAlias(): RegisterAlias
51
    {
52
        return $this->registerAlias;
53
    }
54
55
    public function setRegisterAlias(RegisterAlias $registerAlias): self
56
    {
57
        $this->registerAlias = $registerAlias;
58
59
        return $this;
60
    }
61
62
    public function getPaymentMeans(): PaymentMeans
63
    {
64
        return $this->paymentMeans;
65
    }
66
67
    public function setPaymentMeans(PaymentMeans $paymentMeans): self
68
    {
69
        $this->paymentMeans = $paymentMeans;
70
71
        return $this;
72
    }
73
74
    public function getCheck(): ?Check
75
    {
76
        return $this->check;
77
    }
78
79
    public function setCheck(?Check $check): self
80
    {
81
        $this->check = $check;
82
83
        return $this;
84
    }
85
86
    public function execute(): AliasInsertDirectResponse
87
    {
88
        /** @var AliasInsertDirectResponse $response */
89
        $response = $this->doExecute();
90
91
        return $response;
92
    }
93
}
94