Completed
Push — develop ( 0e14d9...1f40ce )
by Jens
13:20
created

PaymentDraft::fieldDefinitions()   B

Complexity

Conditions 1
Paths 1

Size

Total Lines 24
Code Lines 19

Duplication

Lines 24
Ratio 100 %

Code Coverage

Tests 16
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 24
loc 24
ccs 16
cts 16
cp 1
rs 8.9713
cc 1
eloc 19
nc 1
nop 0
crap 1
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 getExternalId()
24
 * @method PaymentDraft setExternalId(string $externalId = null)
25
 * @method string getInterfaceId()
26
 * @method PaymentDraft setInterfaceId(string $interfaceId = null)
27
 * @method Money getAmountPlanned()
28
 * @method PaymentDraft setAmountPlanned(Money $amountPlanned = null)
29
 * @method Money getAmountAuthorized()
30
 * @method PaymentDraft setAmountAuthorized(Money $amountAuthorized = null)
31
 * @method DateTimeDecorator getAuthorizedUntil()
32
 * @method PaymentDraft setAuthorizedUntil(DateTime $authorizedUntil = null)
33
 * @method Money getAmountPaid()
34
 * @method PaymentDraft setAmountPaid(Money $amountPaid = null)
35
 * @method Money getAmountRefunded()
36
 * @method PaymentDraft setAmountRefunded(Money $amountRefunded = null)
37
 * @method PaymentMethodInfo getPaymentMethodInfo()
38
 * @method PaymentDraft setPaymentMethodInfo(PaymentMethodInfo $paymentMethodInfo = null)
39
 * @method CustomFieldObjectDraft getCustom()
40
 * @method PaymentDraft setCustom(CustomFieldObjectDraft $custom = null)
41
 * @method PaymentStatus getPaymentStatus()
42
 * @method PaymentDraft setPaymentStatus(PaymentStatus $paymentStatus = null)
43
 * @method TransactionCollection getTransactions()
44
 * @method PaymentDraft setTransactions(TransactionCollection $transactions = null)
45
 * @method CustomFieldObjectDraftCollection getInterfaceInteractions()
46
 * @method PaymentDraft setInterfaceInteractions(CustomFieldObjectDraftCollection $interfaceInteractions = null)
47
 * @method string getKey()
48
 * @method PaymentDraft setKey(string $key = null)
49
 */
50 View Code Duplication
class PaymentDraft extends JsonObject
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
{
52 22
    public function fieldDefinitions()
53
    {
54
        return [
55 22
            'key' => [static::TYPE => 'string'],
56 22
            'customer' => [static::TYPE => CustomerReference::class],
57 22
            'externalId' => [static::TYPE => 'string'],
58 22
            'interfaceId' => [static::TYPE => 'string'],
59 22
            'amountPlanned' => [static::TYPE => Money::class],
60 22
            'amountAuthorized' => [static::TYPE => Money::class],
61
            'authorizedUntil' => [
62 22
                static::TYPE => DateTime::class,
63 22
                static::DECORATOR => DateTimeDecorator::class
64
            ],
65 22
            'amountPaid' => [static::TYPE => Money::class],
66 22
            'amountRefunded' => [static::TYPE => Money::class],
67 22
            'paymentMethodInfo' => [static::TYPE => PaymentMethodInfo::class],
68 22
            'custom' => [static::TYPE => CustomFieldObjectDraft::class],
69 22
            'paymentStatus' => [static::TYPE => PaymentStatus::class],
70 22
            'transactions' => [static::TYPE => TransactionCollection::class],
71
            'interfaceInteractions' => [
72 22
                static::TYPE => CustomFieldObjectDraftCollection::class
73
            ],
74
        ];
75
    }
76
}
77