setPaymentDetailsArray()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 8
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 4
c 0
b 0
f 0
dl 0
loc 8
rs 10
cc 2
nc 2
nop 1
1
<?php
2
3
/**
4
 * PHP version 5.4 and 8
5
 *
6
 * @category  MessageEntity
7
 * @package   Payever\Payments
8
 * @author    payever GmbH <[email protected]>
9
 * @copyright 2017-2021 payever GmbH
10
 * @license   MIT <https://opensource.org/licenses/MIT>
11
 * @link      https://docs.payever.org/shopsystems/api/getting-started
12
 */
13
14
namespace Payever\ExternalIntegration\Payments\Http\MessageEntity;
15
16
use Payever\ExternalIntegration\Core\Http\MessageEntity\ChannelSetEntity;
17
use Payever\ExternalIntegration\Core\Http\MessageEntity\ResultEntity;
18
19
/**
20
 * This class represents Retrieve Payment Result Entity
21
 *
22
 * @method string               getId()
23
 * @method string               getStatus()
24
 * @method string               getColorState()
25
 * @method string               getMerchantName()
26
 * @method string               getCustomerName()
27
 * @method string               getCustomerEmail()
28
 * @method string               getPaymentType()
29
 * @method string               getLastAction()
30
 * @method \DateTime|false      getCreatedAt()
31
 * @method \DateTime|false      getUpdatedAt()
32
 * @method string               getChannel()
33
 * @method string               getReference()
34
 * @method float                getAmount()
35
 * @method string               getCurrency()
36
 * @method float                getPaymentFee()
37
 * @method float                getTotal()
38
 * @method AddressEntity        getAddress()
39
 * @method PaymentDetailsEntity getPaymentDetails()
40
 * @method array                getPaymentDetailsArray()
41
 * @method ChannelSetEntity     getChannelSet()
42
 * @method float                getDownPayment()
43
 * @method self                 setId(string $id)
44
 * @method self                 setStatus(string $status)
45
 * @method self                 setColorState(string $colorState)
46
 * @method self                 setMerchantName(string $merchantName)
47
 * @method self                 setCustomerName(string $customerName)
48
 * @method self                 setCustomerEmail(string $customerEmail)
49
 * @method self                 setPaymentType(string $paymentType)
50
 * @method self                 setLastAction(string $lastAction)
51
 * @method self                 setChannel(string $channel)
52
 * @method self                 setReference(string $reference)
53
 * @method self                 setAmount(float $amount)
54
 * @method self                 setDownPayment(float $downPayment)
55
 * @method self                 setCurrency(string $currency)
56
 * @method self                 setFee(float $fee)
57
 * @method self                 setPaymentFee(float $paymentFee)
58
 * @method self                 setTotal(float $total)
59
 *
60
 * @SuppressWarnings(PHPMD.ShortVariable)
61
 * @SuppressWarnings(PHPMD.TooManyFields)
62
 */
63
class RetrievePaymentResultEntity extends ResultEntity
64
{
65
    /** @var string $id */
66
    protected $id;
67
68
    /** @var string $status */
69
    protected $status;
70
71
    /** @var string $colorState */
72
    protected $colorState;
73
74
    /** @var string $merchantName */
75
    protected $merchantName;
76
77
    /** @var string $customerName */
78
    protected $customerName;
79
80
    /** @var string $customerName */
81
    protected $customerEmail;
82
83
    /** @var string $paymentType */
84
    protected $paymentType;
85
86
    /** @var string $lastAction */
87
    protected $lastAction;
88
89
    /** @var \DateTime|bool $createdAt */
90
    protected $createdAt;
91
92
    /** @var \DateTime|bool $updatedAt */
93
    protected $updatedAt;
94
95
    /** @var string $channel */
96
    protected $channel;
97
98
    /** @var string $reference */
99
    protected $reference;
100
101
    /** @var float $amount */
102
    protected $amount;
103
104
    /** @var float $downPayment */
105
    protected $downPayment;
106
107
    /** @var string $currency */
108
    protected $currency;
109
110
    /** @var float $fee */
111
    protected $fee;
112
113
    /** @var float $paymentFee */
114
    protected $paymentFee;
115
116
    /** @var float $total */
117
    protected $total;
118
119
    /** @var AddressEntity $address */
120
    protected $address;
121
122
    /** @var PaymentDetailsEntity $paymentDetails */
123
    protected $paymentDetails;
124
125
    /** @var array $paymentDetailsArray */
126
    protected $paymentDetailsArray;
127
128
    /** @var ChannelSetEntity */
129
    protected $channelSet;
130
131
    /**
132
     * Sets Created At
133
     *
134
     * @param string $createdAt
135
     * @return self
136
     */
137
    public function setCreatedAt($createdAt)
138
    {
139
        if ($createdAt) {
140
            $this->createdAt = date_create($createdAt);
141
        }
142
143
        return $this;
144
    }
145
146
    /**
147
     * Sets Updated At
148
     *
149
     * @param string $updatedAt
150
     * @return self
151
     */
152
    public function setUpdatedAt($updatedAt)
153
    {
154
        if ($updatedAt) {
155
            $this->updatedAt = date_create($updatedAt);
156
        }
157
158
        return $this;
159
    }
160
161
    /**
162
     * Sets Address
163
     *
164
     * @param array $address
165
     * @return self
166
     */
167
    public function setAddress($address)
168
    {
169
        $this->address = new AddressEntity($address);
170
171
        return $this;
172
    }
173
174
    /**
175
     * Sets Channel Set
176
     *
177
     * @param array $channelSet
178
     * @return self
179
     */
180
    public function setChannelSet($channelSet)
181
    {
182
        $this->channelSet = new ChannelSetEntity($channelSet);
183
184
        return $this;
185
    }
186
187
    /**
188
     * Sets Payment Details
189
     *
190
     * @param array $paymentDetails
191
     * @return self
192
     */
193
    public function setPaymentDetails($paymentDetails)
194
    {
195
        $this->paymentDetails = new PaymentDetailsEntity($paymentDetails);
196
197
        return $this;
198
    }
199
200
    /**
201
     * @param \stdClass|array $details
202
     * @return self
203
     */
204
    public function setPaymentDetailsArray($details)
205
    {
206
        if ($details instanceof \stdClass) {
207
            $details = (array) $details;
208
        }
209
        $this->paymentDetailsArray = $details;
210
211
        return $this;
212
    }
213
214
    /**
215
     * Gets payment fee value
216
     *
217
     * @return float
218
     */
219
    public function getFee()
220
    {
221
        return $this->getPaymentFee();
222
    }
223
}
224