Skip to content

Commit e07dd07

Browse files
authored
Merge pull request #54 from mindbox-moscow/MBM-333
Fixing issues related to DTO for payment entities and gift cards
2 parents 45ecacd + ec6559c commit e07dd07

File tree

5 files changed

+117
-1
lines changed

5 files changed

+117
-1
lines changed

src/DTO/V3/GiftCardDTO.php

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Mindbox\DTO\V3;
4+
5+
use Mindbox\DTO\DTO;
6+
7+
class GiftCardDTO extends DTO
8+
{
9+
/**
10+
* @var string Название элемента для корректной генерации xml.
11+
*/
12+
protected static $xmlName = 'giftCard';
13+
14+
/**
15+
* @return string
16+
*/
17+
public function getId()
18+
{
19+
return $this->getField('id');
20+
}
21+
22+
/**
23+
* @return string
24+
*/
25+
public function getGetFromPool()
26+
{
27+
return $this->getField('getFromPool');
28+
}
29+
}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
3+
namespace Mindbox\DTO\V3\Requests;
4+
5+
use Mindbox\DTO\V3\GiftCardDTO;
6+
7+
/**
8+
* Class GiftCardRequestDTO
9+
*
10+
* @package Mindbox\DTO\V3\Requests
11+
*/
12+
class GiftCardRequestDTO extends GiftCardDTO
13+
{
14+
/**
15+
* @param mixed $id
16+
*/
17+
public function setId($id)
18+
{
19+
$this->setField('id', $id);
20+
}
21+
22+
/**
23+
* @param mixed $getFromPool
24+
*/
25+
public function setGetFromPool($getFromPool)
26+
{
27+
$this->setField('getFromPool', $getFromPool);
28+
}
29+
}

src/DTO/V3/Requests/OrderRequestDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
/**
99
* Class OrderRequestDTO
1010
*
11-
* @package Mindbox\DTO\V2\Requests
11+
* @package Mindbox\DTO\V3\Requests
1212
* @property CustomerRequestDTO $customer
1313
* @property DiscountRequestCollection $discounts
1414
* @property string $deliveryCost
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<?php
2+
3+
namespace Mindbox\DTO\V3\Requests;
4+
5+
/**
6+
* Class PaymentRequestCollection
7+
*
8+
* @package Mindbox\DTO\V3\Requests
9+
*/
10+
class PaymentRequestCollection
11+
{
12+
/**
13+
* @var string Название элементов коллекции для корректной генерации xml.
14+
*/
15+
protected static $collectionItemsName = PaymentRequestDTO::class;
16+
17+
/**
18+
* @var string Название элемента для корректной генерации xml.
19+
*/
20+
protected static $xmlName = 'payments';
21+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<?php
2+
3+
namespace Mindbox\DTO\V3\Requests;
4+
5+
use Mindbox\DTO\V3\PaymentDTO;
6+
7+
/**
8+
* Class PaymentRequestDTO
9+
*
10+
* @package Mindbox\DTO\V3\Requests
11+
*/
12+
class PaymentRequestDTO extends PaymentDTO
13+
{
14+
/**
15+
* @param mixed $type
16+
*/
17+
public function setType($type)
18+
{
19+
$this->setField('type', $type);
20+
}
21+
22+
/**
23+
* @param mixed $id
24+
*/
25+
public function setId($id)
26+
{
27+
$this->setField('id', $id);
28+
}
29+
30+
/**
31+
* @param mixed $amount
32+
*/
33+
public function setAmount($amount)
34+
{
35+
$this->setField('amount', $amount);
36+
}
37+
}

0 commit comments

Comments
 (0)