Skip to content

Commit

Permalink
[ECP-9482] Put magentoDetails method in data class
Browse files Browse the repository at this point in the history
  • Loading branch information
sushmita committed Oct 9, 2024
1 parent 06aa3c6 commit 7cc3e2a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@
use Magento\Payment\Gateway\Data\PaymentDataObject;
use Magento\Payment\Gateway\Helper\SubjectReader;

class ExternalPlatformHeaderDataBuilder implements ExternalPlatformHeaderDataBuilderInterface
class HeaderDataBuilder implements HeaderDataBuilderInterface
{
/**
* @var ProductMetadataInterface
*/
protected ProductMetadataInterface $productMetadata;
// /**
// * @var ProductMetadataInterface
// */
// protected ProductMetadataInterface $productMetadata;

/**
* @var Data
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Adyen\Payment\Gateway\Request\Header;

interface ExternalPlatformHeaderDataBuilderInterface
interface HeaderDataBuilderInterface
{
const EXTERNAL_PLATFORM_NAME = 'external-platform-name';
const EXTERNAL_PLATFORM_VERSION = 'external-platform-version';
Expand All @@ -21,3 +21,4 @@ interface ExternalPlatformHeaderDataBuilderInterface
*/
public function build(array $buildSubject);
}

6 changes: 3 additions & 3 deletions Helper/PaymentsDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

use Adyen\AdyenException;
use Adyen\Model\Checkout\PaymentDetailsRequest;
use Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder;
use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder;
use Adyen\Payment\Helper\Util\DataArrayValidator;
use Adyen\Payment\Logger\AdyenLogger;
use Magento\Checkout\Model\Session;
Expand Down Expand Up @@ -46,9 +46,9 @@ class PaymentsDetails
private Data $adyenHelper;

/**
* @var ExternalPlatformHeaderDataBuilder
* @var HeaderDataBuilder
*/
private ExternalPlatformHeaderDataBuilder $headerBuilder;
private HeaderDataBuilder $headerBuilder;

/**
* @var AdyenLogger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

namespace Adyen\Payment\Test\Unit\Gateway\Request;

use Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder;
use Adyen\Payment\Gateway\Request\HeaderDataBuilder;
use Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder;
use Adyen\Payment\Test\Unit\AbstractAdyenTestCase;
use Adyen\Payment\Helper\Data;
use Magento\Framework\TestFramework\Unit\Helper\ObjectManager;
Expand All @@ -15,7 +14,7 @@
use PHPUnit\Framework\MockObject\MockObject;
use PHPUnit\Framework\TestCase;

class ExternalPlatformHeaderDataBuilderTest extends AbstractAdyenTestCase
class HeaderDataBuilderTest extends AbstractAdyenTestCase
{
/**
* @var HeaderDataBuilder
Expand All @@ -36,7 +35,7 @@ protected function setUp(): void
->getMock();

$this->headerDataBuilder = $objectManager->getObject(
ExternalPlatformHeaderDataBuilder::class,
HeaderDataBuilder::class,
[
'adyenHelper' => $this->adyenHelperMock
]
Expand Down
12 changes: 6 additions & 6 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@
<item name="returnurl" xsi:type="string">Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder</item>
<item name="channel" xsi:type="string">Adyen\Payment\Gateway\Request\ChannelDataBuilder</item>
<item name="origin" xsi:type="string">Adyen\Payment\Gateway\Request\OriginDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="giftcard" xsi:type="string">Adyen\Payment\Gateway\Request\GiftcardDataBuilder</item>
</argument>
</arguments>
Expand Down Expand Up @@ -1132,7 +1132,7 @@
<item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
<item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringVaultDataBuilder</item>
<item name="shopperinteraction" xsi:type="string">Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="giftcard" xsi:type="string">Adyen\Payment\Gateway\Request\GiftcardDataBuilder</item>
</argument>
</arguments>
Expand All @@ -1152,7 +1152,7 @@
<item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
<item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringVaultDataBuilder</item>
<item name="shopperinteraction" xsi:type="string">Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="giftcard" xsi:type="string">Adyen\Payment\Gateway\Request\GiftcardDataBuilder</item>
</argument>
</arguments>
Expand Down Expand Up @@ -1200,7 +1200,7 @@
<item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
<item name="shopperinteraction" xsi:type="string">Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder</item>
<item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="returnurl" xsi:type="string">Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder</item>
<item name="channel" xsi:type="string">Adyen\Payment\Gateway\Request\ChannelDataBuilder</item>
<item name="origin" xsi:type="string">Adyen\Payment\Gateway\Request\OriginDataBuilder</item>
Expand All @@ -1220,7 +1220,7 @@
<item name="browserinfo" xsi:type="string">Adyen\Payment\Gateway\Request\BrowserInfoDataBuilder</item>
<item name="shopperinteraction" xsi:type="string">Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder</item>
<item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="returnurl" xsi:type="string">Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder</item>
<item name="channel" xsi:type="string">Adyen\Payment\Gateway\Request\ChannelDataBuilder</item>
<item name="origin" xsi:type="string">Adyen\Payment\Gateway\Request\OriginDataBuilder</item>
Expand Down Expand Up @@ -1248,7 +1248,7 @@
<item name="recurring" xsi:type="string">Adyen\Payment\Gateway\Request\RecurringDataBuilder</item>
<item name="shopperinteraction" xsi:type="string">Adyen\Payment\Gateway\Request\ShopperInteractionDataBuilder</item>
<item name="transaction" xsi:type="string">Adyen\Payment\Gateway\Request\CheckoutDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\ExternalPlatformHeaderDataBuilder</item>
<item name="header" xsi:type="string">Adyen\Payment\Gateway\Request\Header\HeaderDataBuilder</item>
<item name="returnurl" xsi:type="string">Adyen\Payment\Gateway\Request\ReturnUrlDataBuilder</item>
<item name="channel" xsi:type="string">Adyen\Payment\Gateway\Request\ChannelDataBuilder</item>
<item name="origin" xsi:type="string">Adyen\Payment\Gateway\Request\OriginDataBuilder</item>
Expand Down

0 comments on commit 7cc3e2a

Please sign in to comment.