![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/magento/module-re-captcha-paypal/Block/LayoutProcessor/Checkout/ |
<?php /** * Copyright © Magento, Inc. All rights reserved. * See COPYING.txt for license details. */ declare(strict_types=1); namespace Magento\ReCaptchaPaypal\Block\LayoutProcessor\Checkout; use Magento\Checkout\Block\Checkout\LayoutProcessorInterface; use Magento\Framework\Exception\InputException; use Magento\ReCaptchaUi\Model\IsCaptchaEnabledInterface; use Magento\ReCaptchaUi\Model\UiConfigResolverInterface; /** * Provides reCaptcha component configuration. */ class Onepage implements LayoutProcessorInterface { /** * @var UiConfigResolverInterface */ private $captchaUiConfigResolver; /** * @var IsCaptchaEnabledInterface */ private $isCaptchaEnabled; /** * @param UiConfigResolverInterface $captchaUiConfigResolver * @param IsCaptchaEnabledInterface $isCaptchaEnabled */ public function __construct( UiConfigResolverInterface $captchaUiConfigResolver, IsCaptchaEnabledInterface $isCaptchaEnabled ) { $this->captchaUiConfigResolver = $captchaUiConfigResolver; $this->isCaptchaEnabled = $isCaptchaEnabled; } /** * {@inheritdoc} * * @param array $jsLayout * @return array * @throws InputException */ public function process($jsLayout) { $key = 'paypal_payflowpro'; if ($this->isCaptchaEnabled->isCaptchaEnabledFor($key)) { $jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children']['paypal-captcha']['children'] ['recaptcha']['settings'] = $this->captchaUiConfigResolver->get($key); } else { if (isset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children']['paypal-captcha']['children']['recaptcha'])) { unset($jsLayout['components']['checkout']['children']['steps']['children']['billing-step']['children'] ['payment']['children']['payments-list']['children']['paypal-captcha']['children']['recaptcha']); } } return $jsLayout; } }