Completed
Push — develop ( d04237...676fe2 )
by Jens
20:02
created

PaymentDraft::setAmountPaid()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

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