Test Failed
Push — develop ( 92836b...51a503 )
by Jens
12:17 queued 12s
created

Payment::getExternalId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

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