We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 42c9dca8 authored by marcoss's avatar marcoss

Revert "Implement an API endpoint for Origin Keys"

This reverts commit d5f65e9e.
parent d5f65e9e
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2019 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Api;
interface AdyenOriginKeyInterface
{
/**
* @return string
*/
public function getOriginKey();
}
\ No newline at end of file
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2019 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Model;
use Adyen\AdyenException;
use Adyen\Payment\Helper\Data as AdyenHelper;
use Magento\Framework\Exception\NoSuchEntityException as MagentoNoSuchEntityException;
class AdyenOriginKey implements \Adyen\Payment\Api\AdyenOriginKeyInterface
{
/**
* @var AdyenHelper
*/
private $helper;
public function __construct(AdyenHelper $helper)
{
$this->helper = $helper;
}
/**
* {@inheritDoc}
* @throws MagentoNoSuchEntityException
* @throws AdyenException
*/
public function getOriginKey()
{
return $this->helper->getOriginKeyForBaseUrl();
}
}
\ No newline at end of file
<?php
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment Module
*
* Copyright (c) 2019 Adyen B.V.
* This file is open source and available under the MIT license.
* See the LICENSE file for more info.
*
* Author: Adyen <magento@adyen.com>
*/
namespace Adyen\Payment\Model;
use Adyen\Payment\Helper\Data as AdyenHelper;
use PHPUnit\Framework\TestCase;
use PHPUnit_Framework_MockObject_MockObject as MockObject;
class AdyenOriginKeyTest extends TestCase
{
/** @var AdyenHelper|MockObject */
private $helper;
protected function setUp()
{
$this->helper = $this->getMockBuilder(AdyenHelper::class)
->disableOriginalConstructor()
->getMock();
}
/** @throws \Exception */
public function testGetOriginKey()
{
$this->helper->method('getOriginKeyForBaseUrl')
->willReturn('something');
$module = new AdyenOriginKey($this->helper);
$this->assertEquals('something', $module->getOriginKey());
}
/** @throws \Exception */
public function testGetOriginKeyDoesNotHandleExceptions()
{
$this->helper->method('getOriginKeyForBaseUrl')
->willThrowException(new \Exception('Some error message', 400));
$module = new AdyenOriginKey($this->helper);
$this->expectException(\Exception::class);
$this->expectExceptionMessage('Some error message');
$this->expectExceptionCode(400);
$module->getOriginKey();
}
}
...@@ -972,8 +972,6 @@ ...@@ -972,8 +972,6 @@
type="Adyen\Payment\Model\AdyenPaymentProcess"/> type="Adyen\Payment\Model\AdyenPaymentProcess"/>
<preference for="Adyen\Payment\Api\AdyenThreeDS2ProcessInterface" <preference for="Adyen\Payment\Api\AdyenThreeDS2ProcessInterface"
type="Adyen\Payment\Model\AdyenThreeDS2Process"/> type="Adyen\Payment\Model\AdyenThreeDS2Process"/>
<preference for="Adyen\Payment\Api\AdyenOriginKeyInterface"
type="Adyen\Payment\Model\AdyenOriginKey"/>
<type name="Magento\Vault\Api\PaymentTokenRepositoryInterface"> <type name="Magento\Vault\Api\PaymentTokenRepositoryInterface">
<plugin name="AdyenPaymentVaultDeleteToken" type="Adyen\Payment\Plugin\PaymentVaultDeleteToken" sortOrder="10"/> <plugin name="AdyenPaymentVaultDeleteToken" type="Adyen\Payment\Plugin\PaymentVaultDeleteToken" sortOrder="10"/>
</type> </type>
......
...@@ -71,11 +71,4 @@ ...@@ -71,11 +71,4 @@
<resource ref="anonymous"/> <resource ref="anonymous"/>
</resources> </resources>
</route> </route>
<route url="/V1/adyen/originKey" method="GET">
<service class="Adyen\Payment\Api\AdyenOriginKeyInterface" method="getOriginKey"/>
<resources>
<resource ref="anonymous"/>
</resources>
</route>
</routes> </routes>
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment