File tree Expand file tree Collapse file tree 16 files changed +28
-21
lines changed
ReCaptchaCheckout/view/frontend/layout
ReCaptchaContact/etc/adminhtml
ReCaptchaCustomer/etc/adminhtml
ReCaptchaNewsletter/etc/adminhtml
Block/LayoutProcessor/Checkout
ReCaptchaReview/etc/adminhtml
ReCaptchaSendFriend/etc/adminhtml
ReCaptchaUser/etc/adminhtml
ReCaptchaVersion2Checkbox/etc
ReCaptchaVersion2Invisible/etc
ReCaptchaVersion3Invisible/etc Expand file tree Collapse file tree 16 files changed +28
-21
lines changed Original file line number Diff line number Diff line change 7
7
-->
8
8
<config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
9
9
xsi : noNamespaceSchemaLocation =" urn:magento:framework:ObjectManager/etc/config.xsd" >
10
- <virtualType name =" Magento\ReCaptchaApi \Model\OptionSource\Type"
10
+ <virtualType name =" Magento\ReCaptchaAdminUi \Model\OptionSource\Type"
11
11
type =" Magento\ReCaptchaAdminUi\Model\OptionSource" >
12
12
<arguments >
13
13
<argument name =" options" xsi : type =" array" >
Original file line number Diff line number Diff line change 28
28
<item name =" displayArea" xsi : type =" string" >additional-login-form-fields</item >
29
29
<item name =" configSource" xsi : type =" string" >checkoutConfig</item >
30
30
<item name =" reCaptchaId" xsi : type =" string" >recaptcha-checkout-inline-login</item >
31
- <item name =" zone" xsi : type =" string" >login</item >
32
31
</item >
33
32
</item >
34
33
</item >
47
46
<item name =" displayArea" xsi : type =" string" >additional-login-form-fields</item >
48
47
<item name =" configSource" xsi : type =" string" >checkoutConfig</item >
49
48
<item name =" reCaptchaId" xsi : type =" string" >recaptcha-checkout-inline-login-billing</item >
50
- <item name =" zone" xsi : type =" string" >login</item >
51
49
</item >
52
50
</item >
53
51
</item >
Original file line number Diff line number Diff line change 13
13
<field id =" contact" translate =" label" type =" select" sortOrder =" 140" showInDefault =" 1"
14
14
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
15
15
<label >Enable for Contact Us</label >
16
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
16
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
17
17
</field >
18
18
</group >
19
19
</section >
Original file line number Diff line number Diff line change 13
13
<field id =" customer_login" translate =" label" type =" select" sortOrder =" 110" showInDefault =" 1"
14
14
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
15
15
<label >Enable for Customer Login</label >
16
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
16
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
17
17
</field >
18
18
<field id =" customer_forgot_password" translate =" label" type =" select" sortOrder =" 120" showInDefault =" 1"
19
19
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
20
20
<label >Enable for Forgot Password</label >
21
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
21
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
22
22
</field >
23
23
<field id =" customer_create" translate =" label" type =" select" sortOrder =" 130" showInDefault =" 1"
24
24
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
25
25
<label >Enable for Create New Customer Account</label >
26
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
26
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
27
27
</field >
28
28
</group >
29
29
</section >
Original file line number Diff line number Diff line change 14
14
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
15
15
<label >Enable Invisible reCAPTCHA in Newsletter Subscription</label >
16
16
<comment >If enabled, a badge will be displayed in every page.</comment >
17
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
17
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
18
18
</field >
19
19
</group >
20
20
</section >
Original file line number Diff line number Diff line change 8
8
namespace Magento \ReCaptchaPaypal \Block \LayoutProcessor \Checkout ;
9
9
10
10
use Magento \Checkout \Block \Checkout \LayoutProcessorInterface ;
11
+ use Magento \Framework \Exception \InputException ;
11
12
use Magento \ReCaptchaUi \Model \IsCaptchaEnabledInterface ;
12
13
use Magento \ReCaptchaUi \Model \UiConfigResolverInterface ;
13
14
@@ -39,10 +40,11 @@ public function __construct(
39
40
}
40
41
41
42
/**
42
- * Process js Layout of block
43
+ * {@inheritdoc}
43
44
*
44
45
* @param array $jsLayout
45
46
* @return array
47
+ * @throws InputException
46
48
*/
47
49
public function process ($ jsLayout )
48
50
{
Original file line number Diff line number Diff line change @@ -103,13 +103,21 @@ public function execute(Observer $observer): void
103
103
$ request = $ controller ->getRequest ();
104
104
$ response = $ controller ->getResponse ();
105
105
106
+ $ validationConfig = $ this ->validationConfigResolver ->get ($ key );
107
+
106
108
try {
107
109
$ reCaptchaResponse = $ this ->captchaResponseResolver ->resolve ($ request );
108
110
} catch (InputException $ e ) {
109
- $ reCaptchaResponse = '' ;
110
111
$ this ->logger ->error ($ e );
112
+
113
+ $ jsonPayload = $ this ->serializer ->serialize ([
114
+ 'success ' => false ,
115
+ 'error ' => true ,
116
+ 'error_messages ' => $ validationConfig ->getValidationFailureMessage (),
117
+ ]);
118
+ $ response ->representJson ($ jsonPayload );
119
+ return ;
111
120
}
112
- $ validationConfig = $ this ->validationConfigResolver ->get ($ key );
113
121
114
122
$ validationResult = $ this ->captchaValidator ->isValid ($ reCaptchaResponse , $ validationConfig );
115
123
if (false === $ validationResult ->isValid ()) {
Original file line number Diff line number Diff line change 4
4
"require" : {
5
5
"php" : " ~7.1.3||~7.2.0||~7.3.0" ,
6
6
"magento/module-re-captcha-frontend-ui" : " *" ,
7
- "magento/module-paypal -captcha" : " *"
7
+ "magento/module-re -captcha-validation-api " : " *"
8
8
},
9
9
"type" : " magento2-module" ,
10
10
"license" : " OSL-3.0" ,
Original file line number Diff line number Diff line change 13
13
<field id =" paypal_payflowpro" translate =" label" type =" select" sortOrder =" 200" showInDefault =" 1"
14
14
showInWebsite =" 1" showInStore =" 0" canRestore =" 1" >
15
15
<label >Enable for PayPal PayflowPro payment form</label >
16
- <source_model >Magento\ReCaptchaApi \Model\OptionSource\Type</source_model >
16
+ <source_model >Magento\ReCaptchaAdminUi \Model\OptionSource\Type</source_model >
17
17
</field >
18
18
</group >
19
19
</section >
Original file line number Diff line number Diff line change 29
29
<item name =" displayArea" xsi : type =" string" >additional-payment-fields</item >
30
30
<item name =" configSource" xsi : type =" string" >checkoutConfig</item >
31
31
<item name =" reCaptchaId" xsi : type =" string" >recaptcha-checkout-paypal-form</item >
32
- <item name =" zone" xsi : type =" string" >paypal</item >
33
32
</item >
34
33
</item >
35
34
</item >
You can’t perform that action at this time.
0 commit comments