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

PaymentDraft::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\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\CustomFieldObjectDraft;
13
use Commercetools\Core\Model\CustomField\CustomFieldObjectDraftCollection;
14
use DateTime;
15
16
/**
17
 * @package Commercetools\Core\Model\Payment
18
 * @link https://docs.commercetools.com/http-api-projects-payments.html#paymentdraft
19
 * @method CustomerReference getCustomer()
20
 * @method PaymentDraft setCustomer(CustomerReference $customer = null)
21
 * @method string getInterfaceId()
22
 * @method PaymentDraft setInterfaceId(string $interfaceId = null)
23
 * @method Money getAmountPlanned()
24
 * @method PaymentDraft setAmountPlanned(Money $amountPlanned = null)
25
 * @method PaymentMethodInfo getPaymentMethodInfo()
26
 * @method PaymentDraft setPaymentMethodInfo(PaymentMethodInfo $paymentMethodInfo = null)
27
 * @method CustomFieldObjectDraft getCustom()
28
 * @method PaymentDraft setCustom(CustomFieldObjectDraft $custom = null)
29
 * @method PaymentStatus getPaymentStatus()
30
 * @method PaymentDraft setPaymentStatus(PaymentStatus $paymentStatus = null)
31
 * @method TransactionCollection getTransactions()
32
 * @method PaymentDraft setTransactions(TransactionCollection $transactions = null)
33
 * @method CustomFieldObjectDraftCollection getInterfaceInteractions()
34
 * @method PaymentDraft setInterfaceInteractions(CustomFieldObjectDraftCollection $interfaceInteractions = null)
35
 * @method string getKey()
36
 * @method PaymentDraft setKey(string $key = null)
37
 * @method string getAnonymousId()
38
 * @method PaymentDraft setAnonymousId(string $anonymousId = null)
39
 */
40
class PaymentDraft extends JsonObject
41
{
42 26
    public function fieldDefinitions()
43
    {
44
        return [
45 26
            'key' => [static::TYPE => 'string'],
46 26
            'customer' => [static::TYPE => CustomerReference::class],
47 26
            'anonymousId' => [static::TYPE => 'string'],
48 26
            'externalId' => [static::TYPE => 'string'],
49 26
            'interfaceId' => [static::TYPE => 'string'],
50 26
            'amountPlanned' => [static::TYPE => Money::class],
51 26
            'amountAuthorized' => [static::TYPE => Money::class],
52
            'authorizedUntil' => [
53 26
                static::TYPE => DateTime::class,
54 26
                static::DECORATOR => DateTimeDecorator::class
55
            ],
56 26
            'amountPaid' => [static::TYPE => Money::class],
57 26
            'amountRefunded' => [static::TYPE => Money::class],
58 26
            'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class],
59 26
            'custom' => [static::TYPE => CustomFieldObjectDraft::class],
60 26
            'paymentStatus' => [static::TYPE => PaymentStatus::class],
61 26
            'transactions' => [static::TYPE => TransactionCollection::class],
62
            'interfaceInteractions' => [
63 26
                static::TYPE => CustomFieldObjectDraftCollection::class
64
            ],
65
        ];
66
    }
67
68
    /**
69
     * @deprecated
70
     * @return string
71
     */
72 1
    public function getExternalId()
73
    {
74 1
        return parent::getExternalId();
0 ignored issues
show
introduced by
The method getExternalId() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

74
        return parent::/** @scrutinizer ignore-call */ getExternalId();
Loading history...
75
    }
76
77
    /**
78
     * @deprecated
79
     * @param string $externalId
80
     * @return static
81
     */
82 25
    public function setExternalId($externalId = null)
83
    {
84 25
        return parent::setExternalId($externalId);
0 ignored issues
show
introduced by
The method setExternalId() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

84
        return parent::/** @scrutinizer ignore-call */ setExternalId($externalId);
Loading history...
85
    }
86
87
    /**
88
     * @deprecated
89
     * @return Money
90
     */
91
    public function getAmountAuthorized()
92
    {
93
        return parent::getAmountAuthorized();
0 ignored issues
show
introduced by
The method getAmountAuthorized() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

93
        return parent::/** @scrutinizer ignore-call */ getAmountAuthorized();
Loading history...
94
    }
95
96
    /**
97
     * @deprecated
98
     * @param Money $amountAuthorized
99
     * @return static
100
     */
101
    public function setAmountAuthorized(Money $amountAuthorized = null)
102
    {
103
        return parent::setAmountAuthorized($amountAuthorized);
0 ignored issues
show
introduced by
The method setAmountAuthorized() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

103
        return parent::/** @scrutinizer ignore-call */ setAmountAuthorized($amountAuthorized);
Loading history...
104
    }
105
106
    /**
107
     * @deprecated
108
     * @return Money
109
     */
110
    public function getAmountPaid()
111
    {
112
        return parent::getAmountPaid();
0 ignored issues
show
introduced by
The method getAmountPaid() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

112
        return parent::/** @scrutinizer ignore-call */ getAmountPaid();
Loading history...
113
    }
114
115
    /**
116
     * @deprecated
117
     * @param Money $amountPaid
118
     * @return static
119
     */
120
    public function setAmountPaid(Money $amountPaid = null)
121
    {
122
        return parent::setAmountPaid($amountPaid);
0 ignored issues
show
introduced by
The method setAmountPaid() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

122
        return parent::/** @scrutinizer ignore-call */ setAmountPaid($amountPaid);
Loading history...
123
    }
124
125
    /**
126
     * @deprecated
127
     * @return Money
128
     */
129
    public function getAmountRefunded()
130
    {
131
        return parent::getAmountRefunded();
0 ignored issues
show
introduced by
The method getAmountRefunded() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

131
        return parent::/** @scrutinizer ignore-call */ getAmountRefunded();
Loading history...
132
    }
133
134
    /**
135
     * @deprecated
136
     * @param Money $amountRefunded
137
     * @return static
138
     */
139
    public function setAmountRefunded(Money $amountRefunded = null)
140
    {
141
        return parent::setAmountRefunded($amountRefunded);
0 ignored issues
show
introduced by
The method setAmountRefunded() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

141
        return parent::/** @scrutinizer ignore-call */ setAmountRefunded($amountRefunded);
Loading history...
142
    }
143
144
    /**
145
     * @deprecated
146
     * @return Money
147
     */
148
    public function getAuthorizedUntil()
149
    {
150
        return parent::getAuthorizedUntil();
0 ignored issues
show
introduced by
The method getAuthorizedUntil() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

150
        return parent::/** @scrutinizer ignore-call */ getAuthorizedUntil();
Loading history...
151
    }
152
153
    /**
154
     * @deprecated
155
     * @param Money $amountUntil
156
     * @return static
157
     */
158
    public function setAuthorizedUntil(Money $amountUntil = null)
159
    {
160
        return parent::setAuthorizedUntil($amountUntil);
0 ignored issues
show
introduced by
The method setAuthorizedUntil() does not exist on Commercetools\Core\Model\Common\JsonObject. Maybe you want to declare this class abstract? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

160
        return parent::/** @scrutinizer ignore-call */ setAuthorizedUntil($amountUntil);
Loading history...
161
    }
162
}
163