Passed
Branch php-scrutinizer (0ac9d8)
by Jens
09:19
created

PaymentDraft::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 21
Code Lines 18

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 21
ccs 16
cts 16
cp 1
rs 9.3142
c 0
b 0
f 0
cc 1
eloc 18
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\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
 */
38
class PaymentDraft extends JsonObject
39
{
40 25
    public function fieldDefinitions()
41
    {
42
        return [
43 25
            'key' => [static::TYPE => 'string'],
44 25
            'customer' => [static::TYPE => CustomerReference::class],
45 25
            'externalId' => [static::TYPE => 'string'],
46 25
            'interfaceId' => [static::TYPE => 'string'],
47 25
            'amountPlanned' => [static::TYPE => Money::class],
48 25
            'amountAuthorized' => [static::TYPE => Money::class],
49
            'authorizedUntil' => [
50 25
                static::TYPE => DateTime::class,
51 25
                static::DECORATOR => DateTimeDecorator::class
52
            ],
53 25
            'amountPaid' => [static::TYPE => Money::class],
54 25
            'amountRefunded' => [static::TYPE => Money::class],
55 25
            'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class],
56 25
            'custom' => [static::TYPE => CustomFieldObjectDraft::class],
57 25
            'paymentStatus' => [static::TYPE => PaymentStatus::class],
58 25
            'transactions' => [static::TYPE => TransactionCollection::class],
59
            'interfaceInteractions' => [
60 25
                static::TYPE => CustomFieldObjectDraftCollection::class
61
            ],
62
        ];
63
    }
64
65
    /**
66
     * @deprecated
67
     * @return string
68
     */
69 1
    public function getExternalId()
70
    {
71 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

71
        return parent::/** @scrutinizer ignore-call */ getExternalId();
Loading history...
72
    }
73
74
    /**
75
     * @deprecated
76
     * @param string $externalId
77
     * @return static
78
     */
79 24
    public function setExternalId($externalId = null)
80
    {
81 24
        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

81
        return parent::/** @scrutinizer ignore-call */ setExternalId($externalId);
Loading history...
82
    }
83
84
    /**
85
     * @deprecated
86
     * @return Money
87
     */
88
    public function getAmountAuthorized()
89
    {
90
        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

90
        return parent::/** @scrutinizer ignore-call */ getAmountAuthorized();
Loading history...
91
    }
92
93
    /**
94
     * @deprecated
95
     * @param Money $amountAuthorized
96
     * @return static
97
     */
98
    public function setAmountAuthorized(Money $amountAuthorized = null)
99
    {
100
        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

100
        return parent::/** @scrutinizer ignore-call */ setAmountAuthorized($amountAuthorized);
Loading history...
101
    }
102
103
    /**
104
     * @deprecated
105
     * @return Money
106
     */
107
    public function getAmountPaid()
108
    {
109
        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

109
        return parent::/** @scrutinizer ignore-call */ getAmountPaid();
Loading history...
110
    }
111
112
    /**
113
     * @deprecated
114
     * @param Money $amountPaid
115
     * @return static
116
     */
117
    public function setAmountPaid(Money $amountPaid = null)
118
    {
119
        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

119
        return parent::/** @scrutinizer ignore-call */ setAmountPaid($amountPaid);
Loading history...
120
    }
121
122
    /**
123
     * @deprecated
124
     * @return Money
125
     */
126
    public function getAmountRefunded()
127
    {
128
        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

128
        return parent::/** @scrutinizer ignore-call */ getAmountRefunded();
Loading history...
129
    }
130
131
    /**
132
     * @deprecated
133
     * @param Money $amountRefunded
134
     * @return static
135
     */
136
    public function setAmountRefunded(Money $amountRefunded = null)
137
    {
138
        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

138
        return parent::/** @scrutinizer ignore-call */ setAmountRefunded($amountRefunded);
Loading history...
139
    }
140
141
    /**
142
     * @deprecated
143
     * @return Money
144
     */
145
    public function getAuthorizedUntil()
146
    {
147
        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

147
        return parent::/** @scrutinizer ignore-call */ getAuthorizedUntil();
Loading history...
148
    }
149
150
    /**
151
     * @deprecated
152
     * @param Money $amountUntil
153
     * @return static
154
     */
155
    public function setAuthorizedUntil(Money $amountUntil = null)
156
    {
157
        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

157
        return parent::/** @scrutinizer ignore-call */ setAuthorizedUntil($amountUntil);
Loading history...
158
    }
159
}
160