File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
ReCaptchaCheckout/view/frontend/web/js Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,23 @@ define(
4949 */
5050 isCheckoutReCaptchaRequiredFor : function ( method ) {
5151 return ! this . skipPayments || ! this . skipPayments . hasOwnProperty ( method . getCode ( ) ) ;
52+ } ,
53+
54+ /**
55+ * @inheritdoc
56+ */
57+ initCaptcha : function ( ) {
58+ var $wrapper , $recaptchaResponseInput ;
59+
60+ this . _super ( ) ;
61+ // Since there will be multiple recaptcha in the payment form,
62+ // they may override each other if the form is submitted.
63+ // The recaptcha response will be collected in the callback: reCaptchaCallback()
64+ $wrapper = $ ( '#' + this . getReCaptchaId ( ) + '-wrapper' ) ;
65+ $recaptchaResponseInput = $wrapper . find ( '[name=g-recaptcha-response]' ) ;
66+ if ( $recaptchaResponseInput . length ) {
67+ $recaptchaResponseInput . prop ( 'disabled' , true ) ;
68+ }
5269 }
5370 } ) ;
5471 }
You can’t perform that action at this time.
0 commit comments