diff --git a/Block/Adminhtml/Form/Field/CreditCardPspField.php b/Block/Adminhtml/Form/Field/CreditCardPspField.php index 435bed76..d4402844 100644 --- a/Block/Adminhtml/Form/Field/CreditCardPspField.php +++ b/Block/Adminhtml/Form/Field/CreditCardPspField.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -20,15 +19,13 @@ class CreditCardPspField extends Field * @param Context $context * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; } diff --git a/Block/Adminhtml/Form/Field/GatewayField.php b/Block/Adminhtml/Form/Field/GatewayField.php index fbdcb808..d8fb185d 100644 --- a/Block/Adminhtml/Form/Field/GatewayField.php +++ b/Block/Adminhtml/Form/Field/GatewayField.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class GatewayField extends Field @@ -25,16 +24,14 @@ class GatewayField extends Field * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/Form/Field/InstallmentsNumber.php b/Block/Adminhtml/Form/Field/InstallmentsNumber.php index 3a88a5f9..9fd93db0 100644 --- a/Block/Adminhtml/Form/Field/InstallmentsNumber.php +++ b/Block/Adminhtml/Form/Field/InstallmentsNumber.php @@ -6,7 +6,6 @@ use Magento\Config\Block\System\Config\Form\Field; use Magento\Config\Model\ResourceModel\Config\Data\CollectionFactory; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -22,16 +21,14 @@ class InstallmentsNumber extends Field * @param CollectionFactory $configCollectionFactory * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, CollectionFactory $configCollectionFactory, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->configCollectionFactory = $configCollectionFactory; $this->account = $account; } diff --git a/Block/Adminhtml/Form/Field/SoftDescriptor.php b/Block/Adminhtml/Form/Field/SoftDescriptor.php index cf52e3d4..aeefd603 100644 --- a/Block/Adminhtml/Form/Field/SoftDescriptor.php +++ b/Block/Adminhtml/Form/Field/SoftDescriptor.php @@ -5,7 +5,6 @@ use Magento\Backend\Block\Template\Context; use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class SoftDescriptor extends Field @@ -25,16 +24,14 @@ class SoftDescriptor extends Field * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php index 01395772..441499b5 100644 --- a/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php +++ b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Fieldset; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\View\Helper\Js; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -24,17 +23,15 @@ class CreditCardGatewayFieldset extends Fieldset * @param Js $jsHelper * @param Account $account * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, Session $authSession, Js $jsHelper, Account $account, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer); + parent::__construct($context, $authSession, $jsHelper, $data); $this->account = $account; } diff --git a/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php index c0453484..43e64d75 100644 --- a/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php +++ b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Fieldset; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\View\Helper\Js; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Pagarme\Model\Account; class CustomPaymentFieldset extends Fieldset @@ -29,7 +28,6 @@ class CustomPaymentFieldset extends Fieldset * @param Account $account * @param string $paymentMethodName * @param array $data - * @param SecureHtmlRenderer|null $secureRenderer */ public function __construct( Context $context, @@ -37,10 +35,9 @@ public function __construct( Js $jsHelper, Account $account, string $paymentMethodName = '', - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { - parent::__construct($context, $authSession, $jsHelper, $data, $secureRenderer); + parent::__construct($context, $authSession, $jsHelper, $data); $this->account = $account; $this->paymentMethodName = $paymentMethodName; } diff --git a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php index a2e0e9fc..c7fa226a 100644 --- a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php +++ b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php @@ -7,7 +7,6 @@ use Magento\Config\Block\System\Config\Form\Field; use Magento\Framework\Data\Form\Element\AbstractElement; use Magento\Framework\Phrase; -use Magento\Framework\View\Helper\SecureHtmlRenderer; use Pagarme\Core\Hub\Services\HubIntegrationService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Model\Account; @@ -22,11 +21,10 @@ class HubIntegration extends Field public function __construct( Account $account, Context $context, - array $data = [], - ?SecureHtmlRenderer $secureRenderer = null + array $data = [] ) { $this->account = $account; - parent::__construct($context, $data, $secureRenderer); + parent::__construct($context, $data); } /** diff --git a/Concrete/Magento2PlatformCustomerDecorator.php b/Concrete/Magento2PlatformCustomerDecorator.php index c2fdaa6f..11465797 100644 --- a/Concrete/Magento2PlatformCustomerDecorator.php +++ b/Concrete/Magento2PlatformCustomerDecorator.php @@ -41,10 +41,13 @@ public function getPagarmeId() return $this->pagarmeId; } - /** @var $mpIdLegado deprecated */ - $mpIdLegado = $this->platformCustomer->getCustomAttribute('customer_id_pagarme'); - if (!empty($mpIdLegado->getValue())) { - $this->pagarmeId = $mpIdLegado; + /** @var $pagarmeIdLegacy deprecated */ + $pagarmeIdLegacy = $this->platformCustomer->getCustomAttribute('customer_id_pagarme'); + $isPagarmeIdLegacyValid = !empty($pagarmeIdLegacy) + && is_object($pagarmeIdLegacy) + && !empty($pagarmeIdLegacy->getValue()); + if ($isPagarmeIdLegacyValid) { + $this->pagarmeId = $pagarmeIdLegacy; return $this->pagarmeId; } @@ -88,7 +91,7 @@ public function getAddress() public function getPhones() { $customerToArray = $this->platformCustomer->__toArray(); - return $customerToArray["phones"]; + return $customerToArray["phones"]; } } diff --git a/Model/Graphql/PixDataProvider.php b/Model/Graphql/PixDataProvider.php index b02926fe..55d87a0f 100644 --- a/Model/Graphql/PixDataProvider.php +++ b/Model/Graphql/PixDataProvider.php @@ -3,6 +3,13 @@ namespace Pagarme\Pagarme\Model\Graphql; +if (!class_exists('\Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface')) { + class PixDataProvider { + + } + return; +} + use Magento\QuoteGraphQl\Model\Cart\Payment\AdditionalDataProviderInterface; /**