diff --git a/Api/WebhookManagementInterface.php b/Api/WebhookManagementInterface.php index 21bc7cb4..423297c5 100644 --- a/Api/WebhookManagementInterface.php +++ b/Api/WebhookManagementInterface.php @@ -7,9 +7,10 @@ interface WebhookManagementInterface /** * @api * @param mixed $id + * @param mixed $account * @param mixed $type * @param mixed $data * @return boolean */ - public function save($id, $type, $data); + public function save($id, $type, $data, $account); } diff --git a/Block/Adminhtml/Form/Field/CreditCardPspField.php b/Block/Adminhtml/Form/Field/CreditCardPspField.php new file mode 100644 index 00000000..435bed76 --- /dev/null +++ b/Block/Adminhtml/Form/Field/CreditCardPspField.php @@ -0,0 +1,47 @@ +account = $account; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + if ($this->account->isGateway(PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG)) { + return ''; + } + + return parent::render($element); + } +} diff --git a/Block/Adminhtml/Form/Field/EnableAdvanceSettings.php b/Block/Adminhtml/Form/Field/EnableAdvanceSettings.php new file mode 100644 index 00000000..ea5fd2bd --- /dev/null +++ b/Block/Adminhtml/Form/Field/EnableAdvanceSettings.php @@ -0,0 +1,26 @@ +getAccountId())) { + return ''; + } + return parent::render($element); + } +} diff --git a/Block/Adminhtml/Form/Field/GatewayField.php b/Block/Adminhtml/Form/Field/GatewayField.php new file mode 100644 index 00000000..fbdcb808 --- /dev/null +++ b/Block/Adminhtml/Form/Field/GatewayField.php @@ -0,0 +1,55 @@ +account = $account; + $this->paymentMethodName = $paymentMethodName; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + if (empty($this->paymentMethodName) || !$this->account->isGateway($this->paymentMethodName)) { + return ''; + } + + return parent::render($element); + } + +} diff --git a/Block/Adminhtml/Form/Field/InstallmentsNumber.php b/Block/Adminhtml/Form/Field/InstallmentsNumber.php new file mode 100644 index 00000000..3a88a5f9 --- /dev/null +++ b/Block/Adminhtml/Form/Field/InstallmentsNumber.php @@ -0,0 +1,58 @@ +configCollectionFactory = $configCollectionFactory; + $this->account = $account; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + $isGateway = $this->account->isGateway(PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG); + if ($isGateway) { + $classes = $element->getClass(); + $classes = str_replace('number-range-1-12', '', $classes); + $classes .= ' number-range-1-24'; + $element->setClass($classes); + + $comment = $element->getComment(); + $comment = str_replace('12', '24', $comment); + $element->setComment($comment); + } + return parent::render($element); + } +} diff --git a/Block/Adminhtml/Form/Field/SoftDescriptor.php b/Block/Adminhtml/Form/Field/SoftDescriptor.php new file mode 100644 index 00000000..cf52e3d4 --- /dev/null +++ b/Block/Adminhtml/Form/Field/SoftDescriptor.php @@ -0,0 +1,64 @@ +account = $account; + $this->paymentMethodName = $paymentMethodName; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + if (empty($this->paymentMethodName)) { + return ''; + } + $isGateway = $this->account->isGateway($this->paymentMethodName); + if ($isGateway) { + $classes = $element->getClass(); + $classes = str_replace('maximum-length-13', '', $classes); + $classes .= ' maximum-length-22'; + $element->setClass($classes); + + $comment = $element->getComment(); + $comment = str_replace('13', '22', $comment); + $element->setComment($comment); + } + return parent::render($element); + } +} diff --git a/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php new file mode 100644 index 00000000..01395772 --- /dev/null +++ b/Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php @@ -0,0 +1,53 @@ +account = $account; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + if (!$this->account->isGateway(PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG)) { + return ''; + } + + return parent::render($element); + } +} diff --git a/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php new file mode 100644 index 00000000..c0453484 --- /dev/null +++ b/Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php @@ -0,0 +1,60 @@ +account = $account; + $this->paymentMethodName = $paymentMethodName; + } + + /** + * @param AbstractElement $element + * @return string + */ + public function render(AbstractElement $element) + { + if (empty($this->paymentMethodName) || $this->account->isPSP($this->paymentMethodName)) { + return ''; + } + + return parent::render($element); + } +} diff --git a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php index 977b1e73..a2e0e9fc 100644 --- a/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php +++ b/Block/Adminhtml/System/Config/Form/Field/HubIntegration.php @@ -2,17 +2,37 @@ namespace Pagarme\Pagarme\Block\Adminhtml\System\Config\Form\Field; +use Exception; +use Magento\Backend\Block\Template\Context; 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; class HubIntegration extends Field { + /** + * @var Account + */ + private $account; + + public function __construct( + Account $account, + Context $context, + array $data = [], + ?SecureHtmlRenderer $secureRenderer = null + ) { + $this->account = $account; + parent::__construct($context, $data, $secureRenderer); + } + /** * @param AbstractElement $element * @return string - * @throws \Exception + * @throws Exception */ protected function _renderValue(AbstractElement $element) { @@ -27,36 +47,52 @@ protected function _renderValue(AbstractElement $element) $html = ''; $html .= $this->_getElementHtml($element); + $html .= sprintf( - '', - $hubUrl, + '%s', $hubUrl, $buttonText ); + if ($this->account->hasMerchantAndAccountIds()) { + $dashUrl = $this->account->getDashUrl(); + $html .= sprintf( + '%s', + $dashUrl, + __('Access Pagar.me Dash') + ); + } + $html .= ''; return $html; } - private function getButtonText($installId) + /** + * @param $installId + * @return Phrase + */ + private function getButtonText($installId): Phrase { return $installId ? __("View Integration") : __("Integrate With Pagar.me"); } - private function getHubUrl($installId) + /** + * @param $installId + * @return string + */ + public function getHubUrl($installId): string { return $installId ? $this->getBaseViewIntegrationUrl($installId->getValue()) : $this->getBaseIntegrateUrl(); } - private function getBaseIntegrateUrl() + /** + * @return string + */ + private function getBaseIntegrateUrl(): string { $baseUrl = sprintf( 'https://hub.pagar.me/apps/%s/authorize', @@ -73,7 +109,11 @@ private function getBaseIntegrateUrl() return $baseUrl . $params; } - private function getBaseViewIntegrationUrl($installId) + /** + * @param $installId + * @return string + */ + private function getBaseViewIntegrationUrl($installId): string { return sprintf( 'https://hub.pagar.me/apps/%s/edit/%s', @@ -82,17 +122,26 @@ private function getBaseViewIntegrationUrl($installId) ); } + /** + * @return mixed + */ private function getPublicAppKey() { return Magento2CoreSetup::getHubAppPublicAppKey(); } - private function getRedirectUrl() + /** + * @return string + */ + private function getRedirectUrl(): string { return $this->getUrl('pagarme_pagarme/hub/index'); } - private function getInstallToken() + /** + * @return string + */ + private function getInstallToken(): string { $installSeed = uniqid(); $hubIntegrationService = new HubIntegrationService(); diff --git a/Concrete/Magento2CoreSetup.php b/Concrete/Magento2CoreSetup.php index 05c9dbe0..f44eda85 100644 --- a/Concrete/Magento2CoreSetup.php +++ b/Concrete/Magento2CoreSetup.php @@ -170,7 +170,6 @@ public function loadModuleConfigurationFromPlatform($storeConfig = null) $configErrorNotify = new ConfigNotification(); $configErrorNotify->addNotify($error); } - } /** @@ -334,7 +333,9 @@ static private function fillWithHubConfig(&$dataObj, $storeConfig) { $options = [ 'hubInstallId' => 'install_id', - 'hubEnvironment' => 'environment' + 'hubEnvironment' => 'environment', + 'merchantId' => 'merchant_id', + 'accountId' => 'account_id' ]; $section = 'pagarme_pagarme/hub/'; diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index 13ff0123..323452e1 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -49,6 +49,7 @@ use Magento\Quote\Model\Quote; use Pagarme\Pagarme\Helper\Marketplace\WebkulHelper; use Pagarme\Pagarme\Model\PagarmeConfigProvider; +use Pagarme\Pagarme\Model\Source\Bank; class Magento2PlatformOrderDecorator extends AbstractPlatformOrderDecorator { @@ -1140,6 +1141,19 @@ private function extractPaymentDataFromPagarmeBillet( $newPaymentData = new \stdClass(); $newPaymentData->amount = $this->moneyService->floatToCents($this->platformOrder->getGrandTotal()); + $moduleConfiguration = MPSetup::getModuleConfiguration(); + $newPaymentData->instructions = $moduleConfiguration->getBoletoInstructions(); + $bankConfig = new Bank(); + $bankNumber = $bankConfig->getBankNumber(MPSetup::getModuleConfiguration()->getBoletoBankCode()); + if ($bankNumber) { + $newPaymentData->bank = $bankNumber; + } + $expirationDate = new \DateTime(); + $days = MPSetup::getModuleConfiguration()->getBoletoDueDays(); + if ($days) { + $expirationDate->modify("+{$days} day"); + } + $newPaymentData->due_at = $expirationDate->format('c'); $boletoDataIndex = BoletoPayment::getBaseCode(); if (!isset($paymentData[$boletoDataIndex])) { diff --git a/Controller/Adminhtml/Hub/Index.php b/Controller/Adminhtml/Hub/Index.php index c4737e0d..4161cf3c 100644 --- a/Controller/Adminhtml/Hub/Index.php +++ b/Controller/Adminhtml/Hub/Index.php @@ -154,6 +154,19 @@ private function removeDefaultConfigKeys() 'default', 0 ); + $this->configWriter->save( + "pagarme_pagarme/hub/account_id", + null, + 'default', + 0 + ); + + $this->configWriter->save( + "pagarme_pagarme/hub/merchant_id", + null, + 'default', + 0 + ); } private function updateStoreFields($websiteId) @@ -188,6 +201,20 @@ private function updateStoreFields($websiteId) $websiteId ); + $this->configWriter->save( + "pagarme_pagarme/hub/account_id", + $currentConfiguration->getAccountId()->getValue(), + 'websites', + $websiteId + ); + + $this->configWriter->save( + "pagarme_pagarme/hub/merchant_id", + $currentConfiguration->getMerchantId()->getValue(), + 'websites', + $websiteId + ); + $this->configWriter->save( "pagarme_pagarme/global/test_mode", 0, diff --git a/Gateway/Transaction/Base/Config/Config.php b/Gateway/Transaction/Base/Config/Config.php index 4891e4d8..949abfb0 100755 --- a/Gateway/Transaction/Base/Config/Config.php +++ b/Gateway/Transaction/Base/Config/Config.php @@ -12,7 +12,6 @@ namespace Pagarme\Pagarme\Gateway\Transaction\Base\Config; - class Config extends AbstractConfig implements ConfigInterface { /** @@ -22,7 +21,7 @@ public function isEnabled() { return $this->getConfig(static::PATH_ENABLED); } - + /** * @return string */ @@ -84,18 +83,6 @@ public function getTestMode() return $this->getConfig(static::PATH_TEST_MODE); } - /** - * {@inheritdoc} - */ - public function getBaseUrl() - { - if ($this->getConfig(static::PATH_TEST_MODE)) { - return $this->getConfig(static::PATH_SAND_BOX_URL); - } - - return $this->getConfig(static::PATH_PRODUCTION_URL); - } - /** * @return string */ @@ -147,11 +134,9 @@ public function isSendEmail() */ public function getPagarmeCustomerConfigs() { - $customerConfigs = [ + return [ 'showVatNumber' => $this->getConfig(static::PATH_CUSTOMER_VAT_NUMBER) ?? '', 'streetLinesNumber' => $this->getConfig(static::PATH_CUSTOMER_ADDRESS_LINES) ?? '', ]; - - return $customerConfigs; } } diff --git a/Gateway/Transaction/Base/Config/ConfigInterface.php b/Gateway/Transaction/Base/Config/ConfigInterface.php index 2686b29e..c2319c23 100755 --- a/Gateway/Transaction/Base/Config/ConfigInterface.php +++ b/Gateway/Transaction/Base/Config/ConfigInterface.php @@ -15,22 +15,37 @@ interface ConfigInterface { - const PATH_ENABLED = 'pagarme_pagarme/global/active'; - const PATH_PUBLIC_KEY_TEST = 'pagarme_pagarme/global/public_key_test'; - const PATH_SECRET_KEY_TEST = 'pagarme_pagarme/global/secret_key_test'; - const PATH_PUBLIC_KEY = 'pagarme_pagarme/global/public_key'; - const PATH_SECRET_KEY = 'pagarme_pagarme/global/secret_key'; - const PATH_HUB_INSTALL_ID = 'pagarme_pagarme/hub/install_id'; - const PATH_HUB_ENVIRONMENT = 'pagarme_pagarme/hub/environment'; - const PATH_TEST_MODE = 'pagarme_pagarme/global/test_mode'; - const PATH_SEND_EMAIL = 'pagarme_pagarme/global/sendmail'; - const PATH_CUSTOMER_STREET = 'payment/pagarme_customer_address/street_attribute'; - const PATH_CUSTOMER_NUMBER = 'payment/pagarme_customer_address/number_attribute'; - const PATH_CUSTOMER_COMPLEMENT = 'payment/pagarme_customer_address/complement_attribute'; - const PATH_CUSTOMER_DISTRICT = 'payment/pagarme_customer_address/district_attribute'; - const PATH_CUSTOMER_VAT_NUMBER = 'customer/create_account/vat_frontend_visibility'; + const PATH_ENABLED = 'pagarme_pagarme/global/active'; + + const PATH_PUBLIC_KEY_TEST = 'pagarme_pagarme/global/public_key_test'; + + const PATH_SECRET_KEY_TEST = 'pagarme_pagarme/global/secret_key_test'; + + const PATH_PUBLIC_KEY = 'pagarme_pagarme/global/public_key'; + + const PATH_SECRET_KEY = 'pagarme_pagarme/global/secret_key'; + + const PATH_HUB_INSTALL_ID = 'pagarme_pagarme/hub/install_id'; + + const PATH_HUB_ENVIRONMENT = 'pagarme_pagarme/hub/environment'; + + const PATH_TEST_MODE = 'pagarme_pagarme/global/test_mode'; + + const PATH_SEND_EMAIL = 'pagarme_pagarme/global/sendmail'; + + const PATH_CUSTOMER_STREET = 'payment/pagarme_customer_address/street_attribute'; + + const PATH_CUSTOMER_NUMBER = 'payment/pagarme_customer_address/number_attribute'; + + const PATH_CUSTOMER_COMPLEMENT = 'payment/pagarme_customer_address/complement_attribute'; + + const PATH_CUSTOMER_DISTRICT = 'payment/pagarme_customer_address/district_attribute'; + + const PATH_CUSTOMER_VAT_NUMBER = 'customer/create_account/vat_frontend_visibility'; + const PATH_CUSTOMER_ADDRESS_LINES = 'customer/address/street_lines'; - const HUB_SANDBOX_ENVIRONMENT = 'Sandbox'; + + const HUB_SANDBOX_ENVIRONMENT = 'Sandbox'; /** * @return bool @@ -62,10 +77,6 @@ public function isHubEnabled(); */ public function getTestMode(); - /** - * @return string - */ - public function getBaseUrl(); /** * @return string diff --git a/Model/Account.php b/Model/Account.php new file mode 100644 index 00000000..f0950ce3 --- /dev/null +++ b/Model/Account.php @@ -0,0 +1,381 @@ +configWriter = $configWriter; + $this->storeManager = $storeManager; + $this->accountService = $accountService; + $this->hubCommand = $hubCommand; + $this->configCollectionFactory = $configCollectionFactory; + $this->logger = $logger; + $this->session = $session; + $this->pagarmeConfigProvider = $pagarmeConfigProvider; + } + + /** + * @param mixed $website + * @return void + */ + public function validateDashSettings($website) + { + $this->session->setWebsiteId($website); + $this->initializeConfig($website); + if ( + empty($this->config->getHubInstallId()) + || empty($this->getAccountId()) + ) { + return; + } + + try { + $account = $this->accountService->getAccountWithValidation($this->getAccountId(), $website); + $this->configWriter->save( + PagarmeConfigProvider::PATH_DASH_ERRORS, + json_encode($account->getErrors()), + ScopeInterface::SCOPE_WEBSITES, + $website + ); + $this->savePaymentTypes($account, $website); + } catch (Exception $e) { + if ($e->getMessage() === 'Invalid API key') { + $this->hubCommand->uninstallCommand(); + } + $this->logger->error(__('Failed to get account information: %1', $e->getMessage())); + } + } + + /** + * @param mixed $account + * @return void + * @throws NoSuchEntityException + */ + public function saveAccountIdFromWebhook($account) + { + if ($this->getAccountId() || empty($account) || empty($account['id'])) { + return; + } + + $this->configWriter->save( + PagarmeConfigProvider::PATH_ACCOUNT_ID, + $account['id'], + ScopeInterface::SCOPE_WEBSITES, + $this->storeManager->getStore() + ->getWebsiteId() + ); + } + + /** + * @return array + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function getDashSettingsErrors() + { + $this->initializeConfig(); + $collection = $this->configCollectionFactory->create(); + $collection->addFieldToFilter('path', ['eq' => PagarmeConfigProvider::PATH_DASH_ERRORS]); + $collection->addFieldToFilter('scope', ['eq' => ScopeInterface::SCOPE_WEBSITES]); + $collection->addFieldToFilter('scope_id', ['eq' => $this->session->getWebsiteId()]); + + if ($collection->count() === 0) { + return []; + } + + $errorsList = $collection->getFirstItem()->getData()['value'] ?? ''; + $returnData = json_decode($errorsList); + if (empty($returnData)) { + return []; + } + + return $returnData; + } + + /** + * @param string $paymentName + * @param bool $gateway + * @return bool + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function getPaymentType(string $paymentName, bool $gateway = true) + { + $this->initializeConfig(); + $paymentType = $gateway + ? PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE + : PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE; + $collection = $this->configCollectionFactory->create(); + $collection->addFieldToFilter('path', ['eq' => sprintf($paymentType, $paymentName)]); + $collection->addFieldToFilter('scope', ['eq' => ScopeInterface::SCOPE_WEBSITES]); + $collection->addFieldToFilter('scope_id', ['eq' => $this->session->getWebsiteId()]); + + if ($collection->count() === 0) { + return false; + } + + return (bool)$collection->getFirstItem()->getData()['value']; + } + + /** + * @return string|null + */ + public function getAccountId() + { + $this->initializeConfig(); + return $this->config->getAccountId() ?? null; + } + + /** + * @return string|null + */ + public function getMerchantId() + { + return $this->config->getMerchantId() ?? null; + } + + /** + * @return bool + */ + public function hasMerchantAndAccountIds() + { + return $this->getAccountId() && $this->getMerchantId(); + } + + /** + * @return mixed + */ + public function getDashUrl() + { + if (!$this->hasMerchantAndAccountIds()) { + return null; + } + return sprintf( + 'https://dash.pagar.me/%s/%s/', + $this->getMerchantId(), + $this->getAccountId() + ); + } + + /** + * @param string $paymentName + * @return bool + * @throws LocalizedException + * @throws NoSuchEntityException + */ + public function isGateway(string $paymentName) + { + $this->initializeConfig(); + + return (empty($this->getAccountId()) && $this->pagarmeConfigProvider->isGatewayIntegrationType()) + || $this->getPaymentType($paymentName); + } + + /** + * @param string $paymentName + * @return bool + */ + public function isPSP(string $paymentName) + { + return !empty($this->getAccountId()) && $this->getPaymentType($paymentName, false); + } + + /** + * @return void + */ + public function clearWebsiteId() + { + $this->session->setWebsiteId(null); + } + + /** + * @param mixed $website + * @return void + * @throws NoSuchEntityException + * @throws LocalizedException + */ + private function initializeConfig($website = null) + { + if (empty($this->config)) { + $websiteId = $website; + if (!$websiteId && $this->session->getWebsiteId()) { + $websiteId = $this->session->getWebsiteId(); + } + + if (!$websiteId) { + $websiteId = $this->storeManager->getStore() + ->getWebsiteId(); + } + + $storeId = $this->storeManager->getWebsite($websiteId) + ->getDefaultStore()->getId(); + $this->storeManager->setCurrentStore($storeId); + Magento2CoreSetup::bootstrap(); + $this->config = Magento2CoreSetup::getModuleConfiguration(); + } + } + + /** + * @param AccountMiddle $account + * @param mixed $website + * @return void + */ + private function savePaymentTypes(AccountMiddle $account, $website) + { + $this->saveConfig( + sprintf( + PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE, + PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG + ), + (int)$account->getCreditCardSettings()->isGateway(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE, PagarmeConfigProvider::PIX_PAYMENT_CONFIG), + (int)$account->getPixSettings()->isGateway(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE, PagarmeConfigProvider::VOUCHER_PAYMENT_CONFIG), + (int)$account->getVoucherSettings()->isGateway(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE, PagarmeConfigProvider::BILLET_PAYMENT_CONFIG), + (int)$account->getBilletSettings()->isGateway(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_GATEWAY_TYPE, PagarmeConfigProvider::DEBIT_PAYMENT_CONFIG), + (int)$account->getDebitCardSettings()->isGateway(), + $website + ); + + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE, PagarmeConfigProvider::CREDIT_CARD_PAYMENT_CONFIG), + (int)$account->getCreditCardSettings()->isPSP(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE, PagarmeConfigProvider::PIX_PAYMENT_CONFIG), + (int)$account->getPixSettings()->isPSP(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE, PagarmeConfigProvider::VOUCHER_PAYMENT_CONFIG), + (int)$account->getVoucherSettings()->isPSP(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE, PagarmeConfigProvider::BILLET_PAYMENT_CONFIG), + (int)$account->getBilletSettings()->isPSP(), + $website + ); + $this->saveConfig( + sprintf(PagarmeConfigProvider::PATH_IS_PAYMENT_PSP_TYPE, PagarmeConfigProvider::DEBIT_PAYMENT_CONFIG), + (int)$account->getDebitCardSettings()->isPSP(), + $website + ); + } + + /** + * @param mixed $path + * @param mixed $value + * @param mixed $website + * @return void + */ + private function saveConfig($path, $value, $website) + { + $this->configWriter->save( + $path, + $value, + ScopeInterface::SCOPE_WEBSITES, + $website + ); + } +} diff --git a/Model/Api/HubCommand.php b/Model/Api/HubCommand.php index cc4e7028..4fdceddb 100644 --- a/Model/Api/HubCommand.php +++ b/Model/Api/HubCommand.php @@ -89,6 +89,9 @@ public function execute() public function uninstallCommand() { + if (!$this->websiteId) { + $this->websiteId = 1; + } $this->configWriter->save( "pagarme_pagarme/hub/install_id", null, @@ -131,6 +134,27 @@ public function uninstallCommand() $this->websiteId ); + $this->configWriter->save( + "pagarme_pagarme/hub/account_id", + null, + 'websites', + $this->websiteId + ); + + $this->configWriter->save( + "pagarme_pagarme/hub/merchant_id", + null, + 'websites', + $this->websiteId + ); + + $this->configWriter->save( + "pagarme_pagarme/hub/account_errors", + null, + 'websites', + $this->websiteId + ); + $this->cacheManager->clean(['config']); return "Hub uninstalled successfully"; diff --git a/Model/CoreAuth.php b/Model/CoreAuth.php new file mode 100644 index 00000000..b8223e00 --- /dev/null +++ b/Model/CoreAuth.php @@ -0,0 +1,17 @@ +get(\Pagarme\Pagarme\Gateway\Transaction\Base\Config\Config::class); + return $config->getSecretKey(); + } +} diff --git a/Model/Notifications.php b/Model/Notifications.php index 49972ca5..9680ae10 100644 --- a/Model/Notifications.php +++ b/Model/Notifications.php @@ -11,10 +11,17 @@ use Magento\AdminNotification\Model\System\Message; use Magento\Framework\Data\Collection\AbstractDb; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\Model\Context; use Magento\Framework\Model\ResourceModel\AbstractResource; use Magento\Framework\Registry; +use Pagarme\Core\Middle\Model\Account as CoreAccount; +use Pagarme\Core\Middle\Model\Account\PaymentMethodSettings; +use Magento\Framework\UrlInterface; +use Pagarme\Pagarme\Block\Adminhtml\System\Config\Form\Field\HubIntegration; +use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\ConfigInterface; +use Pagarme\Pagarme\Model\Account; /** * class Notifications @@ -22,29 +29,57 @@ */ class Notifications extends Message { + const PAYMENT_DISABLED_MESSAGE = '%1$s payment method is enabled on your store, ' + . 'but disabled on Pagar.me Dash. Please, access the %2$s and enable it to be able to ' + . 'process %1$s payment on your store.'; - /** @var array */ + /** + * @var array + */ private $warnings = []; + /** + * @var ConfigInterface + */ private $config; + /** + * @var Account + */ + private $account; + /** + * @var HubIntegration + */ + private $hubIntegration; + /** + * @var UrlInterface + */ + private $urlInterface; /** * @param ConfigInterface $config * @param Context $context * @param Registry $registry + * @param Account $account + * @param HubIntegration $hubIntegration * @param AbstractResource|null $resource * @param AbstractDb|null $resourceCollection * @param array $data */ public function __construct( - ConfigInterface $config, - Context $context, - Registry $registry, - AbstractResource $resource = null, - AbstractDb $resourceCollection = null, - array $data = [] + ConfigInterface $config, + Context $context, + Registry $registry, + Account $account, + HubIntegration $hubIntegration, + UrlInterface $urlInterface, + AbstractResource $resource = null, + AbstractDb $resourceCollection = null, + array $data = [] ) { parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->config = $config; + $this->account = $account; + $this->hubIntegration = $hubIntegration; + $this->urlInterface = $urlInterface; $this->addMessages(); } @@ -61,12 +96,16 @@ public function getSeverity(): int */ public function getText(): ?string { - $html = null; - $count = count($this->warnings); + if (empty($this->warnings)) { + return null; + } - for ($i = 0; $i < $count; $i++) { - $html .= '
' . (($i === 0) ? " Pagar.me " : '') . "" . __('Important!') . " " . $this->warnings[$i] . '
'; + $html = '

Pagar.me

'; + foreach ($this->warnings as $warning) { + $html .= "
{$warning}
"; } + $html .= '
'; + return $html; } @@ -82,33 +121,199 @@ public function isDisplayed(): bool return count($this->warnings) > 0; } + /** + * @return void + * @throws NoSuchEntityException + */ private function addMessages() { $this->addEnvorimentMessages(); $this->addConfigMessages(); + $this->addDashSettingsMessages(); } + /** + * @return void + */ private function addEnvorimentMessages() { if (!$this->config->isHubEnabled()) { - $this->warnings[] = __('Pagar.me module is not yet integrated to the HUB. Complete the integration to start selling!'); + $this->warnings[] = __( + 'Pagar.me module is not yet integrated to the HUB. Complete the integration to start selling!' + ); } if ($this->config->isSandboxMode()) { - $this->warnings[] = __('This store is linked to the Pagar.me test environment. This environment is intended for integration validation and does not generate real financial transactions.'); + $this->warnings[] = __( + 'This store is linked to the Pagar.me test environment. This environment is intended for integration' + . ' validation and does not generate real financial transactions.' + ); } } + /** + * @return void + */ private function addConfigMessages() { $customerConfigs = $this->config->getPagarmeCustomerConfigs(); + $customerUrl = $this->urlInterface->getUrl('adminhtml/system_config/edit/section/customer'); if ($customerConfigs['showVatNumber'] != 1) { - $this->warnings[] = __("Show VAT Number on Storefront must be defined as 'Yes' on Stores > Configuration > Customer > Customer Configuration > Create New Account Options for Pagar.me module to work on your store."); + $this->warnings[] = sprintf( + __( + 'Show VAT Number on Storefront must be defined as "Yes" on Stores > ' + . 'Configuration > Customers > %sCustomer Configuration%s > ' + . 'Create New Account Options for Pagar.me module to work on your store.' + ), + "", + '' + ); } if ($customerConfigs['streetLinesNumber'] != 4) { - $this->warnings[] = __("Number of Lines in a Street Address must be defined as '4' on Stores > Configuration > Customer > Customer Configuration > Name and Address Options for Pagar.me module to work on your store."); + $this->warnings[] = sprintf( + __( + 'Number of Lines in a Street Address must be defined as "4" on ' + . 'Stores > Configuration > Customers > %sCustomer Configuration%s > ' + . 'Name and Address options for Pagar.me module to work on your store.' + ), + "", + '' + ); } } + + /** + * @return void + * @throws NoSuchEntityException + */ + private function addDashSettingsMessages() + { + $dashSettings = $this->account->getDashSettingsErrors(); + + if (empty($dashSettings)) { + return; + } + + $linkLabel = __('Dash configurations'); + $linkAccount = 'account-config'; + $linkOrder = 'order-config'; + $linkPayment = 'payment-methods'; + + $noticesList = [ + CoreAccount::ACCOUNT_DISABLED => __('Your account is disabled on Pagar.me Dash. ' + . 'Please, contact our support team to enable it.'), + CoreAccount::DOMAIN_EMPTY => sprintf( + __('No domain registered on Pagar.me Dash. Please enter your website\'s domain on the %s ' + . 'to be able to process payment in your store.'), + $this->buildDashLink($linkLabel, $linkAccount) + ), + CoreAccount::DOMAIN_INCORRECT => sprintf( + __('The registered domain is different from the URL of your website. Please correct the ' + . 'domain configured on the %s to be able to process payment in your store.'), + $this->buildDashLink($linkLabel, $linkAccount), + ), + CoreAccount::WEBHOOK_INCORRECT => sprintf( + __('The URL for receiving webhooks registered in Pagar.me Dash is different from the URL of ' + . 'your website. Please, %s to access the Hub and click the Delete > Confirm ' + . 'button. Then return to your store and integrate again.'), + $this->buildHubLink(__('click here')) + ), + CoreAccount::MULTIPAYMENTS_DISABLED => sprintf( + __('Multipayment option is disabled on Pagar.me Dash. Please, access the %s ' + . 'and enable it to be able to process payment in your store.'), + $this->buildDashLink($linkLabel, $linkOrder) + ), + CoreAccount::MULTIBUYERS_DISABLED => sprintf( + __('Multibuyers option is disabled on Pagar.me Dash. Please, access the %s ' + . 'and enable it to be able to process payment in your store.'), + $this->buildDashLink($linkLabel, $linkOrder) + ), + PaymentMethodSettings::PIX_DISABLED => sprintf( + __(self::PAYMENT_DISABLED_MESSAGE), + 'Pix', + $this->buildDashLink($linkLabel, $linkPayment) + ), + PaymentMethodSettings::CREDITCARD_DISABLED => sprintf( + __(self::PAYMENT_DISABLED_MESSAGE), + __('Credit Card'), + $this->buildDashLink($linkLabel, $linkPayment) + ), + PaymentMethodSettings::BILLET_DISABLED => sprintf( + __(self::PAYMENT_DISABLED_MESSAGE), + __('Billet'), + $this->buildDashLink($linkLabel, $linkPayment) + ), + PaymentMethodSettings::VOUCHER_DISABLED => sprintf( + __(self::PAYMENT_DISABLED_MESSAGE), + 'Voucher', + $this->buildDashLink($linkLabel, $linkPayment) + ), + PaymentMethodSettings::DEBITCARD_DISABLED => sprintf( + __(self::PAYMENT_DISABLED_MESSAGE), + __('Debit Card'), + $this->buildDashLink($linkLabel, $linkPayment) + ) + ]; + + foreach ($dashSettings as $error) { + $this->warnings[] = $noticesList[$error]; + } + + $this->addVerifyDashButton(); + } + + /** + * @param string $label + * @param string $dashPage + * @return string + */ + private function buildDashLink(string $label, string $dashPage = '') + { + if (!$this->account->hasMerchantAndAccountIds()) { + return $label; + } + + $dashSettings = !empty($dashPage) ? "settings/{$dashPage}/" : ''; + $url = $this->account->getDashUrl() . $dashSettings; + + return sprintf( + '%s', + $url, + $label + ); + } + + /** + * @param string $label + * @return string + */ + private function buildHubLink(string $label) + { + $installId = Magento2CoreSetup::getModuleConfiguration()->getHubInstallId(); + $hubUrl = $this->hubIntegration->getHubUrl($installId); + + return sprintf( + '%s', + $hubUrl, + $label + ); + } + + /** + * @return array + */ + private function addVerifyDashButton() + { + $paymentUrl = $this->urlInterface->getUrl('adminhtml/system_config/edit/section/payment'); + return $this->warnings[] = sprintf( + __( + 'Access %sPayment Methods%s configurations page to clear messages for errors already corrected in ' + . 'the Pagar.me Dash.' + ), + "", + '' + ); + } } diff --git a/Model/PagarmeConfigProvider.php b/Model/PagarmeConfigProvider.php index 7fba0886..2917e363 100644 --- a/Model/PagarmeConfigProvider.php +++ b/Model/PagarmeConfigProvider.php @@ -5,7 +5,10 @@ use Magento\Checkout\Model\ConfigProviderInterface; use Magento\Framework\App\Config\ConfigResource\ConfigInterface; use Magento\Framework\App\Config\ScopeConfigInterface; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Store\Model\ScopeInterface; +use Magento\Store\Model\StoreManagerInterface; +use Pagarme\Core\Middle\Model\Account\PaymentEnum; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\ConfigInterface as PagarmeConfigInterface; /** @@ -33,6 +36,37 @@ class PagarmeConfigProvider implements ConfigProviderInterface const PATH_CUSTOMER_NUMBER = 'payment/pagarme_customer_address/number_attribute'; const PATH_CUSTOMER_COMPLEMENT = 'payment/pagarme_customer_address/complement_attribute'; const PATH_CUSTOMER_DISTRICT = 'payment/pagarme_customer_address/district_attribute'; + const PATH_ACCOUNT_ID = 'pagarme_pagarme/hub/account_id'; + + const PATH_PIX_ENABLED = 'payment/pagarme_pix/active'; + + const PATH_CREDIT_CARD_ENABLED = 'payment/pagarme_creditcard/active'; + + const PATH_BILLET_AND_CREDIT_CARD_ENABLED = 'payment/pagarme_multipleactionscreditcardbillet/active'; + + const PATH_TWO_CREDIT_CARD_ENABLED = 'payment/pagarme_multipleactionstwocreditcard/active'; + + const PATH_BILLET_ENABLED = 'payment/pagarme_billet/active'; + + const PATH_VOUCHER_ENABLED = 'payment/pagarme_voucher/active'; + + const PATH_DEBIT_ENABLED = 'payment/pagarme_debit/active'; + + const PATH_IS_PAYMENT_GATEWAY_TYPE = 'pagarme_pagarme/%s/is_payment_gateway'; + + const PATH_IS_PAYMENT_PSP_TYPE = 'pagarme_pagarme/%s/is_payment_psp'; + + const BILLET_PAYMENT_CONFIG = 'pagarme_billet'; + + const CREDIT_CARD_PAYMENT_CONFIG = 'pagarme_creditcard'; + + const DEBIT_PAYMENT_CONFIG = 'pagarme_debit'; + + const PIX_PAYMENT_CONFIG = 'pagarme_pix'; + + const VOUCHER_PAYMENT_CONFIG = 'pagarme_voucher'; + + const PATH_DASH_ERRORS = 'pagarme_pagarme/hub/account_errors'; /** * Contains scope config of Magento @@ -49,7 +83,12 @@ class PagarmeConfigProvider implements ConfigProviderInterface protected $config; /** @var PagarmeConfigInterface */ - private $pagarmeConfig; + protected $pagarmeConfig; + + /** + * @var StoreManagerInterface + */ + protected $storeManager; /** * @param PagarmeConfigInterface $pagarmeConfig @@ -59,11 +98,13 @@ class PagarmeConfigProvider implements ConfigProviderInterface public function __construct( PagarmeConfigInterface $pagarmeConfig, ScopeConfigInterface $scopeConfig, - ConfigInterface $config + ConfigInterface $config, + StoreManagerInterface $storeManager ) { $this->scopeConfig = $scopeConfig; $this->config = $config; $this->pagarmeConfig = $pagarmeConfig; + $this->storeManager = $storeManager; } /** @@ -91,7 +132,7 @@ public function isGatewayIntegrationType() { return $this->scopeConfig->getValue( self::XML_PATH_IS_GATEWAY_INTEGRATION_TYPE, - ScopeInterface::SCOPE_STORE + ScopeInterface::SCOPE_WEBSITES ); } @@ -231,56 +272,136 @@ public function isModuleOrRecurrenceDisabled() || !$this->isRecurrenceEnabled(); } - public function disableVoucher() + /** + * @return string + */ + public function getAccountId($website = null) { - $this->config->saveConfig( - self::XML_PATH_VOUCHER_ACTIVE, - 0, - 'default', - 0 + return $this->scopeConfig->getValue( + self::PATH_ACCOUNT_ID, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) ); } - public function disableDebit() + /** + * @return bool + */ + public function isPixEnabled($website = null) { - $this->config->saveConfig( - self::XML_PATH_DEBIT_ACTIVE, - 0, - 'default', - 0 + return (bool) $this->scopeConfig->getValue( + self::PATH_PIX_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) ); } - public function disableRecurrence() + /** + * @return bool + */ + public function isCreditCardEnabled($website = null) { - $this->config->saveConfig( - self::XML_PATH_RECURRENCE_ACTIVE, - 0, - 'default', - 0 + return (bool) $this->scopeConfig->getValue( + self::PATH_CREDIT_CARD_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) + ); + } + + /** + * @return bool + */ + public function isBilletAndCreditCardEnabled($website = null) + { + return (bool) $this->scopeConfig->getValue( + self::PATH_BILLET_AND_CREDIT_CARD_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) + ); + } + + /** + * @return bool + */ + public function isTwoCreditCardEnabled($website = null) + { + return (bool) $this->scopeConfig->getValue( + self::PATH_TWO_CREDIT_CARD_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) ); } - public function disableAntifraud() + /** + * @return bool + */ + public function isAnyCreditCardMethodEnabled($website = null) { - $this->config->saveConfig( - self::XML_PATH_ANTIFRAUD_ACTIVE, - 0, - 'default', - 0 + return $this->isCreditCardEnabled($website) + || $this->isBilletAndCreditCardEnabled($website) + || $this->isTwoCreditCardEnabled($website); + } + + /** + * @return bool + */ + public function isBilletEnabled($website = null) + { + return (bool) $this->scopeConfig->getValue( + self::PATH_BILLET_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) ); } - public function disableSavedCard() + /** + * @return bool + */ + public function isAnyBilletMethodEnabled($website = null) + { + return $this->isBilletEnabled($website) + || $this->isBilletAndCreditCardEnabled($website); + } + + /** + * @return bool + */ + public function isVoucherEnabled($website = null) { - $this->config->saveConfig( - self::XML_PATH_IS_ENABLE_SAVED_CARDS, - 0, - 'default', - 0 + return (bool) $this->scopeConfig->getValue( + self::PATH_VOUCHER_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $this->getWebsiteId($website) ); } + /** + * @return bool + */ + public function isDebitEnabled($website = null) + { + return (bool) $this->scopeConfig->getValue( + self::PATH_DEBIT_ENABLED, + ScopeInterface::SCOPE_WEBSITES, + $website + ); + } + + /** + * @param mixed $website + * @return array + */ + public function availablePaymentMethods($website = null) + { + return [ + PaymentEnum::PIX => $this->isPixEnabled($website), + PaymentEnum::DEBIT_CARD => $this->isDebitEnabled($website), + PaymentEnum::BILLET => $this->isAnyBilletMethodEnabled($website), + PaymentEnum::CREDIT_CARD => $this->isAnyCreditCardMethodEnabled($website), + PaymentEnum::VOUCHER => $this->isVoucherEnabled($website) + ]; + } + /** * @return array */ @@ -292,4 +413,14 @@ public function getConfig(): array 'pagarme_customer_configs' => $this->pagarmeConfig->getPagarmeCustomerConfigs(), ] ; } + + /** + * @param mixed $websiteId + * @return int|mixed + * @throws NoSuchEntityException + */ + private function getWebsiteId($websiteId = null) + { + return $websiteId ?? $this->storeManager->getStore()->getWebsiteId(); + } } diff --git a/Model/Source/PixTypes.php b/Model/Source/PixTypes.php deleted file mode 100644 index 7866ee8f..00000000 --- a/Model/Source/PixTypes.php +++ /dev/null @@ -1,26 +0,0 @@ - 'pagarme', - 'label' => __('Pagar.me'), - ] - ]; - } -} diff --git a/Model/WebhookManagement.php b/Model/WebhookManagement.php index b2f8b670..a1edf9cb 100644 --- a/Model/WebhookManagement.php +++ b/Model/WebhookManagement.php @@ -12,25 +12,37 @@ use Pagarme\Core\Webhook\Services\WebhookReceiverService; use Pagarme\Pagarme\Api\WebhookManagementInterface; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; +use Pagarme\Pagarme\Model\Account; class WebhookManagement implements WebhookManagementInterface { - protected OrderFactory $orderFactory; + /** + * @var OrderFactory + */ + protected $orderFactory; + + /** + * @var Account + */ + protected $account; public function __construct( - OrderFactory $orderFactory + OrderFactory $orderFactory, + Account $account ) { $this->orderFactory = $orderFactory; + $this->account = $account; } /** * @api * @param mixed $id + * @param mixed $account * @param mixed $type * @param mixed $data * @return array|bool */ - public function save($id, $type, $data) + public function save($id, $type, $data, $account) { try { Magento2CoreSetup::bootstrap(); @@ -48,18 +60,17 @@ public function save($id, $type, $data) ]; } + if ($type === 'charge.paid') { + $this->account->saveAccountIdFromWebhook($account); + } + $webhookReceiverService = new WebhookReceiverService(); return $webhookReceiverService->handle($postData); - } catch (WebhookHandlerNotFoundException $e) { + } catch (WebhookHandlerNotFoundException | WebhookAlreadyHandledException $e) { return [ "message" => $e->getMessage(), "code" => 200 ]; - } catch (WebhookAlreadyHandledException $e) { - return [ - "message" => $e->getMessage(), - "code" => 200 - ]; } catch(AbstractPagarmeCoreException $e) { throw new M2WebApiException( new Phrase($e->getMessage()), diff --git a/Observer/DashConfigValidatorObserver.php b/Observer/DashConfigValidatorObserver.php new file mode 100644 index 00000000..f33b2c1f --- /dev/null +++ b/Observer/DashConfigValidatorObserver.php @@ -0,0 +1,54 @@ +account = $account; + $this->storeManager = $storeManager; + } + + /** + * @param Observer $observer + * @return $this + * @throws NoSuchEntityException + */ + public function execute(Observer $observer) + { + $section = $observer->getRequest() + ->getParam('section'); + if ($section !== 'payment') { + return $this; + } + + $website = $observer->getRequest() + ->getParam('website', $this->storeManager->getStore()->getWebsiteId()); + + $this->account->validateDashSettings($website); + return $this; + } +} diff --git a/Observer/DataValidateAdmin.php b/Observer/DataValidateAdmin.php index d1e92197..d839d709 100644 --- a/Observer/DataValidateAdmin.php +++ b/Observer/DataValidateAdmin.php @@ -1,13 +1,8 @@ storeManager = $storeManager; $this->messageManager = $messageManager; $this->urlBuilder = $urlBuilder; $this->responseFactory = $responseFactory; $this->cacheTypeList = $cacheTypeList; $this->cacheFrontendPool = $cacheFrontendPool; $this->configProviderPagarme = $configProviderPagarme; + $this->account = $account; } /** @@ -89,17 +84,7 @@ public function execute(\Magento\Framework\Event\Observer $observer) } $this->validateConfigMagento(); - - if (!$this->isGatewayIntegrationType()) { - $this->configProviderPagarme->disableVoucher(); - $this->configProviderPagarme->disableDebit(); - $this->configProviderPagarme->disableRecurrence(); - $this->configProviderPagarme->disableSavedCard(); - $this->configProviderPagarme->disableAntifraud(); - - ObjectManager::getInstance()->get(Cache::class) - ->clean(Config::CACHE_TAG); - } + $this->account->clearWebsiteId(); return $this; } @@ -136,15 +121,10 @@ public function moduleIsEnable() return $this->configProviderPagarme->getModuleStatus(); } - public function isGatewayIntegrationType() - { - return $this->configProviderPagarme->isGatewayIntegrationType(); - } - protected function validateConfigMagento() { $disableModule = false; - $disableMessage; + $disableMessage = []; $url = $this->urlBuilder->getUrl('adminhtml/system_config/edit/section/payment'); if (!$this->configProviderPagarme->validateMaxInstallment()) { diff --git a/Service/AccountService.php b/Service/AccountService.php new file mode 100644 index 00000000..a2ffa1c9 --- /dev/null +++ b/Service/AccountService.php @@ -0,0 +1,93 @@ +coreAuth = new CoreAuth(); + $this->storeManager = $storeManager; + $this->config = $config; + $this->configProvider = $configProvider; + } + + /** + * @param mixed $accountId + * @param mixed $website + * @return Account + * @throws NoSuchEntityException + * @throws LocalizedException + */ + public function getAccountWithValidation($accountId, $website) + { + $storeSettings = new StoreSettings(); + $storeSettings->setSandbox($this->config->isSandboxMode()); + $stores = $this->storeManager->getWebsite($website) + ->getStores(); + $storeSettings->setStoreUrls( + array_map([$this, 'mapBaseUrlFromStore'], $stores) + ); + $storeSettings->setEnabledPaymentMethods($this->configProvider->availablePaymentMethods($website)); + + $accountResponse = $this->getAccountOnPagarme($accountId); + + $account = Account::createFromSdk($accountResponse); + return $account->validate($storeSettings); + } + + /** + * @param mixed $accountId + * @return GetAccountResponse + */ + private function getAccountOnPagarme($accountId) + { + $accountService = new AccountProxy($this->coreAuth); + return $accountService->getAccount($accountId); + } + + /** + * @param StoreInterface $store + * @return string + */ + private function mapBaseUrlFromStore($store) + { + return $store->getBaseUrl(); + } +} diff --git a/composer.json b/composer.json index 338db8fd..8f5f2c30 100755 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.5", + "version": "2.3.0", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", "require": { "php": ">=7.1", - "pagarme/ecommerce-module-core": "2.2.*" + "pagarme/ecommerce-module-core": "2.3.*" }, "require-dev": { "phpunit/phpunit": "4.1.0", diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index d2a45e36..223503e2 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -48,4 +48,42 @@ + + + + pagarme_billet + + + + + pagarme_creditcard + + + + + + pagarme_creditcard + + + + + pagarme_debit + + + + + pagarme_voucher + + + + + + pagarme_debit + + + + + pagarme_voucher + + diff --git a/etc/adminhtml/system/global.xml b/etc/adminhtml/system/global.xml index 79df5fbf..f2f6b03c 100644 --- a/etc/adminhtml/system/global.xml +++ b/etc/adminhtml/system/global.xml @@ -4,6 +4,7 @@ + Pagarme\Pagarme\Block\Adminhtml\System\Config\Form\Field\HubIntegration @@ -32,6 +33,7 @@ Warning! Configurations that only work for Gateway customers, who have a direct contract with an acquirer.

]]>
Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/global/is_gateway_integration_type + Pagarme\Pagarme\Block\Adminhtml\Form\Field\EnableAdvanceSettings
diff --git a/etc/adminhtml/system/recurrence.xml b/etc/adminhtml/system/recurrence.xml index c6ef5c2e..fe8cf91b 100644 --- a/etc/adminhtml/system/recurrence.xml +++ b/etc/adminhtml/system/recurrence.xml @@ -84,8 +84,5 @@ 1 - - 1 -
diff --git a/etc/adminhtml/system/transaction/billet.xml b/etc/adminhtml/system/transaction/billet.xml index d82eb5f3..63b22fb2 100644 --- a/etc/adminhtml/system/transaction/billet.xml +++ b/etc/adminhtml/system/transaction/billet.xml @@ -18,6 +18,9 @@ payment/pagarme_billet/title required-entry + + 1 + @@ -32,10 +35,11 @@ Pagarme\Pagarme\Model\Source\BilletTypes payment/pagarme_billet/types + Pagarme\Pagarme\Block\Adminhtml\Form\Field\BilletGatewayField 1 - 1 + required-entry @@ -58,6 +62,9 @@ payment/pagarme_billet/sort_order + + 1 + diff --git a/etc/adminhtml/system/transaction/creditcard.xml b/etc/adminhtml/system/transaction/creditcard.xml index d42588bc..9471620b 100644 --- a/etc/adminhtml/system/transaction/creditcard.xml +++ b/etc/adminhtml/system/transaction/creditcard.xml @@ -18,22 +18,36 @@ payment/pagarme_creditcard/title required-entry + + 1 + Max size: . /

]]>
payment/pagarme_creditcard/soft_description + validate-length maximum-length-13 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\CreditCardSoftDescriptor + + 1 +
Pagarme\Pagarme\Model\Source\PaymentAction payment/pagarme_creditcard/payment_action + + 1 + payment/pagarme_creditcard/sort_order + + 1 + @@ -41,7 +55,7 @@ Magento\Config\Model\Config\Source\Yesno payment/pagarme_creditcard/enabled_saved_cards - 1 + 1 @@ -50,8 +64,9 @@ Pagarme\Pagarme\Model\Source\Cctype payment/pagarme_creditcard/cctypes validate-select + Pagarme\Pagarme\Block\Adminhtml\Form\Field\CreditCardGatewayField - 1 + 1 @@ -60,8 +75,9 @@ Pagarme\Pagarme\Model\Source\CctypePSP payment/pagarme_creditcard/cctypes validate-select + Pagarme\Pagarme\Block\Adminhtml\Form\Field\CreditCardPspField - 0 + 1 diff --git a/etc/adminhtml/system/transaction/creditcard/antifraud.xml b/etc/adminhtml/system/transaction/creditcard/antifraud.xml index ee153fad..6ccf4060 100644 --- a/etc/adminhtml/system/transaction/creditcard/antifraud.xml +++ b/etc/adminhtml/system/transaction/creditcard/antifraud.xml @@ -8,6 +8,7 @@ + Pagarme\Pagarme\Block\Adminhtml\Form\Fieldset\CreditCardGatewayFieldset @@ -25,7 +26,7 @@ - 1 + 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments.xml b/etc/adminhtml/system/transaction/creditcard/installments.xml index 85bc8c98..b9f4eb4d 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments.xml @@ -25,9 +25,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 1 @@ -84,6 +85,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 1 @@ -102,5 +104,8 @@ + + 1 + diff --git a/etc/adminhtml/system/transaction/creditcard/installments/amex.xml b/etc/adminhtml/system/transaction/creditcard/installments/amex.xml index 1d0b71b6..abc7052d 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/amex.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/amex.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_amex required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_amex required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/aura.xml b/etc/adminhtml/system/transaction/creditcard/installments/aura.xml index 6e6801b2..847d49c2 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/aura.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/aura.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_aura required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_aura required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/banese.xml b/etc/adminhtml/system/transaction/creditcard/installments/banese.xml index d8cfcd9f..b1c320c4 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/banese.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/banese.xml @@ -19,6 +19,7 @@ Insert a number between 1 and 24.

]]>
payment/pagarme_creditcard/installments_number_banese required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -59,6 +60,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_banese required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/cabal.xml b/etc/adminhtml/system/transaction/creditcard/installments/cabal.xml index 896e1722..676baacc 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/cabal.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/cabal.xml @@ -19,6 +19,7 @@ Insert a number between 1 and 24.

]]>
payment/pagarme_creditcard/installments_number_cabal required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -59,6 +60,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_cabal required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/credz.xml b/etc/adminhtml/system/transaction/creditcard/installments/credz.xml index ade8d964..2b71bf47 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/credz.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/credz.xml @@ -19,6 +19,7 @@ Insert a number between 1 and 24.

]]>
payment/pagarme_creditcard/installments_number_credz required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -59,6 +60,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_credz required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/diners.xml b/etc/adminhtml/system/transaction/creditcard/installments/diners.xml index fa50a86b..0484266e 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/diners.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/diners.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_diners required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_diners required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/discover.xml b/etc/adminhtml/system/transaction/creditcard/installments/discover.xml index 56885e03..0354a61b 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/discover.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/discover.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_discover required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
Pagarme\Pagarme\Model\Validation\GenericValidation @@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_discover required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/elo.xml b/etc/adminhtml/system/transaction/creditcard/installments/elo.xml index e24c3495..bf419cb6 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/elo.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/elo.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_elo required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_elo required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/hipercard.xml b/etc/adminhtml/system/transaction/creditcard/installments/hipercard.xml index f880245c..a1c27f50 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/hipercard.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/hipercard.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_hipercard required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_hipercard required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/jcb.xml b/etc/adminhtml/system/transaction/creditcard/installments/jcb.xml index bcdaeb76..c589dc64 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/jcb.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/jcb.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_jcb required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_jcb required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/mastercard.xml b/etc/adminhtml/system/transaction/creditcard/installments/mastercard.xml index dc381409..a341bd90 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/mastercard.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/mastercard.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_mastercard required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_mastercard required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/creditcard/installments/visa.xml b/etc/adminhtml/system/transaction/creditcard/installments/visa.xml index 5d57a9b4..a14a6094 100644 --- a/etc/adminhtml/system/transaction/creditcard/installments/visa.xml +++ b/etc/adminhtml/system/transaction/creditcard/installments/visa.xml @@ -15,9 +15,10 @@ Pagarme\Pagarme\Model\Validation\GenericValidation - Insert a number between 1 and .

]]>
+ Insert a number between 1 and 12.

]]>
payment/pagarme_creditcard/installments_number_visa required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber
@@ -58,6 +59,7 @@ Insert a number between 1 and the Max number of installments.

]]>
payment/pagarme_creditcard/installments_max_without_interest_visa required-entry validate-number-range number-range-1-12 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\InstallmentsNumber 1 diff --git a/etc/adminhtml/system/transaction/debit.xml b/etc/adminhtml/system/transaction/debit.xml index bcfb62c9..d75b6fe4 100644 --- a/etc/adminhtml/system/transaction/debit.xml +++ b/etc/adminhtml/system/transaction/debit.xml @@ -8,6 +8,7 @@ + Pagarme\Pagarme\Block\Adminhtml\Form\Fieldset\DebitCardFieldset @@ -18,22 +19,36 @@ payment/pagarme_debit/title required-entry + + 1 + payment/pagarme_debit/soft_description - Max size: 22. / 22

]]>
+ Max size: . /

]]>
+ validate-length maximum-length-13 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\DebitCardSoftDescriptor + + 1 +
payment/pagarme_debit/sort_order + + 1 + Magento\Config\Model\Config\Source\Yesno payment/pagarme_debit/enabled_saved_cards + + 1 + @@ -41,10 +56,9 @@ Pagarme\Pagarme\Model\Source\Debittype payment/pagarme_debit/cctypes validate-select + + 1 + - - - 1 -
diff --git a/etc/adminhtml/system/transaction/multipleactionscreditcardbillet.xml b/etc/adminhtml/system/transaction/multipleactionscreditcardbillet.xml index 1cfbf53a..84775552 100644 --- a/etc/adminhtml/system/transaction/multipleactionscreditcardbillet.xml +++ b/etc/adminhtml/system/transaction/multipleactionscreditcardbillet.xml @@ -18,11 +18,17 @@ payment/pagarme_billet_creditcard/title required-entry + + 1 +
payment/pagarme_billet_creditcard/sort_order + + 1 +
diff --git a/etc/adminhtml/system/transaction/multipleactionstwocreditcard.xml b/etc/adminhtml/system/transaction/multipleactionstwocreditcard.xml index 67764c1b..760ab2bc 100644 --- a/etc/adminhtml/system/transaction/multipleactionstwocreditcard.xml +++ b/etc/adminhtml/system/transaction/multipleactionstwocreditcard.xml @@ -18,11 +18,17 @@ payment/pagarme_two_creditcard/title required-entry + + 1 +
payment/pagarme_two_creditcard/sort_order + + 1 + diff --git a/etc/adminhtml/system/transaction/pix.xml b/etc/adminhtml/system/transaction/pix.xml index bcd641c9..eb3a08eb 100644 --- a/etc/adminhtml/system/transaction/pix.xml +++ b/etc/adminhtml/system/transaction/pix.xml @@ -18,6 +18,9 @@ payment/pagarme_pix/title required-entry + + 1 + @@ -28,20 +31,13 @@ 1 - - - - Pagarme\Pagarme\Model\Source\PixTypes - payment/pagarme_pix/types - - 1 - 1 - - payment/pagarme_pix/sort_order + + 1 + diff --git a/etc/adminhtml/system/transaction/voucher.xml b/etc/adminhtml/system/transaction/voucher.xml index 827fa5d6..04c146ff 100644 --- a/etc/adminhtml/system/transaction/voucher.xml +++ b/etc/adminhtml/system/transaction/voucher.xml @@ -8,6 +8,7 @@ + Pagarme\Pagarme\Block\Adminhtml\Form\Fieldset\VoucherFieldset @@ -18,22 +19,36 @@ payment/pagarme_voucher/title required-entry + + 1 + payment/pagarme_voucher/soft_description - Max size: 22. / 22

]]>
+ Max size: . /

]]>
+ validate-length maximum-length-13 + Pagarme\Pagarme\Block\Adminhtml\Form\Field\VoucherSoftDescriptor + + 1 +
payment/pagarme_voucher/sort_order + + 1 + Magento\Config\Model\Config\Source\Yesno payment/pagarme_voucher/enabled_saved_cards + + 1 + @@ -41,10 +56,9 @@ Pagarme\Pagarme\Model\Source\Vouchertype payment/pagarme_voucher/cctypes validate-select + + 1 + - - - 1 -
diff --git a/etc/db_schema.xml b/etc/db_schema.xml index 40393d5d..bd27c3f8 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -58,9 +58,9 @@ - - - + + + diff --git a/etc/events.xml b/etc/events.xml index 91cc58e3..159c8a46 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -65,4 +65,8 @@ + + + + diff --git a/etc/module.xml b/etc/module.xml index 8d4024ec..b8794923 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -9,7 +9,7 @@ */ --> - + diff --git a/i18n/en_US.csv b/i18n/en_US.csv index a31f36a3..62e5620e 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -1,338 +1 @@ -"Print Billet","Print Billet" -"without interest","without interest" -"with interest","with interest" -"Authorize Only","Authorize Only" -"Authorize and Capture","Authorize and Capture" -"On Success","On Success" -"Always","Always" -"Analyse First","Analyse First" -"Authorize First","Authorize First" -"Configure","Configure" -"Close","Close" -"Place Order","Place Order" -"Credit Card Information","Credit Card Information" -"Credit Card Number","Credit Card Number" -"Name on Card","Name on Card" -"Expiration Date", "Expiration Date" -"Invalid Expiration Date","Invalida Expiration Date" -"Card Verification Number","Card Verification Number" -"What is this?","What is this?" -"Installments","Installments" -"Address","Address" -"Number Attribute","Number Attribute" -"Complement Attribute","Complement Attribute" -"Pagar.me AntiFraud","Pagar.me AntiFraud" -"General","General" -"Enabled","Enabled" -"Installments Sodexo Premium","Installments Sodexo Premium" -"Number Sodexo Premium","Number Sodexo Premium" -"Min Amount Sodexo Premium","Min Amount Sodexo Premium" -"Interest by issuer Sodexo Premium","Interest by issuer Sodexo Premium" -"Interest Rate Initial (%) Sodexo Premium","Interest Rate Initial (%) Sodexo Premium" -"Interest Rate Incremental (%) Sodexo Premium","Interest Rate Incremental (%) Sodexo Premium" -"Max Without Interest Sodexo Premium","Max Without Interest Sodexo Premium" -"Installments VR","Installments VR" -"Number VR","Number VR" -"Min Amount VR","Min Amount VR" -"Interest by issuer VR","Interest by issuer VR" -"Interest Rate Initial (%) VR","Interest Rate Initial (%) VR" -"Interest Rate Incremental (%) VR","Interest Rate Incremental (%) VR" -"Max Without Interest VR","Max Without Interest VR" -"Installments Diners","Installments Diners" -"Number Diners","Number Diners" -"Min Amount Diners","Min Amount Diners" -"Interest by issuer Diners","Interest by issuer Diners" -"Interest Rate Initial (%) Diners","Interest Rate Initial (%) Diners" -"Interest Rate Incremental (%) Diners","Interest Rate Incremental (%) Diners" -"Max Without Interest Diners","Max Without Interest Diners" -"Installments Elo","Installments Elo" -"Number Elo","Number Elo" -"Min Amount Elo","Min Amount Elo" -"Interest by issuer Elo","Interest by issuer Elo" -"Interest Rate Initial (%) Elo","Interest Rate Initial (%) Elo" -"Interest Rate Incremental (%) Elo","Interest Rate Incremental (%) Elo" -"Max Without Interest Elo","Max Without Interest Elo" -"Installments JCB","Installments JCB" -"Number JCB","Number JCB" -"Min Amount JCB","Min Amount JCB" -"Interest by issuer JCB","Interest by issuer JCB" -"Interest Rate Initial (%) JCB","Interest Rate Initial (%) JCB" -"Interest Rate Incremental (%) JCB","Interest Rate Incremental (%) JCB" -"Max Without Interest JCB","Max Without Interest JCB" -"Installments Amex","Installments Amex" -"Number Amex","Number Amex" -"Min Amount Amex","Min Amount Amex" -"Interest by issuer Amex","Interest by issuer Amex" -"Interest Rate Initial (%) Amex","Interest Rate Initial (%) Amex" -"Interest Rate Incremental (%) Amex","Interest Rate Incremental (%) Amex" -"Max Without Interest Amex","Max Without Interest Amex" -"Installments Aura","Installments Aura" -"Number Aura","Number Aura" -"Min Amount Aura","Min Amount Aura" -"Interest by issuer Aura","Interest by issuer Aura" -"Interest Rate Initial (%) Aura","Interest Rate Initial (%) Aura" -"Interest Rate Incremental (%) Aura","Interest Rate Incremental (%) Aura" -"Max Without Interest Aura","Max Without Interest Aura" -"Installments Visa","Installments Visa" -"Number Visa","Number Visa" -"Min Amount Visa","Min Amount Visa" -"Interest by issuer Visa","Interest by issuer Visa" -"Interest Rate Initial (%) Visa","Interest Rate Initial (%) Visa" -"Interest Rate Incremental (%) Visa","Interest Rate Incremental (%) Visa" -"Max Without Interest Visa","Max Without Interest Visa" -"Installments Alelo","Installments Alelo" -"Number Alelo","Number Alelo" -"Min Amount Alelo","Min Amount Alelo" -"Interest by issuer Alelo","Interest by issuer Alelo" -"Interest Rate Initial (%) Alelo","Interest Rate Initial (%) Alelo" -"Interest Rate Incremental (%) Alelo","Interest Rate Incremental (%) Alelo" -"Max Without Interest Alelo","Max Without Interest Alelo" -"Installments Cabal","Installments Cabal" -"Number Cabal","Number Cabal" -"Min Amount Cabal","Min Amount Cabal" -"Interest by issuer Cabal","Interest by issuer Cabal" -"Interest Rate Initial (%) Cabal","Interest Rate Initial (%) Cabal" -"Interest Rate Incremental (%) Cabal","Interest Rate Incremental (%) Cabal" -"Max Without Interest Cabal","Max Without Interest Cabal" -"Installments Credz","Installments Credz" -"Number Credz","Number Credz" -"Min Amount Credz","Min Amount Credz" -"Interest by issuer Credz","Interest by issuer Credz" -"Interest Rate Initial (%) Credz","Interest Rate Initial (%) Credz" -"Interest Rate Incremental (%) Credz","Interest Rate Incremental (%) Credz" -"Max Without Interest Credz","Max Without Interest Credz" -"Installments Banese","Installments Banese" -"Number Banese","Number Banese" -"Min Amount Banese","Min Amount Banese" -"Interest by issuer Banese","Interest by issuer Banese" -"Interest Rate Initial (%) Banese","Interest Rate Initial (%) Banese" -"Interest Rate Incremental (%) Banese","Interest Rate Incremental (%) Banese" -"Max Without Interest Banese","Max Without Interest Banese" -"Installments Discover","Installments Discover" -"Number Discover","Number Discover" -"Min Amount Discover","Min Amount Discover" -"Interest by issuer Discover","Interest by issuer Discover" -"Interest Rate Initial (%) Discover","Interest Rate Initial (%) Discover" -"Interest Rate Incremental (%) Discover","Interest Rate Incremental (%) Discover" -"Max Without Interest Discover","Max Without Interest Discover" -"Installments Hipercard","Installments Hipercard" -"Number Hipercard","Number Hipercard" -"Min Amount Hipercard","Min Amount Hipercard" -"Interest by issuer Hipercard","Interest by issuer Hipercard" -"Interest Rate Initial (%) Hipercard","Interest Rate Initial (%) Hipercard" -"Interest Rate Incremental (%) Hipercard","Interest Rate Incremental (%) Hipercard" -"Max Without Interest Hipercard","Max Without Interest Hipercard" -"Installments Mastercard","Installments Mastercard" -"Number Mastercard","Number Mastercard" -"Min Amount Mastercard","Min Amount Mastercard" -"Interest by issuer Mastercard","Interest by issuer Mastercard" -"Interest Rate Initial (%) Mastercard","Interest Rate Initial (%) Mastercard" -"Interest Rate Incremental (%) Mastercard","Interest Rate Incremental (%) Mastercard" -"Max Without Interest Mastercard","Max Without Interest Mastercard" -"Installments Sodexo Gift","Installments Sodexo Gift" -"Number Sodexo Gift","Number Sodexo Gift" -"Min Amount Sodexo Gift","Min Amount Sodexo Gift" -"Interest by issuer Sodexo Gift","Interest by issuer Sodexo Gift" -"Interest Rate Initial (%) Sodexo Gift","Interest Rate Initial (%) Sodexo Gift" -"Interest Rate Incremental (%) Sodexo Gift","Interest Rate Incremental (%) Sodexo Gift" -"Max Without Interest Sodexo Gift","Max Without Interest Sodexo Gift" -"Installments Sodexo Combustivel","Installments Sodexo Combustivel" -"Number Sodexo Combustivel","Number Sodexo Combustivel" -"Min Amount Sodexo Combustivel","Min Amount Sodexo Combustivel" -"Interest by issuer Sodexo Combustivel","Interest by issuer Sodexo Combustivel" -"Interest Rate Initial (%) Sodexo Combustivel","Interest Rate Initial (%) Sodexo Combustivel" -"Interest Rate Incremental (%) Sodexo Combustivel","Interest Rate Incremental (%) Sodexo Combustivel" -"Max Without Interest Sodexo Combustivel","Max Without Interest Sodexo Combustivel" -"Pagar.me Pagar.me","Pagar.me Pagar.me" -"Payment Solutions.","Payment Solutions." -"Global Settings","Global Settings" -"Customer Config","Customer Config" -"Pagar.me Transaction","Pagar.me Transaction" -"Street Attibute","Street Attibute" -"District Attribute","District Attribute" -"Credit Card","Credit Card" -"Billet","Billet" -"Multiple Actions Two Credit Card","Multiple Actions Two Credit Card" -"Title","Title" -"New Order Status","New Order Status" -"Reject Order Status","Reject Order Status" -"Review Order Status","Review Order Status" -"Sort Order","Sort Order" -"Multiple Actions Credit Card and Billet","Multiple Actions Credit Card and Billet" -"Payment from Applicable Countries","Payment from Applicable Countries" -"Payment from Specific Countries","Payment from Specific Countries" -"Make Check Payable to","Make Check Payable to" -"Send Check to","Send Check to" -"Minimum Order Total","Minimum Order Total" -"Maximum Order Total","Maximum Order Total" -"Payment Action","Payment Action" -"Transaction Key\","Transaction Key\" -"Test Mode","Test Mode" -"Gateway URL","Gateway URL" -"Transaction Details URL","Transaction Details URL" -"Accepted Currency","Accepted Currency" -"Debug","Debug" -"Merchant's Email","Merchant's Email" -"Active","Active" -"Type","Type" -"Types","Types" -"Expirations Day","Expirations Day" -"Instructions","Instructions" -"Text to Checkout","Text to Checkout" -"Pagar.me Credit Card","Pagar.me Credit Card" -"Pagar.me Billet","Pagar.me Billet" -"Pagar.me Pix","Pagar.me Pix" -"Pagar.me Voucher","Pagar.me Voucher" -"Pagar.me Debit Card","Pagar.me Debit Card" -"Credit Card Number","Credit Card Number" -"Name on Card","Name on Card" -"Expiration Date","Expiration Date" -"Card Verification Number","Card Verification Number" -"Installments","Installments" -"My billing and shipping address are the same","My billing and shipping address are the same" -"Payment Method","Payment Method" -"Month","Month" -"Year","Year" -"Apply Discount Code","Apply Discount Code" -"Enter discount code","Enter discount code" -"Apply Discount","Apply Discount" -"Shipping Methods","Shipping Methods" -"Shipping","Shipping" -"Flat Rate","Flat Rate" -"Fixed","Fixed" -"New Address","New Address" -"Shipping Address","Shipping Address" -"Order Summary","Order Summary" -"Items in Cart","Items in Cart" -"View Details","View Details" -"Size","Size" -"Color","Color" -"Next","Next" -"Review & Payments","Review & Payments" -"Ship To:","Ship To:" -"Shipping Method:","Shipping Method:" -"Cart Subtotal","Cart Subtotal" -"Flat Rate - Fixed","Flat Rate - Fixed" -"Order Total","Order Total" -"Your order number is: %s","Your order number is: %s" -"Your order number is: ","Your order number is: " -"We'll email you an order confirmation with details and tracking info.","We'll email you an order confirmation with details and tracking info." -"Continue Shopping","Continue Shopping" -"Type installments Unique","Type installments Unique" -"Number","Number" -"Min Amount","Min Amount" -"Interest by issuer","Interest by issuer" -"Interest Rate Initial (%)","Interest Rate Initial (%)" -"Interest Rate Incremental (%)","Interest Rate Incremental (%)" -"Max Without Interest","Max Without Interest" -"Customer Identity (CPF/CNPJ) Attribute","Customer Identity (CPF/CNPJ) Attribute" -"Installments Sodexo Alimentacao","Installments Sodexo Alimentacao" -"Number Sodexo Alimentacao","Number Sodexo Alimentacao" -"Min Amount Sodexo Alimentacao","Min Amount Sodexo Alimentacao" -"Interest by issuer Sodexo Alimentacao","Interest by issuer Sodexo Alimentacao" -"Interest Rate Initial (%) Sodexo Alimentacao","Interest Rate Initial (%) Sodexo Alimentacao" -"Interest Rate Incremental (%) Sodexo Alimentacao","Interest Rate Incremental (%) Sodexo Alimentacao" -"Max Without Interest Sodexo Alimentacao","Max Without Interest Sodexo Alimentacao" -"Installments Sodexo Refeição","Installments Sodexo Refeição" -"Number Sodexo Refeição","Number Sodexo Refeição" -"Min Amount Sodexo Refeição","Min Amount Sodexo Refeição" -"Interest by issuer Sodexo Refeição","Interest by issuer Sodexo Refeição" -"Interest Rate Initial (%) Sodexo Refeição","Interest Rate Initial (%) Sodexo Refeição" -"Interest Rate Incremental (%) Sodexo Refeição","Interest Rate Incremental (%) Sodexo Refeição" -"Max Without Interest Sodexo Refeição","Max Without Interest Sodexo Refeição" -"Anti fraud","Anti fraud" -"Yes","Yes" -"No","No" -"Pending","Pending" -"Pending Payment","Pending Payment" -"-- Please Select --","-- Please Select --" -"Installments Sodexo Cultura","Installments Sodexo Cultura" -"Number Sodexo Cultura","Number Sodexo Cultura" -"Min Amount Sodexo Cultura","Min Amount Sodexo Cultura" -"Interest by issuer Sodexo Cultura","Interest by issuer Sodexo Cultura" -"Interest Rate Initial (%) Sodexo Cultura","Interest Rate Initial (%) Sodexo Cultura" -"Interest Rate Incremental (%) Sodexo Cultura","Interest Rate Incremental (%) Sodexo Cultura" -"Max Without Interest Sodexo Cultura","Max Without Interest Sodexo Cultura" -"Brand","Brand" -"Shipping & Handling","Shipping & Handling" -"Grand Total","Grand Total" -"Subtotal","Subtotal" -"Product Name","Product Name" -"Price","Price" -"Qty","Qty" -"Billing Address","Billing Address" -"Order Information","Order Information" -"Processing","Processing" -"Print Order","Print Order" -"Reorder","Reorder" -"Ordered","Ordered" -"Order","Order" -"Order #","Order #" -"Order #%1","Order #%1" -"Order #%order_id","Order #%order_id" -"Items Ordered","Items Ordered" -"Send order status changes by e-mail", "Send order status changes by e-mail" -"Send an e-mail every time when an order status is changed by a Pagar.me's webhook.

