Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: admin user edit save #288

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/CreditCardPspField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}

Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/GatewayField.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/InstallmentsNumber.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Field/SoftDescriptor.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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;
}
Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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;
}

Expand Down
7 changes: 2 additions & 5 deletions Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -29,18 +28,16 @@ class CustomPaymentFieldset extends Fieldset
* @param Account $account
* @param string $paymentMethodName
* @param array $data
* @param SecureHtmlRenderer|null $secureRenderer
*/
public function __construct(
Context $context,
Session $authSession,
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;
}
Expand Down
6 changes: 2 additions & 4 deletions Block/Adminhtml/System/Config/Form/Field/HubIntegration.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
}

/**
Expand Down
13 changes: 8 additions & 5 deletions Concrete/Magento2PlatformCustomerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -88,7 +91,7 @@ public function getAddress()
public function getPhones()
{
$customerToArray = $this->platformCustomer->__toArray();
return $customerToArray["phones"];
return $customerToArray["phones"];
}

}
7 changes: 7 additions & 0 deletions Model/Graphql/PixDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down
Loading