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

Commit c156560

Browse files
author
Jens Schulze
committed
Merge branch 'release/v1.0.0-RC5'
2 parents 70db54d + 4da5d46 commit c156560

File tree

10 files changed

+108
-2
lines changed

10 files changed

+108
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
### Features
66

77
* **LineItems:** add update actions for custom types on line items ([c64fad0](https://github.com/sphereio/commercetools-php-sdk/commit/c64fad0))
8-
* **Payment:** add payment update actions for cart ([13e1860](https://github.com/sphereio/commercetools-php-sdk/commit/13e1860))
8+
* **Payment:** add payment info to cart and order ([e279d1a](https://github.com/sphereio/commercetools-php-sdk/commit/e279d1a))
9+
* **Payment:** add payment update actions for cart and order ([13e1860](https://github.com/sphereio/commercetools-php-sdk/commit/13e1860))
910

1011

1112

src/Model/Cart/Cart.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Commercetools\Core\Model\CustomerGroup\CustomerGroupReference;
1313
use Commercetools\Core\Model\CustomField\CustomFieldObject;
1414
use Commercetools\Core\Model\Common\DateTimeDecorator;
15+
use Commercetools\Core\Model\Payment\PaymentInfo;
1516

1617
/**
1718
* @package Commercetools\Core\Model\Cart
@@ -54,6 +55,8 @@
5455
* @method Cart setDiscountCodes(DiscountCodeInfoCollection $discountCodes = null)
5556
* @method CustomFieldObject getCustom()
5657
* @method Cart setCustom(CustomFieldObject $custom = null)
58+
* @method PaymentInfo getPaymentInfo()
59+
* @method Cart setPaymentInfo(PaymentInfo $paymentInfo = null)
5760
*/
5861
class Cart extends Resource
5962
{
@@ -85,6 +88,7 @@ public function fieldDefinitions()
8588
'shippingInfo' => [static::TYPE => '\Commercetools\Core\Model\Cart\ShippingInfo'],
8689
'discountCodes' => [static::TYPE => '\Commercetools\Core\Model\Cart\DiscountCodeInfoCollection'],
8790
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
91+
'paymentInfo' => [static::TYPE => '\Commercetools\Core\Model\Cart\PaymentInfo'],
8892
];
8993
}
9094
}

src/Model/Order/Order.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@
7676
* @method Order setCustom(CustomFieldObject $custom = null)
7777
* @method StateReference getState()
7878
* @method Order setState(StateReference $state = null)
79+
* @method PaymentInfo getPaymentInfo()
80+
* @method Order setPaymentInfo(PaymentInfo $paymentInfo = null)
7981
*/
8082
class Order extends Resource
8183
{
@@ -114,7 +116,8 @@ public function fieldDefinitions()
114116
'lastMessageSequenceNumber' => [static::TYPE => 'int'],
115117
'cart' => [static::TYPE => '\Commercetools\Core\Model\Cart\CartReference'],
116118
'custom' => [static::TYPE => '\Commercetools\Core\Model\CustomField\CustomFieldObject'],
117-
'state' => [static::TYPE => '\Commercetools\Core\Model\State\StateReference']
119+
'state' => [static::TYPE => '\Commercetools\Core\Model\State\StateReference'],
120+
'paymentInfo' => [static::TYPE => '\Commercetools\Core\Model\Cart\PaymentInfo'],
118121
];
119122
}
120123
}

src/Model/Payment/PaymentInfo.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<?php
2+
/**
3+
* @author @ct-jensschulze <[email protected]>
4+
*/
5+
6+
namespace Commercetools\Core\Model\Payment;
7+
8+
use Commercetools\Core\Model\Common\JsonObject;
9+
10+
/**
11+
* @package Commercetools\Core\Model\Payment
12+
*
13+
* @method PaymentCollection getPayments()
14+
* @method PaymentInfo setPayments(PaymentCollection $payments = null)
15+
*/
16+
class PaymentInfo extends JsonObject
17+
{
18+
public function fieldDefinitions()
19+
{
20+
return [
21+
'payments' => [static::TYPE => '\Commercetools\Core\Model\Payment\PaymentCollection'],
22+
];
23+
}
24+
}

src/Model/Payment/PaymentReference.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88
use Commercetools\Core\Model\Common\Context;
99
use Commercetools\Core\Model\Common\Reference;
1010

11+
/**
12+
* @package Commercetools\Core\Model\Payment
13+
*
14+
* @method string getTypeId()
15+
* @method PaymentReference setTypeId(string $typeId = null)
16+
* @method string getId()
17+
* @method PaymentReference setId(string $id = null)
18+
* @method Payment getObj()
19+
* @method PaymentReference setObj(Payment $obj = null)
20+
*/
1121
class PaymentReference extends Reference
1222
{
1323
const TYPE_PAYMENT = 'payment';

src/Request/Carts/Command/CartAddPaymentAction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88
use Commercetools\Core\Model\Common\Context;
99
use Commercetools\Core\Request\AbstractAction;
10+
use Commercetools\Core\Model\Payment\PaymentReference;
1011

12+
/**
13+
* @package Commercetools\Core\Request\Carts\Command
14+
*
15+
* @method string getAction()
16+
* @method CartAddPaymentAction setAction(string $action = null)
17+
* @method PaymentReference getPayment()
18+
* @method CartAddPaymentAction setPayment(PaymentReference $payment = null)
19+
*/
1120
class CartAddPaymentAction extends AbstractAction
1221
{
1322
public function fieldDefinitions()

src/Request/Carts/Command/CartRemovePaymentAction.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,16 @@
77

88
use Commercetools\Core\Model\Common\Context;
99
use Commercetools\Core\Request\AbstractAction;
10+
use Commercetools\Core\Model\Payment\PaymentReference;
1011

12+
/**
13+
* @package Commercetools\Core\Request\Carts\Command
14+
*
15+
* @method string getAction()
16+
* @method CartRemovePaymentAction setAction(string $action = null)
17+
* @method PaymentReference getPayment()
18+
* @method CartRemovePaymentAction setPayment(PaymentReference $payment = null)
19+
*/
1120
class CartRemovePaymentAction extends AbstractAction
1221
{
1322
public function fieldDefinitions()
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* @author @ct-jensschulze <[email protected]>
4+
*/
5+
6+
namespace Commercetools\Core\Request\Orders\Command;
7+
8+
use Commercetools\Core\Request\Carts\Command\CartAddPaymentAction;
9+
use Commercetools\Core\Model\Payment\PaymentReference;
10+
11+
/**
12+
* @package Commercetools\Core\Request\Orders\Command
13+
*
14+
* @method string getAction()
15+
* @method OrderAddPaymentAction setAction(string $action = null)
16+
* @method PaymentReference getPayment()
17+
* @method OrderAddPaymentAction setPayment(PaymentReference $payment = null)
18+
*/
19+
class OrderAddPaymentAction extends CartAddPaymentAction
20+
{
21+
22+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?php
2+
/**
3+
* @author @ct-jensschulze <[email protected]>
4+
*/
5+
6+
namespace Commercetools\Core\Request\Orders\Command;
7+
8+
use Commercetools\Core\Request\Carts\Command\CartRemovePaymentAction;
9+
use Commercetools\Core\Model\Payment\PaymentReference;
10+
11+
/**
12+
* @package Commercetools\Core\Request\Orders\Command
13+
*
14+
* @method string getAction()
15+
* @method OrderRemovePaymentAction setAction(string $action = null)
16+
* @method PaymentReference getPayment()
17+
* @method OrderRemovePaymentAction setPayment(PaymentReference $payment = null)
18+
*/
19+
class OrderRemovePaymentAction extends CartRemovePaymentAction
20+
{
21+
22+
}

tests/fixtures/models.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ cart:
2121
- shippingInfo
2222
- discountCodes
2323
- custom
24+
- paymentInfo
2425

2526
lineItem:
2627
domain: cart
@@ -336,6 +337,7 @@ order:
336337
- cart
337338
- custom
338339
- state
340+
- paymentInfo
339341

340342
syncInfo:
341343
domain: order

0 commit comments

Comments
 (0)