Warning! Make sure you have set up your mail server correctly before enable it, otherwise you will run the risk of slowdowns and crashes of your platform.

", "Send an e-mail every time when an order status is changed by a Pagar.me's webhook.

Warning! Make sure you have set up your mail server correctly before enable it, otherwise you will run the risk of slowdowns and crashes of your platform.

" -"Our Number", "Our Number" -"NSU from capture", "NSU from capture" -"Document Number", "Document Number" -"Card Number", "Card Number" -"Module Version", "Module Version" -"No brands available", "No brands available" -"Create Magento's order even with failed payments", "Create Magento's order even with failed payments" -"Payment action", "Payment action" -"Sandbox Mode Active", "Sandbox Mode Active" -"Always creates order", "Always creates order" -"

Warning! Configurations that only work for Gateway customers, who have a direct contract with an acquirer.

", "

Warning! Configurations that only work for Gateway customers, who have a direct contract with an acquirer.

" -"Enable Advanced Settings", "Enable Advanced Settings" -"

Warning! Don't forget to add your store's domain on Pagar.me dashboard

", "

Warning! Don't forget to add your store's domain on Pagar.me dashboard

" -"View Integration", "View Integration" -"Integrate With Pagar.me", "Integrate With Pagar.me" -"Important! This store is linked to the Pagar.me test environment. This environment is intended for integration validation and does not generate real financial transactions.","Important! This store is linked to the Pagar.me test environment. This environment is intended for integration validation and does not generate real financial transactions." -"Important! This store is in the testing phase. Orders placed in this environment will not be carried out.","Important! This store is in the testing phase. Orders placed in this environment will not be carried out." "Please enter a valid $ amount. For example $100.00.", "Please enter a valid $ amount. For example: 1000.00" -"This order does not belong to this user","This order does not belong to this user" -"Do you want to capture this charge?","Do you want to capture this charge?" -"Do you want to cancel this charge?","Do you want to cancel this charge?" -"Charges","Charges" -"Charge ID","Charge ID" -"Paid Amount","Paid Amount" -"Canceled Amount","Canceled Amount" -"Refunded Amount","Refunded Amount" -"Capture","Capture" -"Cancel","Cancel", -"Failed to copy! Please, manually copy the code using the field bellow the button.","Failed to copy! Please, manually copy the code using the field bellow the button." -"PIX code copied!","PIX code copied!" -"Copy PIX code","Copy PIX code" -"Open your bank app","Open your bank app" -"Scan the QR Code","Scan the QR Code" -"Confirm the payment","Confirm the payment" -"View Billet","View Billet" -"Error updating cycles options for product with id %s. Error message: %s","Error updating cycles options for product with id %s. Error message: %s" -"Subscription product with id %s not founded","Subscription product with id %s not founded" -"Brands","Brands" -"Select a brand","Select a brand" -"Please, select a brand","Please, select a brand" -"Please, enter valid Credit Card Number","Please, enter valid Credit Card Number" -"Please, enter valid Name on Card","Please, enter valid Name on Card" -"Please, enter valid Expiration Date","Please, enter valid Expiration Date" -"The cvv field must be a minimum length of 3 and a maximum length of 4.","The cvv field must be a minimum length of 3 and a maximum length of 4." -"Error in trying to create a plan type product","Error in trying to create a plan type product" -"Please add subproducts before saving the plan","Please add subproducts before saving the plan" -"Plan product not found","Plan product not found" -"List of plan products not found","List of plan products not found" -"Plan Product saved","Plan Product saved" -"Subscription Product not found","Subscription Product not found" -"Subscription Products not found","Subscription Products not found" -"Error saving the subscription product","Error saving the subscription product" -"Subscription product saved","Subscription product saved" -"No product founded with name: %1","No product founded with name: %1" -"Bundle product not selected","Bundle product not selected" -"Select at last one payment method","Select at last one payment method" -"Fill at last one cycle option","Fill at last one cycle option" -"It was not possible to find the subproducts for this bundle. Check your configuration and try again","It was not possible to find the subproducts for this bundle. Check your configuration and try again" -"Cart Discount","Cart Discount" -"Apply cart discount to all subscription charges","Apply cart discount to all subscription charges" -"For plans, when enabling this options, the discount will be applied to all charges, even when the products have different cycles.","For plans, when enabling this options, the discount will be applied to all charges, even when the products have different cycles." -"For plans, when enabling this options, the shipping will be applied to all charges, even when the products have different cycles.","For plans, when enabling this options, the shipping will be applied to all charges, even when the products have different cycles." -"For plans, when enabling this options, the taxes will be applied to all charges, even when the products have different cycles.","For plans, when enabling this options, the taxes will be applied to all charges, even when the products have different cycles." diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 6cadb357..5f7f288c 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -8,6 +8,7 @@ "Subscriptions","Assinaturas" "Pagar.me  Payment Solutions.","Pagar.me  Soluções de Pagamento." "General Settings","Configurações Gerais" +"Pagar.me integration","Integração Pagar.me" "Integration Environment","Ambiente de Integração" "Enable this Solution","Habilitar esta Solução" "Enable Multi Buyer","Habilitar Multicompradores" @@ -403,8 +404,8 @@ "Integrate With Pagar.me", "Integrar com Pagar.me" "Important!","Importante!" "This store is linked to the Pagar.me test environment. This environment is intended for integration validation and does not generate real financial transactions.","Esta loja está vinculada ao ambiente de testes da Pagar.me. Este ambiente é destinado a validação de integração e não gera operações financeiras reais." -"Show VAT Number on Storefront must be defined as 'Yes' on Stores > Configuration > Customer > Customer Configuration > Create New Account Options for Pagar.me module to work on your store.","Mostrar Número VAT na Vitrine deve ser definido como 'Sim' em Cliente > Configurações de cliente > Criar Novas Opções de Conta para que o módulo da Pagar.me funcione na sua loja." -"Number of Lines in a Street Address must be defined as '4' on Stores > Configuration > Customer > Customer Configuration > Name and Address Options for Pagar.me module to work on your store.","Numero de Linhas em Endereço deve ser definido como '4' em Cliente > Configurações de cliente > Opções de Nome e Endereço para que o módulo da Pagar.me funcione na sua loja." +"Show VAT Number on Storefront must be defined as "Yes" on Stores > Configuration > Customers > %sCustomer Configuration%s > Create New Account Options for Pagar.me module to work on your store.","Mostrar Número VAT na Vitrine deve ser definido como "Sim" em Lojas > Configuração > Clientes > %sConfigurações de cliente%s > Criar Novas Opções de Conta para que o módulo da Pagar.me funcione na sua loja." +"Number of Lines in a Street Address must be defined as "4" on Stores > Configuration > Customers > %sCustomer Configuration%s > Name and Address options for Pagar.me module to work on your store.","Numero de Linhas em Endereço deve ser definido como "4" em Lojas > Configuração > Clientes > %sConfigurações de cliente%s > Opções de Nome e Endereço para que o módulo da Pagar.me funcione na sua loja." "Important! This store is not yet integrated to Pagar.me HUB. Orders placed now will not be carried out.","Importante! Esta loja ainda não está integrada ao HUB da Pagar.me. Pedidos efetuados agora não serão concluídos." "Important! This store is in the testing phase. Orders placed in this environment will not be carried out.","Importante! Esta loja está em fase de testes. Os pedidos realizados neste ambiente não serão concluídos." "Important! There are configurations that need to be fixed. If you are an administrator, check the admin for more details. This order will not be carried out!","Importante! Há configurações que precisam ser ajustadas. Se você é um administrador, verifique o admin para mais detalhes. Este pedido não será concluído!" @@ -518,3 +519,15 @@ "For plans, when enabling this options, the discount will be applied to all charges, even when the products have different cycles.","Para planos, ao habilitar esta opção, o desconto será aplicado em todas as cobranças, mesmo quando os produtos tiverem ciclos diferentes." "For plans, when enabling this options, the shipping will be applied to all charges, even when the products have different cycles.","Para planos, ao habilitar esta opção, o frete será aplicado em todas as cobranças, mesmo quando os produtos tiverem ciclos diferentes." "For plans, when enabling this options, the taxes will be applied to all charges, even when the products have different cycles.","Para planos, ao habilitar esta opção, as taxas serão aplicadas sobre todas as cobranças, mesmo quando os produtos tiverem ciclos diferentes." +"Dash configurations","configurações da Dash" +"Your account is disabled on Pagar.me Dash. Please, contact our support team to enable it.","Sua conta está desativada na Dash da Pagar.me. Por favor, entre em contato com o nosso time de atendimento para habilitá-la." +"No domain registered on Pagar.me Dash. Please enter your website's domain on the %s to be able to process payment in your store.","Nenhum domínio cadastrado na Dash da Pagar.me. Por favor, insira o domínio do seu site nas %s para poder processar o pagamento em sua loja." +"The registered domain is different from the URL of your website. Please correct the domain configured on the %s to be able to process payment in your store.","O domínio cadastrado é diferente da URL do seu site. Por favor, corrija o domínio configurado nas %s para poder processar o pagamento em sua loja." +"The URL for receiving webhooks registered in Pagar.me Dash is different from the URL of your website. Please, %s to access the Hub and click the Delete > Confirm button. Then return to your store and integrate again.","A URL de recebimento de webhooks cadastrado na Dash da Pagar.me é diferente da URL do seu site. Por favor, %s para acessar o Hub e clique no botão Excluir > Confirmar. Depois retorne à sua loja e integre novamente." +"click here","clique aqui" +"Multipayment option is disabled on Pagar.me Dash. Please, access the %s and enable it to be able to process payment in your store.","A opção Multimeio de pagamentos está desabilitada na Dash da Pagar.me. Por favor, acesse as %s e habilite para poder processar o pagamento em sua loja." +"Multibuyers option is disabled on Pagar.me Dash. Please, access the %s and enable it to be able to process payment in your store.","A opção Multicompradores está desabilitada na Dash da Pagar.me. Por favor, acesse as %s e habilite para poder processar o pagamento em sua loja." +"%1$s payment method is enabled on your store, but disabled on Pagar.me Dash. Please, access the %2$s and enable it to be able to process %1$s payment on your store.","A forma de pagamento %1$s está habilitada na sua loja, mas desabilitada na Dash da Pagar.me. Por favor, acesse as %2$s e habilite para poder processar o pagamento via %1$s na sua loja." +"%sClick here%s to verify Pagar.me Dash Configurations after you correct then.","%sClique aqui%s para verificar as configurações da Dash do Pagar.me após corrigi-las." +"Access %sPayment Methods%s configurations page to clear messages for errors already corrected in the Pagar.me Dash.","Acesse a página de configurações %sMétodos de Pagamento%s para limpar as mensagens dos erros já corrigidos na Dash do Pagar.me." +"Failed to get account information: %1","Falha ao pegar informações da conta: %1" diff --git a/view/adminhtml/layout/adminhtml_system_config_edit.xml b/view/adminhtml/layout/adminhtml_system_config_edit.xml index 429d3a2b..998a8f56 100644 --- a/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -3,10 +3,9 @@ - + - diff --git a/view/adminhtml/layout/default.xml b/view/adminhtml/layout/default.xml index 8e6e17dd..1194df79 100644 --- a/view/adminhtml/layout/default.xml +++ b/view/adminhtml/layout/default.xml @@ -2,5 +2,6 @@ + - \ No newline at end of file + diff --git a/view/adminhtml/web/css/hub_button.css b/view/adminhtml/web/css/hub_button.css deleted file mode 100644 index ddeafaba..00000000 --- a/view/adminhtml/web/css/hub_button.css +++ /dev/null @@ -1,32 +0,0 @@ -#botao-hub span { - background-color: #65a300; - border-color: rgb(101, 163, 0); - border-radius: 4px; - border-style: solid; - border-width: 2px; - cursor: pointer; - letter-spacing: .04em; - display: inline-block; - font-size: 14px; - font-weight: 600; - font-family: Open Sans, sans-serif; - outline: none; - padding: 8px 12px; - text-transform: uppercase; - text-align: center; - color: #fff; - user-select: none; - white-space: normal; - transition: all .3s ease-in-out; -} - -#botao-hub span:hover, #botao-hub span:active, #botao-hub span:focus { - background-color: rgb(125, 163, 0); - border-color: rgb(125, 163, 0); -} - -#botao-hub span img { - width: 16px; - margin-bottom: -3px; - margin-top: -3px; -} diff --git a/view/adminhtml/web/css/integration_buttons.css b/view/adminhtml/web/css/integration_buttons.css new file mode 100644 index 00000000..59b87f70 --- /dev/null +++ b/view/adminhtml/web/css/integration_buttons.css @@ -0,0 +1,48 @@ +#pagarme-hub-button, #pagarme-dash-button { + background-color: #65a300; + border-color: #65a300; + border-radius: 2px; + border-style: solid; + border-width: 1px; + letter-spacing: .04em; + display: inline-block; + font-size: 14px; + font-weight: 600; + font-family: Open Sans, sans-serif; + outline: none; + padding: 8px 12px; + text-decoration: none; + text-transform: uppercase; + text-align: center; + color: #fff; + user-select: none; + transition: background-color .2s ease-in-out, border-color .2s ease-in-out; + margin: 0 1rem 1rem 0; +} + +#pagarme-dash-button { + background-color: #e3e3e3; + border-color: #adadad; + color: #514943; + text-transform: none; +} + +#pagarme-hub-button:hover, #pagarme-hub-button:active, #pagarme-hub-button:focus { + background-color: #7da300; + border-color: #7da300; +} + +#pagarme-dash-button:hover, #pagarme-dash-button:active, #pagarme-dash-button:focus { + background-color: #dbdbdb; +} + +#pagarme-hub-button:after { + content: ""; + background: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAT3XpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZppdty4FYX/YxVZAuZhORjPyQ6y/HwXLMmyJNvdSVt2scRigcAb7gDa7P/8+5h/8Se5Ek1MpeaWs+VPbLH5zptqnz/9vjob7+vzy3x95n4+b94/8JwKHMPza82v69/Ou/cBnkPnXfowUH0N5MbPH7T4Gr9+Gsg/h6AZ6f16DdReAwX/fOBeA/RnWTa3Wj4uYezn+Pr+Ewb+Gb3E+vO0v/xeiN5K3Cd4v4MLllcf4jOBoH/OhM6bxCsnuNBx7Lw2XkOor8EIyHdxsh9mZT5n5f2d+8X5T0kJ+TlvOPFzMPP78dvzLn06/xrQ3BB/uHOY73f+6fwJzn9eztu/c1Y15+xndT1mQppfi3pbyn3HhYOQh/u1zE/hX+J9uT+Nn2qo3knKl5128DNdc560HBfdct0dt+9xuskUo9++cPR+kiidq6H45mewhgxF/bjjC7laoZK3SXoDZ/37XNy9b7u3m65y4+W40jsGU6a90cs/8fPLgc5RyTtn63usmJdXwJmGMqdXriIh7rzVUboBfvv5/Ed5DWQw3TBXFtjteIYYyb1qS3UUbqIDFyaOT6+5sl4DECLunZiMC2TAZheSy84W74tzxLGSn85AlabxgxS4lPxilj6GkElO9bo33ynuXuuTf06DWSQihRwKqaGZyJWAjfopsVJDPYUUU0o5lVRTSz2HHHPKOZcs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1wLmRpZDphNGVlM2VhMi02NzM5LTQwODYtYWY4ZS00NjgyNmU3ZmNiNTgiCiAgIGRjOkZvcm1hdD0iaW1hZ2UvcG5nIgogICBHSU1QOkFQST0iMi4wIgogICBHSU1QOlBsYXRmb3JtPSJXaW5kb3dzIgogICBHSU1QOlRpbWVTdGFtcD0iMTYyMTUyMzk4MDE2MTIxMCIKICAgR0lNUDpWZXJzaW9uPSIyLjEwLjI0IgogICB0aWZmOk9yaWVudGF0aW9uPSIxIgogICB4bXA6Q3JlYXRvclRvb2w9IkdJTVAgMi4xMCI+CiAgIDx4bXBNTTpIaXN0b3J5PgogICAgPHJkZjpTZXE+CiAgICAgPHJkZjpsaQogICAgICBzdEV2dDphY3Rpb249InNhdmVkIgogICAgICBzdEV2dDpjaGFuZ2VkPSIvIgogICAgICBzdEV2dDppbnN0YW5jZUlEPSJ4bXAuaWlkOmRkMmI0OWM4LTVjYjQtNGYxZC04ZDFhLTBmNmE2YzcxNDRiOCIKICAgICAgc3RFdnQ6c29mdHdhcmVBZ2VudD0iR2ltcCAyLjEwIChXaW5kb3dzKSIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMS0wNS0yMFQxMjoxOTo0MCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgCjw/eHBhY2tldCBlbmQ9InciPz7JVoCNAAAABmJLR0QAAAAAAAD5Q7t/AAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH5QUUDxMowsDBfAAAAo5JREFUSMe9lr1rFEEUwGf37nK5RKKQXAJBUUM0okiKEKy0sbAJ+QsCaayMVarYKdhpK1gKwoGIIiLEQiGYFMEvhBj01ETiHrmPvdzebnZ3dj7ejI0Qc97sfW185Qxvf/PezPxmNRQSmOy+TMS7RyWSVSnlLwC6iqm74lPn7dH+MY6iDsrwiqwTIHiJMHyv7OTORwokCuBeCMGAPq+4hbP/BSik+IMFRhi+s2a8Th5IS/fqg9pWf6x6xZMHBlQsorSLK5Oqb+qhRE2TQgJuZZGapqd7kodf2Z450VaVlpePlXeN44ThacL8+wxosclKi6ZjnOj4IC1nMylM3WtCgNkIyoG9/5xb6orkBOetjf6A+o8aQQPq3Y70rnqBc7NBa6npGKcjhtq3wqAM6OPINUgYfvq3EvZXKSBvbZxSJlfc/BAHdkVKOe0G1vizTwt6I2DJ3kqD4JV6QCmlJAzf/SfJ9ssXKQveCLlfIRzYtk+cG4XqZncDUcyr2gqCG5nV63sLpxwvSCkhbC8A+AfTMdIq4Hpu+RAHZqnyLbc4jhBCyCfO1WbVxYG9K9lbSkkzTh6qcr3AmUNG+euAEGC34ksvsOdDgDOqPMqDB/qR3qFZTdP7WjmRXYnUnGqOC7YW4tljendX7+VWr0BcT4x4xB6ta6Bq9ruUQtQFIn04riGtLcHG9cQQQuhH7fjI4IRPmL8Y0xOp2jkQzIgLKXZibQAlQkQ1l0z0TCnfQyFgvWWYlMR0tr60paSKW7jU6qtOGH7SqQcXm/+FEIHlFs91BCxYm4OMk2wTMKAMz0Zi+9xOdoDy4EWIC/NuYE11ytFqB0wnN9mX6p+J6bEzCGm9INhPysnStvUtMzZ8AXcK/A0UsGey2h9i1gAAAABJRU5ErkJggg=="); + background-size: 16px 16px; + background-repeat: no-repeat; + display: inline-block; + width: 16px; + height: 16px; + margin: 2px 0 -2px .8rem; +} diff --git a/view/adminhtml/web/css/menu.css b/view/adminhtml/web/css/menu.css index 26d067c7..3c1c590a 100644 --- a/view/adminhtml/web/css/menu.css +++ b/view/adminhtml/web/css/menu.css @@ -1,5 +1,5 @@ .admin__menu .level-0.item-pagarme > a:before { - content: url('../images/avatar-pagarme.svg'); + content: url('../images/avatar-pagarme-white.svg'); height: 28px; margin: 0 auto; width: 30px; diff --git a/view/adminhtml/web/css/warnings.css b/view/adminhtml/web/css/warnings.css new file mode 100644 index 00000000..c521addd --- /dev/null +++ b/view/adminhtml/web/css/warnings.css @@ -0,0 +1,22 @@ +.message.message-warning .pagarme-admin-warnings > h3 { + display: flex; + align-items: center; + margin-bottom: .5rem; + padding: 0.5rem 0; +} + +.message.message-warning .pagarme-admin-warnings > h3:before { + content: url('../images/avatar-pagarme.svg'); + height: 28px; + margin-right: 0.5rem; + background: rgba(255,255,255,.7); + border-radius: 0.6rem; +} + +.message.message-warning .pagarme-admin-warnings > div { + padding: 1rem 0; +} + +.message.message-warning .pagarme-admin-warnings > div:not(:last-child) { + border-bottom: 1px dashed #d1d1d1; +} diff --git a/view/adminhtml/web/images/avatar-pagarme-white.svg b/view/adminhtml/web/images/avatar-pagarme-white.svg new file mode 100644 index 00000000..362293e3 --- /dev/null +++ b/view/adminhtml/web/images/avatar-pagarme-white.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/view/adminhtml/web/images/avatar-pagarme.svg b/view/adminhtml/web/images/avatar-pagarme.svg index 7bb3cf41..2ce96344 100644 --- a/view/adminhtml/web/images/avatar-pagarme.svg +++ b/view/adminhtml/web/images/avatar-pagarme.svg @@ -1,13 +1,6 @@ - - - - - - - - - - + + + diff --git a/view/adminhtml/web/js/hubIntegration.js b/view/adminhtml/web/js/hubIntegration.js deleted file mode 100644 index 397e54c0..00000000 --- a/view/adminhtml/web/js/hubIntegration.js +++ /dev/null @@ -1,47 +0,0 @@ -require([ - "jquery", - "jquery/ui", -], function ($) { - function Hub(config) { - this.hubLogo = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAYAAAByDd+UAAAT3XpUWHRSYXcgcHJvZmlsZSB0eXBlIGV4aWYAAHjarZppdty4FYX/YxVZAuZhORjPyQ6y/HwXLMmyJNvdSVt2scRigcAb7gDa7P/8+5h/8Se5Ek1MpeaWs+VPbLH5zptqnz/9vjob7+vzy3x95n4+b94/8JwKHMPza82v69/Ou/cBnkPnXfowUH0N5MbPH7T4Gr9+Gsg/h6AZ6f16DdReAwX/fOBeA/RnWTa3Wj4uYezn+Pr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SIKICAgICAgc3RFdnQ6d2hlbj0iMjAyMS0wNS0yMFQxMjoxOTo0MCIvPgogICAgPC9yZGY6U2VxPgogICA8L3htcE1NOkhpc3Rvcnk+CiAgPC9yZGY6RGVzY3JpcHRpb24+CiA8L3JkZjpSREY+CjwveDp4bXBtZXRhPgogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgCiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg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s91BCxYm4OMk2wTMKAMz0Zi+9xOdoDy4EWIC/NuYE11ytFqB0wnN9mX6p+J6bEzCGm9INhPysnStvUtMzZ8AXcK/A0UsGey2h9i1gAAAABJRU5ErkJggg==" - this.space = " "; - this.elementType = "span"; - this.containerId = "botao-hub"; - - this.setup = function() { - var container = document.getElementById(this.containerId); - - if (!container){ - return; - } - - const url = container.getAttribute("hub-url").replace("{redirectUrl}"); - const text = container.getAttribute("button-text"); - - createButton(text, function(event) { - }); - }; - - this.createButton = function(text, func) { - var container = document.getElementById(this.containerId); - var button = document.createElement(this.elementType); - button.innerHTML = text + this.space + this.space + this.getImageTag(hubLogo); - container.appendChild(button); - }; - - this.getImageTag = function(src) { - return ""; - }; - - this.setup(); - - return this; - } - - - $(document).ready(function (){ - Hub(); - }); - - -}); diff --git a/view/adminhtml/web/js/integrationType.js b/view/adminhtml/web/js/integrationType.js index 8b1359ea..cd14b146 100644 --- a/view/adminhtml/web/js/integrationType.js +++ b/view/adminhtml/web/js/integrationType.js @@ -3,42 +3,54 @@ require([ "jquery/ui", ], function ($) { "use strict"; - $(document).ready(function(){ + $(document).ready(function () { const integrationTypeElement = $('select[id*="pagarme_pagarme_global_is_gateway_integration_type"]'), - softDescriptionElements = $('input[id$="_soft_description"]'), - installmentsNumberElements = $('input[id*="pagarme_creditcard_installments"][id*="installments_number"]'), - installmentsWithoutInterestElements = $('input[id*="pagarme_creditcard_installments"][id*="max_without_interest"]'); + softDescriptionElements = $('input[id$="_soft_description"]'), + installmentsNumberElements = $('input[id*="pagarme_creditcard_installments"][id*="installments_number"]'), + installmentsWithoutInterestElements = $('input[id*="pagarme_creditcard_installments"][id*="max_without_interest"]'); - integrationTypeElement.change(function() { - var integrationType = $(this).val(), + integrationTypeElement.change(function () { + const integrationType = $(this).val(), creditcardSoftDescriptionElement = $('input[id$="_creditcard_soft_description"]'), softDescriptionMaxLength = integrationType === '0' ? 13 : 22; - changeCommentsByIntegrionType(integrationType); + changeCommentsByIntegrationType(integrationType); softDescriptionCounter(creditcardSoftDescriptionElement, softDescriptionMaxLength); changeInstallmentsValidation(integrationType); }) - .change(); + .change(); - softDescriptionElements.keyup(function() { - var integrationType = integrationTypeElement.val(), + softDescriptionElements.keyup(function () { + const cssClasses = $(this).attr('class') + const maximumLengthCssClass = 'maximum-length-'; + const positionMaximumLength = cssClasses.indexOf(maximumLengthCssClass) + maximumLengthCssClass.length; + let softDescriptionMaxLength = cssClasses.substring( + positionMaximumLength, + positionMaximumLength + 2 + ); + + if (integrationTypeElement.length > 0) { + const integrationType = integrationTypeElement.val(); softDescriptionMaxLength = integrationType === '0' ? 13 : 22; + } + + changeSoftDescriptionComment($(this), softDescriptionMaxLength); softDescriptionCounter($(this), softDescriptionMaxLength); }) - .keyup(); + .keyup(); - softDescriptionElements.change(function() { - var softDescription = $(this).val(); - softDescriptionElements.each(function() { - if(softDescription !== '' && $(this).val() === '') { + softDescriptionElements.change(function () { + const softDescription = $(this).val(); + softDescriptionElements.each(function () { + if (softDescription !== '' && $(this).val() === '') { $(this).val(softDescription); } $(this).keyup(); }); }) - .change(); + .change(); - installmentsNumberElements.change(function() { - var installmentsNumberVal = $(this).val(), + installmentsNumberElements.change(function () { + const installmentsNumberVal = $(this).val(), installmentsWithoutInterestElement = $(this).closest('fieldset[id*="pagarme_creditcard_installments"]') .find('input[id*="_pagarme_creditcard_installments_"][id*="_max_without_interest"]').first(); @@ -46,18 +58,18 @@ require([ changeInstallmentsWithoutInterestValidation(installmentsWithoutInterestElement, installmentsNumberVal) } }) - .change(); + .change(); - installmentsWithoutInterestElements.change(function(){ - var installmentsNumberParent = $(this).closest('fieldset.config') + installmentsWithoutInterestElements.change(function () { + const installmentsNumberParent = $(this).closest('fieldset.config') .find('input[id*="_pagarme_creditcard_installments_"][id*="_installments_number"]').first(); - + if (installmentsNumberParent.val() === '') { $(this).val(''); } }); - function changeCommentsByIntegrionType(integrationType) { + function changeCommentsByIntegrationType(integrationType) { const softDescriptionMaxSizeElement = document.getElementById('soft_description_max_size'); @@ -67,25 +79,41 @@ require([ const installmentsMaxSizeElements = $('[id^="installments_max_size"]'); - if (softDescriptionMaxSizeElement){ + if (softDescriptionMaxSizeElement) { softDescriptionMaxSizeElement.innerHTML = integrationType === '0' ? 13 : 22; } - if (softDescriptionCounterMaxSizeElement){ + if (softDescriptionCounterMaxSizeElement) { softDescriptionCounterMaxSizeElement.innerHTML = integrationType === '0' ? 13 : 22; } - if (installmentsMaxSizeElements){ - installmentsMaxSizeElements.each(function(){ + if (installmentsMaxSizeElements) { + installmentsMaxSizeElements.each(function () { $(this).html(integrationType === '0' ? 12 : 24); }); } - }; + } + + function changeSoftDescriptionComment(element, maxSize) { + const softDescriptionMaxSizeElement = + element.closest('td.value').find('#soft_description_max_size'); + + const softDescriptionCounterMaxSizeElement = + element.closest('td.value').find('#creditcard_soft_description_counter_max_size'); + + if (softDescriptionMaxSizeElement.length > 0) { + softDescriptionMaxSizeElement.html(maxSize); + } + + if (softDescriptionCounterMaxSizeElement.length > 0) { + softDescriptionCounterMaxSizeElement.html(maxSize); + } + } function softDescriptionCounter(element, maxLength) { - var counter = element.parent().find('[id$="_soft_description_counter_current"]'), + const counter = element.parent().find('[id$="_soft_description_counter_current"]'), length = element.val().length; if (length >= maxLength) { element.val(element.val().substring(0, maxLength)); @@ -95,7 +123,7 @@ require([ counter.text(length); counter.parent().removeClass('limit-reached'); } - }; + } function changeInstallmentsValidation(integrationType) { if (integrationType === '0') { @@ -105,13 +133,13 @@ require([ installmentsNumberElements.toggleClass('number-range-1-12', false); installmentsNumberElements.toggleClass('number-range-1-24', true); } - }; + } function changeInstallmentsWithoutInterestValidation(element, maxRange) { - element.removeClass(function(index, classNames) { + element.removeClass(function (index, classNames) { return (classNames.match(/(^|\s)number-range-1-\S+/g) || []).join(' '); }) - .addClass('number-range-1-' + maxRange); - }; + .addClass('number-range-1-' + maxRange); + } }); }); diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index 04fcc195..d2879915 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -85,6 +85,24 @@ define([ this.addCreditCardListeners(this.formObject); this.modelToken = new CreditCardToken(this.formObject); + + this.subscribeTotal(); + } + + subscribeTotal() { + const _self = this; + + this.platformConfig.updateTotals.totals.subscribe(function(){ + if (_self.methodCode === 'twocreditcards' || _self.methodCode === 'boletoCreditcard') { + for (let i = 0, len = _self.formObject.numberOfPaymentForms; i < len; i++) { + _self.fillCardAmount(_self.formObject[i], 2, i); + _self.fillInstallments(_self.formObject[i]); + } + return; + } + _self.fillCardAmount(_self.formObject, 1); + _self.fillInstallments(_self.formObject); + }); } voucherInit() { @@ -196,6 +214,7 @@ define([ } this.modelToken = new CreditCardToken(this.formObject); + this.subscribeTotal(); } pixInit() { @@ -291,6 +310,8 @@ define([ this.formObject, this.platformConfig.publicKey ); + + this.subscribeTotal(); } addCreditCardListeners(formObject) { diff --git a/view/frontend/web/js/core/checkout/PlatformConfig.js b/view/frontend/web/js/core/checkout/PlatformConfig.js index 9fcf6999..3889e35e 100644 --- a/view/frontend/web/js/core/checkout/PlatformConfig.js +++ b/view/frontend/web/js/core/checkout/PlatformConfig.js @@ -16,7 +16,7 @@ define([], () => { availableBrands[i] = { 'title': brands[i], - 'image': url + 'image': jQuery.isArray(url) ? url.find(element => element.includes('Pagarme')) : url }; }