Skip to content

Commit 116c0c1

Browse files
committed
MC-41001: CAPTCHA fields not displaying after unsuccessful number of attempts in Checkout for 3rd-party payment providers
1 parent 37d302f commit 116c0c1

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

app/code/Magento/Captcha/Plugin/FrontendOrderPlacementPlugin.php renamed to app/code/Magento/Captcha/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPlugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
/**
1414
* Reset attempts for frontend checkout
1515
*/
16-
class FrontendOrderPlacementPlugin
16+
class ResetPaymentAttemptsAfterOrderIsPlacedPlugin
1717
{
1818
/**
1919
* Form ID
@@ -23,15 +23,15 @@ class FrontendOrderPlacementPlugin
2323
/**
2424
* @var HelperCaptcha
2525
*/
26-
private HelperCaptcha $helper;
26+
private $helper;
2727

2828
/**
2929
* @var LogFactory
3030
*/
3131
private $resLogFactory;
3232

3333
/**
34-
* ResetAttemptForFrontendAccountEditObserver constructor
34+
* ResetPaymentAttemptsAfterOrderIsPlacedPlugin constructor
3535
*
3636
* @param HelperCaptcha $helper
3737
* @param LogFactory $resLogFactory

app/code/Magento/Captcha/Test/Unit/Plugin/FrontendOrderPlacementPluginTest.php renamed to app/code/Magento/Captcha/Test/Unit/Plugin/ResetPaymentAttemptsAfterOrderIsPlacedPluginTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@
1010

1111
use Magento\Captcha\Model\ResourceModel\Log;
1212
use Magento\Captcha\Model\ResourceModel\LogFactory;
13-
use Magento\Captcha\Plugin\FrontendOrderPlacementPlugin;
13+
use Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin;
1414
use Magento\Captcha\Helper\Data as HelperCaptcha;
1515
use Magento\Captcha\Model\DefaultModel;
1616
use Magento\Sales\Api\Data\OrderInterface;
1717
use Magento\Sales\Api\OrderManagementInterface;
1818
use PHPUnit\Framework\TestCase;
1919

2020
/**
21-
* Unit test for \Magento\Captcha\Observer\FrontendOrderPlacementPluginTest
21+
* Unit test for ResetPaymentAttemptsAfterOrderIsPlacedPluginTest
2222
*/
23-
class FrontendOrderPlacementPluginTest extends TestCase
23+
class ResetPaymentAttemptsAfterOrderIsPlacedPluginTest extends TestCase
2424
{
2525
/**
2626
* Test that the method resets attempts for frontend checkout
@@ -39,7 +39,7 @@ public function testExecuteExpectsDeleteUserAttemptsCalled()
3939
$logMock->expects($this->once())->method('deleteUserAttempts')->willReturnSelf();
4040
$resLogFactoryMock = $this->createMock(LogFactory::class);
4141
$resLogFactoryMock->expects($this->once())->method('create')->willReturn($logMock);
42-
$observer = new FrontendOrderPlacementPlugin($helperCaptchaMock, $resLogFactoryMock);
42+
$observer = new ResetPaymentAttemptsAfterOrderIsPlacedPlugin($helperCaptchaMock, $resLogFactoryMock);
4343
$observer->afterPlace($orderManagementInterfaceMock, $resultOrderMock, $orderMock);
4444
}
4545
}

app/code/Magento/Captcha/etc/frontend/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@
3535
</arguments>
3636
</type>
3737
<type name="Magento\Sales\Api\OrderManagementInterface">
38-
<plugin name="frontend_order_placement_reset_captcha_attempt" type="Magento\Captcha\Plugin\FrontendOrderPlacementPlugin"/>
38+
<plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/>
3939
</type>
4040
</config>

app/code/Magento/Captcha/etc/webapi_rest/di.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@
77
-->
88
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
99
<type name="Magento\Sales\Api\OrderManagementInterface">
10-
<plugin name="frontend_order_placement_reset_captcha_attempt" type="Magento\Captcha\Plugin\FrontendOrderPlacementPlugin"/>
10+
<plugin name="reset_payment_attempts_after_order_is_placed_plugin" type="Magento\Captcha\Plugin\ResetPaymentAttemptsAfterOrderIsPlacedPlugin"/>
1111
</type>
1212
</config>

0 commit comments

Comments
 (0)