Skip to content

Fixing issues related to DTO for payment entities and gift cards #54

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Oct 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions src/DTO/V3/GiftCardDTO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Mindbox\DTO\V3;

use Mindbox\DTO\DTO;

class GiftCardDTO extends DTO
{
/**
* @var string Название элемента для корректной генерации xml.
*/
protected static $xmlName = 'giftCard';

/**
* @return string
*/
public function getId()
{
return $this->getField('id');
}

/**
* @return string
*/
public function getGetFromPool()
{
return $this->getField('getFromPool');
}
}
29 changes: 29 additions & 0 deletions src/DTO/V3/Requests/GiftCardRequestDTO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\V3\GiftCardDTO;

/**
* Class GiftCardRequestDTO
*
* @package Mindbox\DTO\V3\Requests
*/
class GiftCardRequestDTO extends GiftCardDTO
{
/**
* @param mixed $id
*/
public function setId($id)
{
$this->setField('id', $id);
}

/**
* @param mixed $getFromPool
*/
public function setGetFromPool($getFromPool)
{
$this->setField('getFromPool', $getFromPool);
}
}
2 changes: 1 addition & 1 deletion src/DTO/V3/Requests/OrderRequestDTO.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
/**
* Class OrderRequestDTO
*
* @package Mindbox\DTO\V2\Requests
* @package Mindbox\DTO\V3\Requests
* @property CustomerRequestDTO $customer
* @property DiscountRequestCollection $discounts
* @property string $deliveryCost
Expand Down
21 changes: 21 additions & 0 deletions src/DTO/V3/Requests/PaymentRequestCollection.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Mindbox\DTO\V3\Requests;

/**
* Class PaymentRequestCollection
*
* @package Mindbox\DTO\V3\Requests
*/
class PaymentRequestCollection
{
/**
* @var string Название элементов коллекции для корректной генерации xml.
*/
protected static $collectionItemsName = PaymentRequestDTO::class;

/**
* @var string Название элемента для корректной генерации xml.
*/
protected static $xmlName = 'payments';
}
37 changes: 37 additions & 0 deletions src/DTO/V3/Requests/PaymentRequestDTO.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?php

namespace Mindbox\DTO\V3\Requests;

use Mindbox\DTO\V3\PaymentDTO;

/**
* Class PaymentRequestDTO
*
* @package Mindbox\DTO\V3\Requests
*/
class PaymentRequestDTO extends PaymentDTO
{
/**
* @param mixed $type
*/
public function setType($type)
{
$this->setField('type', $type);
}

/**
* @param mixed $id
*/
public function setId($id)
{
$this->setField('id', $id);
}

/**
* @param mixed $amount
*/
public function setAmount($amount)
{
$this->setField('amount', $amount);
}
}