Completed
Push — develop ( 32d182...09288a )
by Jens
08:30
created

Transaction::fieldDefinitions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 14
Code Lines 10

Duplication

Lines 14
Ratio 100 %

Code Coverage

Tests 8
CRAP Score 1

Importance

Changes 2
Bugs 0 Features 2
Metric Value
c 2
b 0
f 2
dl 14
loc 14
ccs 8
cts 8
cp 1
rs 9.4285
cc 1
eloc 10
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\Common\DateTimeDecorator;
10
use Commercetools\Core\Model\Common\Money;
11
use Commercetools\Core\Model\State\StateReference;
12
13
/**
14
 * @package Commercetools\Core\Model\Payment
15
 * @link https://dev.commercetools.com/http-api-projects-payments.html#transaction
16
 * @method DateTimeDecorator getTimestamp()
17
 * @method Transaction setTimestamp(\DateTime $timestamp = null)
18
 * @method string getType()
19
 * @method Transaction setType(string $type = null)
20
 * @method Money getAmount()
21
 * @method Transaction setAmount(Money $amount = null)
22
 * @method string getInteractionId()
23
 * @method Transaction setInteractionId(string $interactionId = null)
24
 * @method string getId()
25
 * @method Transaction setId(string $id = null)
26
 * @method string getState()
27
 * @method Transaction setState(string $state = null)
28
 */
29
class Transaction extends JsonObject
30
{
31
    const AUTHORIZATION = 'Authorization';
32
    const CANCEL_AUTHORIZATION = 'CancelAuthorization';
33
    const CHARGE = 'Charge';
34
    const REFUND = 'Refund';
35
    const CHARGE_BACK = 'Chargeback';
36
37 1 View Code Duplication
    public function fieldDefinitions()
0 ignored issues
show
Duplication introduced by
This method 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...
38
    {
39
        return [
40 1
            'id' => [static::TYPE => 'string'],
41 1
            'state' => [static::TYPE => 'string'],
42
            'timestamp' => [
43 1
                static::TYPE => '\DateTime',
44 1
                static::DECORATOR => '\Commercetools\Core\Model\Common\DateTimeDecorator'
45
            ],
46 1
            'type' => [static::TYPE => 'string'],
47 1
            'amount' => [static::TYPE => '\Commercetools\Core\Model\Common\Money'],
48 1
            'interactionId' => [static::TYPE => 'string'],
49
        ];
50
    }
51
}
52