ListPaymentsResultEntity::setCreatedAt()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
c 1
b 0
f 0
dl 0
loc 7
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\ResultEntity;
17
18
/**
19
 * This class represents List Payments Result Entity
20
 *
21
 * @method string               getId()
22
 * @method string               getStatus()
23
 * @method string               getColorState()
24
 * @method string               getMerchantName()
25
 * @method string               getCustomerName()
26
 * @method string               getPaymentType()
27
 * @method \DateTime|false      getCreatedAt()
28
 * @method \DateTime|false      getUpdatedAt()
29
 * @method string               getChannel()
30
 * @method string               getReference()
31
 * @method float                getAmount()
32
 * @method string               getCurrency()
33
 * @method float                getFee()
34
 * @method float                getTotal()
35
 * @method AddressEntity        getAddress()
36
 * @method PaymentDetailsEntity getPaymentDetails()
37
 * @method self                 setId(string $id)
38
 * @method self                 setStatus(string $status)
39
 * @method self                 setColorState(string $colorState)
40
 * @method self                 setMerchantName(string $merchantName)
41
 * @method self                 setCustomerName(string $customerName)
42
 * @method self                 setPaymentType(string $paymentType)
43
 * @method self                 setChannel(string $channel)
44
 * @method self                 setReference(string $reference)
45
 * @method self                 setAmount(float $amount)
46
 * @method self                 setCurrency(string $currency)
47
 * @method self                 setFee(float $fee)
48
 * @method self                 setTotal(float $total)
49
 *
50
 * @SuppressWarnings(PHPMD.ShortVariable)
51
 * @SuppressWarnings(PHPMD.TooManyFields)
52
 */
53
class ListPaymentsResultEntity extends ResultEntity
54
{
55
    /** @var string $id */
56
    protected $id;
57
58
    /** @var string $status */
59
    protected $status;
60
61
    /** @var string $colorState */
62
    protected $colorState;
63
64
    /** @var string $merchantName */
65
    protected $merchantName;
66
67
    /** @var string $customerName */
68
    protected $customerName;
69
70
    /** @var string $paymentType */
71
    protected $paymentType;
72
73
    /** @var \DateTime|bool $createdAt */
74
    protected $createdAt;
75
76
    /** @var \DateTime|bool $updatedAt */
77
    protected $updatedAt;
78
79
    /** @var string $channel */
80
    protected $channel;
81
82
    /** @var string $reference */
83
    protected $reference;
84
85
    /** @var float $amount */
86
    protected $amount;
87
88
    /** @var string $currency */
89
    protected $currency;
90
91
    /** @var float $fee */
92
    protected $fee;
93
94
    /** @var float $total */
95
    protected $total;
96
97
    /** @var AddressEntity $address */
98
    protected $address;
99
100
    /** @var PaymentDetailsEntity $paymentDetails */
101
    protected $paymentDetails;
102
103
    /**
104
     * Sets Created At
105
     *
106
     * @param string $createdAt
107
     * @return self
108
     */
109
    public function setCreatedAt($createdAt)
110
    {
111
        if ($createdAt) {
112
            $this->createdAt = date_create($createdAt);
113
        }
114
115
        return $this;
116
    }
117
118
    /**
119
     * Sets Updated At
120
     *
121
     * @param string $updatedAt
122
     * @return self
123
     */
124
    public function setUpdatedAt($updatedAt)
125
    {
126
        if ($updatedAt) {
127
            $this->updatedAt = date_create($updatedAt);
128
        }
129
130
        return $this;
131
    }
132
133
    /**
134
     * Sets Address
135
     *
136
     * @param array $address
137
     * @return self
138
     */
139
    public function setAddress($address)
140
    {
141
        $this->address = new AddressEntity($address);
142
143
        return $this;
144
    }
145
146
    /**
147
     * Sets Payment Details
148
     *
149
     * @param array $paymentDetails
150
     * @return self
151
     */
152
    public function setPaymentDetails($paymentDetails)
153
    {
154
        $this->paymentDetails = new PaymentDetailsEntity($paymentDetails);
155
156
        return $this;
157
    }
158
}
159