Passed
Pull Request — develop (#426)
by nikos
09:28
created

Payment::setAmountAuthorized()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 1
nc 1
nop 1
crap 2
1
<?php
2
/**
3
 * @author @jenschude <[email protected]>
4
 */
5
6
namespace Commercetools\Core\Model\Payment;
7
8
use Commercetools\Core\Model\Common\Resource;
9
use Commercetools\Core\Model\Common\DateTimeDecorator;
10
use Commercetools\Core\Model\Customer\CustomerReference;
11
use Commercetools\Core\Model\Common\Money;
12
use Commercetools\Core\Model\CustomField\CustomFieldObject;
13
use Commercetools\Core\Model\CustomField\CustomFieldObjectCollection;
14
use DateTime;
15
16
/**
17
 * @package Commercetools\Core\Model\Payment
18
 * @link https://docs.commercetools.com/http-api-projects-payments.html#payment
19
 * @method string getId()
20
 * @method Payment setId(string $id = null)
21
 * @method int getVersion()
22
 * @method Payment setVersion(int $version = null)
23
 * @method DateTimeDecorator getCreatedAt()
24
 * @method Payment setCreatedAt(DateTime $createdAt = null)
25
 * @method DateTimeDecorator getLastModifiedAt()
26
 * @method Payment setLastModifiedAt(DateTime $lastModifiedAt = null)
27
 * @method CustomerReference getCustomer()
28
 * @method Payment setCustomer(CustomerReference $customer = null)
29
 * @method string getInterfaceId()
30
 * @method Payment setInterfaceId(string $interfaceId = null)
31
 * @method Money getAmountPlanned()
32
 * @method Payment setAmountPlanned(Money $amountPlanned = null)
33
 * @method PaymentMethodInfo getPaymentMethodInfo()
34
 * @method Payment setPaymentMethodInfo(PaymentMethodInfo $paymentMethodInfo = null)
35
 * @method CustomFieldObject getCustom()
36
 * @method Payment setCustom(CustomFieldObject $custom = null)
37
 * @method PaymentStatus getPaymentStatus()
38
 * @method Payment setPaymentStatus(PaymentStatus $paymentStatus = null)
39
 * @method TransactionCollection getTransactions()
40
 * @method Payment setTransactions(TransactionCollection $transactions = null)
41
 * @method CustomFieldObjectCollection getInterfaceInteractions()
42
 * @method Payment setInterfaceInteractions(CustomFieldObjectCollection $interfaceInteractions = null)
43
 * @method string getKey()
44
 * @method Payment setKey(string $key = null)
45
 * @method string getAnonymousId()
46
 * @method Payment setAnonymousId(string $anonymousId = null)
47
 * @method PaymentReference getReference()
48
 */
49
class Payment extends Resource
50
{
51 26
    public function fieldDefinitions()
52
    {
53
        return [
54 26
            'id' => [static::TYPE => 'string'],
55 26
            'version' => [static::TYPE => 'int'],
56 26
            'key' => [static::TYPE => 'string'],
57
            'createdAt' => [
58 26
                static::TYPE => DateTime::class,
59 26
                static::DECORATOR => DateTimeDecorator::class
60
            ],
61
            'lastModifiedAt' => [
62 26
                static::TYPE => DateTime::class,
63 26
                static::DECORATOR => DateTimeDecorator::class
64
            ],
65 26
            'customer' => [static::TYPE => CustomerReference::class],
66 26
            'anonymousId' => [static::TYPE => 'string'],
67 26
            'externalId' => [static::TYPE => 'string'],
68 26
            'interfaceId' => [static::TYPE => 'string'],
69 26
            'amountPlanned' => [static::TYPE => Money::class],
70 26
            'amountAuthorized' => [static::TYPE => Money::class],
71
            'authorizedUntil' => [
72 26
                static::TYPE => DateTime::class,
73 26
                static::DECORATOR => DateTimeDecorator::class
74
            ],
75 26
            'amountPaid' => [static::TYPE => Money::class],
76 26
            'amountRefunded' => [static::TYPE => Money::class],
77 26
            'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class],
78 26
            'custom' => [static::TYPE => CustomFieldObject::class],
79 26
            'paymentStatus' => [static::TYPE => PaymentStatus::class],
80 26
            'transactions' => [static::TYPE => TransactionCollection::class],
81
            'interfaceInteractions' => [
82 26
                static::TYPE => CustomFieldObjectCollection::class
83
            ],
84
        ];
85
    }
86
87
    /**
88
     * @deprecated
89
     * @return string
90
     */
91 1
    public function getExternalId()
92
    {
93 1
        return parent::getExternalId();
94
    }
95
96
    /**
97
     * @deprecated
98
     * @param string $externalId
99
     * @return static
100
     */
101
    public function setExternalId($externalId = null)
102
    {
103
        return parent::setExternalId($externalId);
104
    }
105
106
    /**
107
     * @deprecated
108
     * @return Money
109
     */
110 1
    public function getAmountAuthorized()
111
    {
112 1
        return parent::getAmountAuthorized();
113
    }
114
115
    /**
116
     * @deprecated
117
     * @param Money $amountAuthorized
118
     * @return static
119
     */
120
    public function setAmountAuthorized(Money $amountAuthorized = null)
121
    {
122
        return parent::setAmountAuthorized($amountAuthorized);
123
    }
124
125
    /**
126
     * @deprecated
127
     * @return Money
128
     */
129 1
    public function getAmountPaid()
130
    {
131 1
        return parent::getAmountPaid();
132
    }
133
134
    /**
135
     * @deprecated
136
     * @param Money $amountPaid
137
     * @return static
138
     */
139
    public function setAmountPaid(Money $amountPaid = null)
140
    {
141
        return parent::setAmountPaid($amountPaid);
142
    }
143
144
    /**
145
     * @deprecated
146
     * @return Money
147
     */
148 1
    public function getAmountRefunded()
149
    {
150 1
        return parent::getAmountRefunded();
151
    }
152
153
    /**
154
     * @deprecated
155
     * @param Money $amountRefunded
156
     * @return static
157
     */
158
    public function setAmountRefunded(Money $amountRefunded = null)
159
    {
160
        return parent::setAmountRefunded($amountRefunded);
161
    }
162
163
    /**
164
     * @deprecated
165
     * @return Money
166
     */
167 1
    public function getAuthorizedUntil()
168
    {
169 1
        return parent::getAuthorizedUntil();
170
    }
171
172
    /**
173
     * @deprecated
174
     * @param Money $amountUntil
175
     * @return static
176
     */
177
    public function setAuthorizedUntil(Money $amountUntil = null)
178
    {
179
        return parent::setAuthorizedUntil($amountUntil);
180
    }
181
}
182