1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* @author @jayS-de <[email protected]> |
4
|
|
|
*/ |
5
|
|
|
|
6
|
|
|
namespace Commercetools\Core\Model\Message; |
7
|
|
|
|
8
|
|
|
use Commercetools\Core\Model\Common\DateTimeDecorator; |
9
|
|
|
use Commercetools\Core\Model\Common\Reference; |
10
|
|
|
use Commercetools\Core\Model\Payment\Transaction; |
11
|
|
|
use DateTime; |
12
|
|
|
|
13
|
|
|
/** |
14
|
|
|
* @package Commercetools\Core\Model\Message |
15
|
|
|
* @link https://dev.commercetools.com/http-api-projects-messages.html#paymenttransactionstatechanged-message |
16
|
|
|
* @method string getId() |
17
|
|
|
* @method PaymentTransactionStateChangedMessage setId(string $id = null) |
18
|
|
|
* @method DateTimeDecorator getCreatedAt() |
19
|
|
|
* @method PaymentTransactionStateChangedMessage setCreatedAt(DateTime $createdAt = null) |
20
|
|
|
* @method int getSequenceNumber() |
21
|
|
|
* @method PaymentTransactionStateChangedMessage setSequenceNumber(int $sequenceNumber = null) |
22
|
|
|
* @method Reference getResource() |
23
|
|
|
* @method PaymentTransactionStateChangedMessage setResource(Reference $resource = null) |
24
|
|
|
* @method int getResourceVersion() |
25
|
|
|
* @method PaymentTransactionStateChangedMessage setResourceVersion(int $resourceVersion = null) |
26
|
|
|
* @method string getType() |
27
|
|
|
* @method PaymentTransactionStateChangedMessage setType(string $type = null) |
28
|
|
|
* @method string getState() |
29
|
|
|
* @method PaymentTransactionStateChangedMessage setState(string $state = null) |
30
|
|
|
* @method int getVersion() |
31
|
|
|
* @method PaymentTransactionStateChangedMessage setVersion(int $version = null) |
32
|
|
|
* @method DateTimeDecorator getLastModifiedAt() |
33
|
|
|
* @method PaymentTransactionStateChangedMessage setLastModifiedAt(DateTime $lastModifiedAt = null) |
34
|
|
|
* @method string getTransactionId() |
35
|
|
|
* @method PaymentTransactionStateChangedMessage setTransactionId(string $transactionId = null) |
36
|
|
|
*/ |
37
|
|
View Code Duplication |
class PaymentTransactionStateChangedMessage extends Message |
|
|
|
|
38
|
|
|
{ |
39
|
|
|
const MESSAGE_TYPE = 'PaymentTransactionStateChanged'; |
40
|
|
|
|
41
|
|
|
public function fieldDefinitions() |
42
|
|
|
{ |
43
|
|
|
$definitions = parent::fieldDefinitions(); |
44
|
|
|
$definitions['transactionId'] = [static::TYPE => 'string']; |
45
|
|
|
$definitions['state'] = [static::TYPE => 'string']; |
46
|
|
|
|
47
|
|
|
return $definitions; |
48
|
|
|
} |
49
|
|
|
} |
50
|
|
|
|
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.