CaptureRequest::getMarketplace()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Ticketpark\SaferpayJson\Request\Transaction;
6
7
use JMS\Serializer\Annotation\SerializedName;
8
use Ticketpark\SaferpayJson\Request\Container\Amount;
9
use Ticketpark\SaferpayJson\Request\Container\Billpay;
10
use Ticketpark\SaferpayJson\Request\Container\Marketplace;
11
use Ticketpark\SaferpayJson\Request\Container\MastercardIssuerInstallments;
12
use Ticketpark\SaferpayJson\Request\Container\PendingNotification;
13
use Ticketpark\SaferpayJson\Request\Container\TransactionReference;
14
use Ticketpark\SaferpayJson\Request\Request;
15
use Ticketpark\SaferpayJson\Request\RequestCommonsTrait;
16
use Ticketpark\SaferpayJson\Request\RequestConfig;
17
use Ticketpark\SaferpayJson\Response\Transaction\CaptureResponse;
18
19
final class CaptureRequest extends Request
20
{
21
    use RequestCommonsTrait;
22
    public const API_PATH = '/Payment/v1/Transaction/Capture';
23
    public const RESPONSE_CLASS = CaptureResponse::class;
24
25
    /**
26
     * @var TransactionReference
27
     * @SerializedName("TransactionReference")
28
     */
29
    private $transactionReference;
30
31
    /**
32
     * @var Amount|null
33
     * @SerializedName("Amount")
34
     */
35
    private $amount;
36
37
    /**
38
     * @var Billpay|null
39
     * @SerializedName("Billpay")
40
     */
41
    private $billpay;
42
43
    /**
44
     * @var PendingNotification|null
45
     * @SerializedName("PendingNotification")
46
     */
47
    private $pendingNotification;
48
49
    /**
50
     * @var Marketplace|null
51
     * @SerializedName("Marketplace")
52
     */
53
    private $marketplace;
54
55
    /**
56
     * @var MastercardIssuerInstallments|null
57
     * @SerializedName("MastercardIssuerInstallments")
58
     */
59
    private $mastercardIssuerInstallments;
60
61
    public function __construct(
62
        RequestConfig $requestConfig,
63
        TransactionReference $transactionReference
64
    ) {
65
        $this->transactionReference = $transactionReference;
66
67
        parent::__construct($requestConfig);
68
    }
69
70
    public function getTransactionReference(): TransactionReference
71
    {
72
        return $this->transactionReference;
73
    }
74
75
    public function setTransactionReference(TransactionReference $transactionReference): self
76
    {
77
        $this->transactionReference = $transactionReference;
78
79
        return $this;
80
    }
81
82
    public function getAmount(): ?Amount
83
    {
84
        return $this->amount;
85
    }
86
87
    public function setAmount(?Amount $amount): self
88
    {
89
        $this->amount = $amount;
90
91
        return $this;
92
    }
93
94
    public function getBillpay(): ?Billpay
95
    {
96
        return $this->billpay;
97
    }
98
99
    public function setBillpay(?Billpay $billpay): self
100
    {
101
        $this->billpay = $billpay;
102
103
        return $this;
104
    }
105
106
    public function getPendingNotification(): ?PendingNotification
107
    {
108
        return $this->pendingNotification;
109
    }
110
111
    public function setPendingNotification(?PendingNotification $pendingNotification): self
112
    {
113
        $this->pendingNotification = $pendingNotification;
114
115
        return $this;
116
    }
117
118
    public function getMarketplace(): ?Marketplace
119
    {
120
        return $this->marketplace;
121
    }
122
123
    public function setMarketplace(?Marketplace $marketplace): self
124
    {
125
        $this->marketplace = $marketplace;
126
127
        return $this;
128
    }
129
130
    public function getMastercardIssuerInstallments(): ?MastercardIssuerInstallments
131
    {
132
        return $this->mastercardIssuerInstallments;
133
    }
134
135
    public function setMastercardIssuerInstallments(?MastercardIssuerInstallments $mastercardIssuerInstallments): self
136
    {
137
        $this->mastercardIssuerInstallments = $mastercardIssuerInstallments;
138
139
        return $this;
140
    }
141
142
    public function execute(): CaptureResponse
143
    {
144
        /** @var CaptureResponse $response */
145
        $response = $this->doExecute();
146
147
        return $response;
148
    }
149
}
150