Skip to content
This repository was archived by the owner on Oct 24, 2023. It is now read-only.

Commit b4ec4a2

Browse files
author
Jens Schulze
committed
fix(Message): fix object hierarchy for PaymentTransactionStateChanged message
1 parent 3ba9596 commit b4ec4a2

File tree

2 files changed

+58
-16
lines changed

2 files changed

+58
-16
lines changed

src/Core/Model/Message/PaymentTransactionChangedMessage.php

Lines changed: 9 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,20 @@
66
namespace Commercetools\Core\Model\Message;
77

88
use Commercetools\Core\Model\Common\DateTimeDecorator;
9-
use Commercetools\Core\Model\Common\Reference;
10-
use Commercetools\Core\Model\Payment\Transaction;
119
use DateTime;
10+
use Commercetools\Core\Model\Common\Reference;
1211

1312
/**
1413
* @package Commercetools\Core\Model\Message
15-
* @link https://dev.commercetools.com/http-api-projects-messages.html#paymenttransactionstatechanged-message
14+
* @deprecated Use PaymentTransactionStateChangedMessage instead
1615
* @method string getId()
1716
* @method PaymentTransactionChangedMessage setId(string $id = null)
17+
* @method int getVersion()
18+
* @method PaymentTransactionChangedMessage setVersion(int $version = null)
1819
* @method DateTimeDecorator getCreatedAt()
1920
* @method PaymentTransactionChangedMessage setCreatedAt(DateTime $createdAt = null)
21+
* @method DateTimeDecorator getLastModifiedAt()
22+
* @method PaymentTransactionChangedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
2023
* @method int getSequenceNumber()
2124
* @method PaymentTransactionChangedMessage setSequenceNumber(int $sequenceNumber = null)
2225
* @method Reference getResource()
@@ -25,22 +28,12 @@
2528
* @method PaymentTransactionChangedMessage setResourceVersion(int $resourceVersion = null)
2629
* @method string getType()
2730
* @method PaymentTransactionChangedMessage setType(string $type = null)
31+
* @method string getTransactionId()
32+
* @method PaymentTransactionChangedMessage setTransactionId(string $transactionId = null)
2833
* @method string getState()
2934
* @method PaymentTransactionChangedMessage setState(string $state = null)
30-
* @method int getVersion()
31-
* @method PaymentTransactionChangedMessage setVersion(int $version = null)
32-
* @method DateTimeDecorator getLastModifiedAt()
33-
* @method PaymentTransactionChangedMessage setLastModifiedAt(DateTime $lastModifiedAt = null)
3435
*/
35-
class PaymentTransactionChangedMessage extends Message
36+
class PaymentTransactionChangedMessage extends PaymentTransactionStateChangedMessage
3637
{
37-
const MESSAGE_TYPE = 'PaymentTransactionChanged';
38-
39-
public function fieldDefinitions()
40-
{
41-
$definitions = parent::fieldDefinitions();
42-
$definitions['state'] = [static::TYPE => 'string'];
4338

44-
return $definitions;
45-
}
4639
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php
2+
/**
3+
* @author @jayS-de <jens.schulze@commercetools.de>
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+
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+
}

0 commit comments

Comments
 (0)