From cc9e570f61cb8c05c5d3b8ae8a0f732cc88efd09 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 11 Jul 2023 14:37:05 -0300 Subject: [PATCH 01/83] refactoring Invoice block and template --- Block/Customer/Invoice.php | 90 ++++++++++++++++++- .../frontend/templates/customer/invoice.phtml | 59 ++++-------- 2 files changed, 102 insertions(+), 47 deletions(-) diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index ec5d93b5..812a25ae 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -12,11 +12,14 @@ namespace Pagarme\Pagarme\Block\Customer; +use Magento\Framework\Exception\AuthorizationException; use Magento\Framework\View\Element\Template; use Magento\Framework\View\Element\Template\Context; use Magento\Framework\Registry; use Magento\Customer\Model\Session; +use NumberFormatter; use Pagarme\Core\Kernel\ValueObjects\Id\SubscriptionId; +use Pagarme\Pagarme\Api\Data\RecurrenceProductsSubscriptionInterface; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Core\Recurrence\Repositories\SubscriptionRepository; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; @@ -46,6 +49,11 @@ class Invoice extends Template */ protected $coreRegistry; + /** + * @var NumberFormatter + */ + private $numberFormatter; + /** * Link constructor. * @param Context $context @@ -66,6 +74,8 @@ public function __construct( $this->subscriptionRepository = new SubscriptionRepository(); $this->validateUserInvoice($this->coreRegistry->registry('code')); + + $this->numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); } /** @@ -95,10 +105,83 @@ public function getSubscriptionPaymentMethod() return $subscription->getPaymentMethod(); } + public function getBoletoHeader(): string + { + if (!$this->isBoleto()) { + return ""; + } + + return sprintf('%s', __('Boleto')); + } + /** - * @param string $codeOrder * @throws InvalidParamException */ + public function getInvoicesTableBody(): string + { + $tbody = ""; + + foreach ($this->getAllChargesByCodeOrder() as $id => $item) { + $tbody .= ""; + $visualId = $id + 1; + $tbody .= $this->formatTableDataCell($visualId); + $tbody .= $this->formatNumberTableDataCell($item->getAmount()); + $tbody .= $this->formatNumberTableDataCell($item->getPaidAmount()); + $tbody .= $this->formatNumberTableDataCell($item->getCanceledAmount()); + $tbody .= $this->formatNumberTableDataCell($item->getRefundedAmount()); + $tbody .= $this->formatTableDataCell($item->getStatus()->getStatus()); + $tbody .= $this->formatTableDataCell($item->getPaymentMethod()->getPaymentMethod()); + $tbody .= $this->addBoletoButton($item); + $tbody .= ''; + } + + return $tbody; + } + + private function addBoletoButton($item): string + { + $button = ''; + if (!$this->isBoleto()) { + return $button; + } + + $button = ''; + if (!empty($item->getBoletoLink())) { + $button .= sprintf( + '', + $item->getBoletoLink(), + __("download") + ); + } + $button .= ''; + + return $button; + } + + private function formatTableDataCell($text): string + { + return sprintf('%s', $text); + } + + private function formatNumberTableDataCell($number): string + { + return $this->formatTableDataCell($this->formatNumber($number)); + } + + private function formatNumber($number) + { + return $this->numberFormatter->format(($number) / 100); + } + + private function isBoleto(): bool + { + return $this->getSubscriptionPaymentMethod() === RecurrenceProductsSubscriptionInterface::BOLETO; + } + + /** + * @param string $codeOrder + * @throws InvalidParamException|AuthorizationException + */ private function validateUserInvoice($codeOrder) { $subscriptionList = $this->subscriptionRepository->findByCustomerId( @@ -112,8 +195,9 @@ private function validateUserInvoice($codeOrder) } if (!in_array($codeOrder, $listSubscriptionCode)) { - throw new \Exception( - 'Esse pedido não pertence a esse usuário', + throw new AuthorizationException( + __('Esse pedido não pertence a esse usuário'), + null, 403 ); } diff --git a/view/frontend/templates/customer/invoice.phtml b/view/frontend/templates/customer/invoice.phtml index b391344e..15132b53 100755 --- a/view/frontend/templates/customer/invoice.phtml +++ b/view/frontend/templates/customer/invoice.phtml @@ -1,54 +1,25 @@
- - - - - - - - - getSubscriptionPaymentMethod() == 'boleto') :?> - - - - - - getAllChargesByCodeOrder() as $item) : ?> - - getStatus()->getStatus(); - $paymentMethod = $item->getPaymentMethod()->getPaymentMethod(); - - $numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); - ?> - - - - - - - - getSubscriptionPaymentMethod() == 'boleto') :?> - - + + + + + + + + getBoletoHeader() ?> - + + + getInvoicesTableBody() ?>
format(($item->getAmount()) / 100); ?>format(($item->getPaidAmount()) / 100); ?>format(($item->getCanceledAmount()) / 100) ?>format(($item->getRefundedAmount()) / 100) ?> - getBoletoLink())):?> - - -
-
\ No newline at end of file + From f002905ac33a8fe1c7b7153d11ac24a33fd0ad6d Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 11 Jul 2023 14:47:23 -0300 Subject: [PATCH 02/83] removing target attribute --- Block/Customer/Invoice.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index 812a25ae..a41afe69 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -148,7 +148,7 @@ private function addBoletoButton($item): string $button = ''; if (!empty($item->getBoletoLink())) { $button .= sprintf( - '', + '', $item->getBoletoLink(), __("download") ); From d919ee92837c5d13c71bf917848f229d959d1d7a Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 11 Jul 2023 15:15:11 -0300 Subject: [PATCH 03/83] fixing names and translations --- Block/Customer/Invoice.php | 21 ++++++++++--------- i18n/en_US.csv | 1 + i18n/pt_BR.csv | 1 + .../frontend/templates/customer/invoice.phtml | 2 +- 4 files changed, 14 insertions(+), 11 deletions(-) diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index a41afe69..4438750e 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -105,13 +105,13 @@ public function getSubscriptionPaymentMethod() return $subscription->getPaymentMethod(); } - public function getBoletoHeader(): string + public function getBilletHeader(): string { - if (!$this->isBoleto()) { + if (!$this->isBillet()) { return ""; } - return sprintf('%s', __('Boleto')); + return sprintf('%s', __('Billet')); } /** @@ -131,26 +131,27 @@ public function getInvoicesTableBody(): string $tbody .= $this->formatNumberTableDataCell($item->getRefundedAmount()); $tbody .= $this->formatTableDataCell($item->getStatus()->getStatus()); $tbody .= $this->formatTableDataCell($item->getPaymentMethod()->getPaymentMethod()); - $tbody .= $this->addBoletoButton($item); + $tbody .= $this->addBilletButton($item); $tbody .= ''; } return $tbody; } - private function addBoletoButton($item): string + private function addBilletButton($item): string { $button = ''; - if (!$this->isBoleto()) { + if (!$this->isBillet()) { return $button; } $button = ''; - if (!empty($item->getBoletoLink())) { + $hasBilletLink = !empty($item->getBoletoLink()); + if ($hasBilletLink) { $button .= sprintf( '', $item->getBoletoLink(), - __("download") + 'download' ); } $button .= ''; @@ -173,7 +174,7 @@ private function formatNumber($number) return $this->numberFormatter->format(($number) / 100); } - private function isBoleto(): bool + private function isBillet(): bool { return $this->getSubscriptionPaymentMethod() === RecurrenceProductsSubscriptionInterface::BOLETO; } @@ -196,7 +197,7 @@ private function validateUserInvoice($codeOrder) if (!in_array($codeOrder, $listSubscriptionCode)) { throw new AuthorizationException( - __('Esse pedido não pertence a esse usuário'), + __('This order does not belong to this user'), null, 403 ); diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 980bc09c..12edae6f 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -291,3 +291,4 @@ "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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index c8dfd0b7..7b3b380e 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -470,3 +470,4 @@ "Remove","Remover" "You must be logged in.","Você deve estar logado." "Created At","Criado em" +"This order does not belong to this user","Esse pedido não pertence a esse usuário" diff --git a/view/frontend/templates/customer/invoice.phtml b/view/frontend/templates/customer/invoice.phtml index 15132b53..238969e7 100755 --- a/view/frontend/templates/customer/invoice.phtml +++ b/view/frontend/templates/customer/invoice.phtml @@ -15,7 +15,7 @@ - getBoletoHeader() ?> + getBilletHeader() ?> From c6784162b8ed3cccea43867fb97dbc5ac1147e47 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Wed, 12 Jul 2023 10:26:29 -0300 Subject: [PATCH 04/83] adding NumberFormatHelper --- Block/Customer/Invoice.php | 18 ++++++++++-------- Helper/NumberFormatHelper.php | 27 +++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) create mode 100644 Helper/NumberFormatHelper.php diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index 4438750e..8d4c73c7 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -17,7 +17,6 @@ use Magento\Framework\View\Element\Template\Context; use Magento\Framework\Registry; use Magento\Customer\Model\Session; -use NumberFormatter; use Pagarme\Core\Kernel\ValueObjects\Id\SubscriptionId; use Pagarme\Pagarme\Api\Data\RecurrenceProductsSubscriptionInterface; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; @@ -26,6 +25,7 @@ use Pagarme\Core\Kernel\Abstractions\AbstractEntity; use Pagarme\Core\Recurrence\Repositories\ChargeRepository; use Pagarme\Core\Recurrence\Aggregates\Charge; +use Pagarme\Pagarme\Helper\NumberFormatHelper; class Invoice extends Template { @@ -50,32 +50,34 @@ class Invoice extends Template protected $coreRegistry; /** - * @var NumberFormatter + * @var NumberFormatHelper */ private $numberFormatter; /** - * Link constructor. * @param Context $context - * @param CheckoutSession $checkoutSession + * @param Session $customerSession + * @param Registry $coreRegistry + * @param NumberFormatHelper $numberFormatter + * @throws AuthorizationException * @throws InvalidParamException */ public function __construct( Context $context, Session $customerSession, - Registry $coreRegistry + Registry $coreRegistry, + NumberFormatHelper $numberFormatter ) { parent::__construct($context, []); Magento2CoreSetup::bootstrap(); $this->coreRegistry = $coreRegistry; $this->customerSession = $customerSession; + $this->numberFormatter = $numberFormatter; $this->chargeRepository = new ChargeRepository(); $this->subscriptionRepository = new SubscriptionRepository(); $this->validateUserInvoice($this->coreRegistry->registry('code')); - - $this->numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); } /** @@ -171,7 +173,7 @@ private function formatNumberTableDataCell($number): string private function formatNumber($number) { - return $this->numberFormatter->format(($number) / 100); + return $this->numberFormatter->formatToLocalCurrency(($number) / 100); } private function isBillet(): bool diff --git a/Helper/NumberFormatHelper.php b/Helper/NumberFormatHelper.php new file mode 100644 index 00000000..00446adc --- /dev/null +++ b/Helper/NumberFormatHelper.php @@ -0,0 +1,27 @@ +numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); + } + + public function formatToLocalCurrency($number) + { + return $this->numberFormatter->format($number); + } + +} From abaf490500e7926fb96e1d6bfe2803b1e79c052b Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Wed, 12 Jul 2023 15:19:22 -0300 Subject: [PATCH 05/83] refactoring BilletCreditCard block and template --- Block/Payment/Info/BilletCreditCard.php | 136 ++++++++++++++---- Helper/NumberFormatHelper.php | 27 ++++ .../templates/info/billetCreditCard.phtml | 34 ++--- 3 files changed, 147 insertions(+), 50 deletions(-) create mode 100644 Helper/NumberFormatHelper.php diff --git a/Block/Payment/Info/BilletCreditCard.php b/Block/Payment/Info/BilletCreditCard.php index d2e97833..ea2acfbc 100644 --- a/Block/Payment/Info/BilletCreditCard.php +++ b/Block/Payment/Info/BilletCreditCard.php @@ -11,68 +11,98 @@ namespace Pagarme\Pagarme\Block\Payment\Info; +use Exception; use Magento\Framework\DataObject; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\View\Element\Template\Context; use Magento\Payment\Block\Info\Cc; +use Magento\Payment\Model\Config; use Pagarme\Core\Kernel\Aggregates\Charge; +use Pagarme\Core\Kernel\Aggregates\Order; +use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Core\Kernel\Services\OrderService; use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Concrete\Magento2PlatformOrderDecorator; +use Pagarme\Pagarme\Helper\NumberFormatHelper; use Pagarme\Pagarme\Helper\Payment\Billet as BilletHelper; class BilletCreditCard extends Cc { const TEMPLATE = 'Pagarme_Pagarme::info/billetCreditCard.phtml'; + /** + * @var NumberFormatHelper + */ + private $numberFormatter; + + public function __construct( + Context $context, + Config $paymentConfig, + NumberFormatHelper $numberFormatter, + array $data = [] + ) { + $this->numberFormatter = $numberFormatter; + parent::__construct($context, $paymentConfig, $data); + } + /** * {@inheritdoc} + * @throws LocalizedException */ - protected function _prepareSpecificInformation($transport = null) + protected function _prepareSpecificInformation($transport = null): DataObject { - $transport = new DataObject([ + $specificInformation = new DataObject([ (string)__('Print Billet') => $this->getInfo()->getAdditionalInformation('billet_url') ]); - $transport = parent::_prepareSpecificInformation($transport); - return $transport; + return parent::_prepareSpecificInformation($specificInformation); } - public function _construct() + /** + * @throws Exception + */ + protected function _construct() { Magento2CoreSetup::bootstrap(); $this->setTemplate(self::TEMPLATE); } - public function getCcType() - { - return $this->getCcTypeName(); - } - - public function getCardNumber() - { - return '**** **** **** ' . $this->getInfo()->getCcLast4(); - } - - public function getCardLast4() + /** + * @throws LocalizedException + */ + public function getCardLast4(): string { return '**** **** **** ' . $this->getInfo()->getAdditionalInformation('cc_last_4'); } + /** + * @throws LocalizedException + */ public function getCcBrand() { return $this->getInfo()->getAdditionalInformation('cc_type'); } + /** + * @throws LocalizedException + */ public function getTitle() { return $this->getInfo()->getAdditionalInformation('method_title'); } + /** + * @throws LocalizedException + */ public function getInstallments() { return $this->getInfo()->getAdditionalInformation('cc_installments'); } + /** + * @throws LocalizedException + */ public function getBilletUrl() { $billetHelper = new BilletHelper(); @@ -80,21 +110,30 @@ public function getBilletUrl() } - public function getCcAmount() - { - return $this->getInfo()->getAdditionalInformation('cc_cc_amount'); - } - + /** + * @throws LocalizedException + */ public function getCcAmountWithTax() { - return (float)$this->getInfo()->getAdditionalInformation('cc_cc_amount') + (float)$this->getInfo()->getAdditionalInformation('cc_cc_tax_amount'); + $ccAmountWithTax = (float) $this->getInfo()->getAdditionalInformation('cc_cc_amount') + + (float) $this->getInfo()->getAdditionalInformation('cc_cc_tax_amount'); + return $this->numberFormatter->formatToLocalCurrency($ccAmountWithTax); } + /** + * @throws LocalizedException + */ public function getBilletAmount() { - return (float)$this->getInfo()->getAdditionalInformation('cc_billet_amount'); + return $this->numberFormatter->formatToLocalCurrency( + $this->getInfo()->getAdditionalInformation('cc_billet_amount') + ); } + /** + * @throws InvalidParamException + * @throws LocalizedException + */ public function getTransactionInfo() { $orderService = new OrderService(); @@ -110,7 +149,7 @@ public function getTransactionInfo() } /** - * @var \Pagarme\Core\Kernel\Aggregates\Order orderObject + * @var Order $orderObject */ $orderObject = $orderService->getOrderByPagarmeId(new OrderId($orderPagarmeId)); @@ -139,7 +178,54 @@ public function getTransactionInfo() return $transactionList; } - private function getTid(Charge $charge) + public function getCreditCardInformation(): string + { + $creditCardInformation = ''; + if (empty($this->getCcTypeName())) { + return $creditCardInformation; + } + + $creditCardInformation .= sprintf('%s', __($this->getTitle())); + $creditCardInformation .= '

'; + $creditCardInformation .= sprintf( + '%s', + __('Credit Card') + ); + $creditCardInformation .= $this->formatCreditCardData(__('Amount'), $this->getCcAmountWithTax()); + $creditCardInformation .= $this->formatCreditCardData(__('Brand'), $this->getCcBrand()); + $creditCardInformation .= $this->formatCreditCardData(__('Number'), $this->getCardLast4()); + $creditCardInformation .= $this->formatCreditCardData(__('Installments'), $this->getInstallments()); + + return $creditCardInformation; + } + + /** + * @throws LocalizedException + */ + public function getPrintBillet(): string + { + $printBillet = ''; + + $canShowPrintBillet = !empty($this->getBilletUrl()) && $this->getInfo()->getOrder()->getStatus() === 'pending'; + if (!$canShowPrintBillet) { + return $printBillet; + } + + $printBillet .= '

'; + $printBillet .= sprintf( + '%s', + $this->getBilletUrl(), + __('Print Billet') + ); + return $printBillet; + } + + private function formatCreditCardData($title, $information): string + { + return sprintf('
%s: %s', $title, $information); + } + + private function getTid(Charge $charge): ?string { $transaction = $charge->getLastTransaction(); diff --git a/Helper/NumberFormatHelper.php b/Helper/NumberFormatHelper.php new file mode 100644 index 00000000..00446adc --- /dev/null +++ b/Helper/NumberFormatHelper.php @@ -0,0 +1,27 @@ +numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); + } + + public function formatToLocalCurrency($number) + { + return $this->numberFormatter->format($number); + } + +} diff --git a/view/frontend/templates/info/billetCreditCard.phtml b/view/frontend/templates/info/billetCreditCard.phtml index b331c360..bb557604 100644 --- a/view/frontend/templates/info/billetCreditCard.phtml +++ b/view/frontend/templates/info/billetCreditCard.phtml @@ -1,29 +1,13 @@ -getCcType()): ?> - getTitle()); ?> -
-
- - - -
- : getCcAmountWithTax(),2,',', '.'); ?> -
- : getCcBrand(); ?> -
- : getCardLast4(); ?> -
- : getInstallments(); ?> - - - + + getCreditCardInformation() ?>
- +
- : getBilletAmount(),2,',', '.'); ?> -getBilletUrl() && $this->getInfo()->getOrder()->getStatus() == 'pending'): ?> -
-
- - + : getBilletAmount(); ?> + getPrintBillet() ?> From 5bd486029ccab6a1931920f00b80b98517eb9900 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Wed, 12 Jul 2023 19:06:24 -0300 Subject: [PATCH 06/83] removing line break elements and changing to use paragraph elements --- Block/Payment/Info/BilletCreditCard.php | 6 ++---- view/frontend/templates/info/billetCreditCard.phtml | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/Block/Payment/Info/BilletCreditCard.php b/Block/Payment/Info/BilletCreditCard.php index ea2acfbc..32c6b10d 100644 --- a/Block/Payment/Info/BilletCreditCard.php +++ b/Block/Payment/Info/BilletCreditCard.php @@ -185,8 +185,7 @@ public function getCreditCardInformation(): string return $creditCardInformation; } - $creditCardInformation .= sprintf('%s', __($this->getTitle())); - $creditCardInformation .= '

'; + $creditCardInformation .= sprintf('

%s

', __($this->getTitle())); $creditCardInformation .= sprintf( '%s', __('Credit Card') @@ -211,7 +210,6 @@ public function getPrintBillet(): string return $printBillet; } - $printBillet .= '

'; $printBillet .= sprintf( '%s', $this->getBilletUrl(), @@ -222,7 +220,7 @@ public function getPrintBillet(): string private function formatCreditCardData($title, $information): string { - return sprintf('
%s: %s', $title, $information); + return sprintf('

%s: %s

', $title, $information); } private function getTid(Charge $charge): ?string diff --git a/view/frontend/templates/info/billetCreditCard.phtml b/view/frontend/templates/info/billetCreditCard.phtml index bb557604..436cdb8f 100644 --- a/view/frontend/templates/info/billetCreditCard.phtml +++ b/view/frontend/templates/info/billetCreditCard.phtml @@ -8,6 +8,5 @@ -
- : getBilletAmount(); ?> +

: getBilletAmount(); ?>

getPrintBillet() ?> From e1210972b11e31a2359c7302f042e4085cacc8fe Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Fri, 14 Jul 2023 08:58:19 -0300 Subject: [PATCH 07/83] changing to return type be in comment section --- Block/Customer/Invoice.php | 35 +++++++++++++++++++++++++++++------ 1 file changed, 29 insertions(+), 6 deletions(-) diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index 8d4c73c7..659bc07f 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -107,7 +107,10 @@ public function getSubscriptionPaymentMethod() return $subscription->getPaymentMethod(); } - public function getBilletHeader(): string + /** + * @return string + */ + public function getBilletHeader() { if (!$this->isBillet()) { return ""; @@ -117,9 +120,10 @@ public function getBilletHeader(): string } /** + * @return string * @throws InvalidParamException */ - public function getInvoicesTableBody(): string + public function getInvoicesTableBody() { $tbody = ""; @@ -140,7 +144,11 @@ public function getInvoicesTableBody(): string return $tbody; } - private function addBilletButton($item): string + /** + * @param mixed $item + * @return string + */ + private function addBilletButton($item) { $button = ''; if (!$this->isBillet()) { @@ -161,22 +169,37 @@ private function addBilletButton($item): string return $button; } - private function formatTableDataCell($text): string + /** + * @param mixed $text + * @return string + */ + private function formatTableDataCell($text) { return sprintf('%s', $text); } - private function formatNumberTableDataCell($number): string + /** + * @param mixed $number + * @return string + */ + private function formatNumberTableDataCell($number) { return $this->formatTableDataCell($this->formatNumber($number)); } + /** + * @param mixed $number + * @return false|string + */ private function formatNumber($number) { return $this->numberFormatter->formatToLocalCurrency(($number) / 100); } - private function isBillet(): bool + /** + * @return bool + */ + private function isBillet() { return $this->getSubscriptionPaymentMethod() === RecurrenceProductsSubscriptionInterface::BOLETO; } From 0a0e7b3be0c797497729e8c7b952c87dca375170 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Fri, 14 Jul 2023 09:05:15 -0300 Subject: [PATCH 08/83] changing to return type be in comment section --- Block/Payment/Info/BilletCreditCard.php | 30 ++++++++++++++++++++----- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/Block/Payment/Info/BilletCreditCard.php b/Block/Payment/Info/BilletCreditCard.php index 32c6b10d..636fd545 100644 --- a/Block/Payment/Info/BilletCreditCard.php +++ b/Block/Payment/Info/BilletCreditCard.php @@ -50,7 +50,7 @@ public function __construct( * {@inheritdoc} * @throws LocalizedException */ - protected function _prepareSpecificInformation($transport = null): DataObject + protected function _prepareSpecificInformation($transport = null) { $specificInformation = new DataObject([ (string)__('Print Billet') => $this->getInfo()->getAdditionalInformation('billet_url') @@ -69,9 +69,10 @@ protected function _construct() } /** + * @return string * @throws LocalizedException */ - public function getCardLast4(): string + public function getCardLast4() { return '**** **** **** ' . $this->getInfo()->getAdditionalInformation('cc_last_4'); } @@ -101,6 +102,7 @@ public function getInstallments() } /** + * @return string|null * @throws LocalizedException */ public function getBilletUrl() @@ -111,6 +113,7 @@ public function getBilletUrl() } /** + * @return false|string * @throws LocalizedException */ public function getCcAmountWithTax() @@ -121,6 +124,7 @@ public function getCcAmountWithTax() } /** + * @return false|string * @throws LocalizedException */ public function getBilletAmount() @@ -131,6 +135,7 @@ public function getBilletAmount() } /** + * @return array * @throws InvalidParamException * @throws LocalizedException */ @@ -178,7 +183,10 @@ public function getTransactionInfo() return $transactionList; } - public function getCreditCardInformation(): string + /** + * @return string + */ + public function getCreditCardInformation() { $creditCardInformation = ''; if (empty($this->getCcTypeName())) { @@ -199,9 +207,10 @@ public function getCreditCardInformation(): string } /** + * @return string * @throws LocalizedException */ - public function getPrintBillet(): string + public function getPrintBillet() { $printBillet = ''; @@ -218,12 +227,21 @@ public function getPrintBillet(): string return $printBillet; } - private function formatCreditCardData($title, $information): string + /** + * @param mixed $title + * @param mixed $information + * @return string + */ + private function formatCreditCardData($title, $information) { return sprintf('

%s: %s

', $title, $information); } - private function getTid(Charge $charge): ?string + /** + * @param mixed $charge + * @return string|null + */ + private function getTid($charge) { $transaction = $charge->getLastTransaction(); From a9ed322c0e5cd93d14ac2de26e2f45d1273a6591 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Tue, 18 Jul 2023 16:50:44 -0300 Subject: [PATCH 09/83] Refactoring creditCard.phtml template --- Block/Payment/Info/CreditCard.php | 25 +++++++++++++++++++ view/frontend/templates/info/creditCard.phtml | 18 ++++++------- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index 5325bd14..156e6134 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -26,36 +26,57 @@ class CreditCard extends Cc { const TEMPLATE = 'Pagarme_Pagarme::info/creditCard.phtml'; + /** + * @return void + */ public function _construct() { $this->setTemplate(self::TEMPLATE); } + /** + * @return string + */ public function getCcType() { return $this->getCcTypeName(); } + /** + * @return string + */ public function getCardNumber() { return '**** **** **** ' . $this->getInfo()->getCcLast4(); } + /** + * @return string + */ public function getCardLast4() { return '**** **** **** ' . $this->getInfo()->getAdditionalInformation('cc_last_4'); } + /** + * @return mixed + */ public function getCcBrand() { return $this->getInfo()->getAdditionalInformation('cc_type'); } + /** + * @return mixed + */ public function getTitle() { return $this->getInfo()->getAdditionalInformation('method_title'); } + /** + * @return mixed + */ public function getInstallments() { return $this->getInfo()->getAdditionalInformation('cc_installments'); @@ -97,6 +118,10 @@ public function getTransactionInfo() ); } + /** + * @param \Pagarme\Core\Kernel\Aggregates\Charge $charge + * @return string|null + */ private function getTid(Charge $charge) { $transaction = $charge->getLastTransaction(); diff --git a/view/frontend/templates/info/creditCard.phtml b/view/frontend/templates/info/creditCard.phtml index 83b04fc4..4b697f3d 100644 --- a/view/frontend/templates/info/creditCard.phtml +++ b/view/frontend/templates/info/creditCard.phtml @@ -1,6 +1,6 @@ -getCcType()): ?> - getTitle()); ?> -
-
- : getCcBrand(); ?> -
- : getCardLast4(); ?> -
- : getInstallments(); ?> - +

getTitle()); ?>

+

+ : getCcBrand(); ?>
+ : getCardLast4(); ?>
+ : getInstallments(); ?> +

From 4013bb621b78d247839ac2dc6c85768a22df4d5e Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Tue, 18 Jul 2023 17:28:39 -0300 Subject: [PATCH 10/83] Refactoring creditCard.phtml template --- Block/Payment/Info/CreditCard.php | 37 ++++++++++++++----- view/frontend/templates/info/creditCard.phtml | 2 +- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index 156e6134..8f51e2e8 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -94,30 +94,49 @@ public function getTransactionInfo() $orderService = new OrderService(); $orderEntityId = $this->getInfo()->getOrder()->getIncrementId(); - - $platformOrder = new Magento2PlatformOrderDecorator(); - $platformOrder->loadByIncrementId($orderEntityId); + $platformOrder = $this->loadPlatformOrderByIncrementId($orderEntityId); $orderPagarmeId = $platformOrder->getPagarmeId(); if ($orderPagarmeId === null) { return []; } - /** - * @var Order orderObject - */ - $orderObject = $orderService->getOrderByPagarmeId(new OrderId($orderPagarmeId)); + $orderObject = $this->getOrderObjectByPagarmeId($orderService, $orderPagarmeId); if ($orderObject === null) { return []; } + + $charge = $orderObject->getCharges()[0]; return array_merge( - $orderObject->getCharges()[0]->getAcquirerTidCapturedAndAutorize(), - ['tid' => $this->getTid($orderObject->getCharges()[0])] + $charge->getAcquirerTidCapturedAndAutorize(), + ['tid' => $this->getTid($charge)] ); } + /** + * @param mixed $incrementId + * @return Magento2PlatformOrderDecorator + */ + private function loadPlatformOrderByIncrementId($incrementId) + { + $platformOrder = new Magento2PlatformOrderDecorator(); + $platformOrder->loadByIncrementId($incrementId); + return $platformOrder; + } + + /** + * @param mixed $orderService + * @param mixed $pagarmeId + * @return mixed + */ + private function getOrderObjectByPagarmeId($orderService, $pagarmeId) + { + $orderId = new OrderId($pagarmeId); + return $orderService->getOrderByPagarmeId($orderId); + } + /** * @param \Pagarme\Core\Kernel\Aggregates\Charge $charge * @return string|null diff --git a/view/frontend/templates/info/creditCard.phtml b/view/frontend/templates/info/creditCard.phtml index 4b697f3d..b96c6fcc 100644 --- a/view/frontend/templates/info/creditCard.phtml +++ b/view/frontend/templates/info/creditCard.phtml @@ -12,7 +12,7 @@ ?>

getTitle()); ?>

- : getCcBrand(); ?>
+ : getCcBrand()); ?>
: getCardLast4(); ?>
: getInstallments(); ?>

From 72266a68485d6200b8355bfc075dc5a2af9ea4c2 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Wed, 19 Jul 2023 09:41:17 -0300 Subject: [PATCH 11/83] Refactoring creditCard.phtml template --- view/frontend/templates/info/creditCard.phtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/frontend/templates/info/creditCard.phtml b/view/frontend/templates/info/creditCard.phtml index b96c6fcc..adbeebaa 100644 --- a/view/frontend/templates/info/creditCard.phtml +++ b/view/frontend/templates/info/creditCard.phtml @@ -1,6 +1,6 @@ Date: Wed, 19 Jul 2023 10:03:08 -0300 Subject: [PATCH 12/83] Refactoring creditCard.phtml template --- Block/Payment/Info/CreditCard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index 8f51e2e8..a4e2121c 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -107,7 +107,7 @@ public function getTransactionInfo() return []; } - $charge = $orderObject->getCharges()[0]; + $charge = current($orderObject->getCharges()); return array_merge( $charge->getAcquirerTidCapturedAndAutorize(), From 6960c43115c36222c906bfeb722e28ca7a30da7c Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Thu, 20 Jul 2023 19:10:45 -0300 Subject: [PATCH 13/83] refactoring order_charge block and template --- Block/Adminhtml/Order/Charge/Tab/View.php | 178 ++++++++++++++---- Block/Customer/Invoice.php | 55 ++---- Block/Payment/Info/BilletCreditCard.php | 25 ++- Helper/HtmlTableHelper.php | 54 ++++++ Service/Order/ChargeService.php | 32 ++++ i18n/en_US.csv | 9 + i18n/pt_BR.csv | 9 + view/adminhtml/layout/sales_order_view.xml | 6 - view/adminhtml/requirejs-config.js | 7 + .../templates/tab/view/order_charge.phtml | 104 ++-------- .../web/js/view/order/orderCharge.js | 47 +++++ view/base/requirejs-config.js | 7 + view/base/web/js/helper/numberFormatter.js | 10 + 13 files changed, 359 insertions(+), 184 deletions(-) create mode 100644 Helper/HtmlTableHelper.php create mode 100644 Service/Order/ChargeService.php create mode 100644 view/adminhtml/requirejs-config.js create mode 100644 view/adminhtml/web/js/view/order/orderCharge.js create mode 100644 view/base/requirejs-config.js create mode 100644 view/base/web/js/helper/numberFormatter.js diff --git a/Block/Adminhtml/Order/Charge/Tab/View.php b/Block/Adminhtml/Order/Charge/Tab/View.php index e016f2f4..19e878b6 100644 --- a/Block/Adminhtml/Order/Charge/Tab/View.php +++ b/Block/Adminhtml/Order/Charge/Tab/View.php @@ -2,79 +2,150 @@ namespace Pagarme\Pagarme\Block\Adminhtml\Order\Charge\Tab; +use Exception; +use Magento\Backend\Block\Template; +use Magento\Backend\Block\Template\Context; +use Magento\Backend\Block\Widget\Tab\TabInterface; +use Magento\Framework\Registry; +use Magento\Sales\Model\Order; +use Pagarme\Core\Kernel\Aggregates\Charge; +use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; +use Pagarme\Pagarme\Helper\HtmlTableHelper; +use Pagarme\Pagarme\Service\Order\ChargeService; -use Pagarme\Core\Kernel\Repositories\ChargeRepository; -use Pagarme\Core\Kernel\Repositories\OrderRepository; -use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; - -class View extends \Magento\Backend\Block\Template implements \Magento\Backend\Block\Widget\Tab\TabInterface +class View extends Template implements TabInterface { + // @codingStandardsIgnoreLine protected $_template = 'tab/view/order_charge.phtml'; /** - * View constructor. - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Framework\Registry $registry + * @var Registry + */ + private $registry; + + /** + * @var HtmlTableHelper + */ + private $htmlTableHelper; + + /** + * @var ChargeService + */ + private $chargeService; + + /** + * @param Context $context + * @param Registry $registry + * @param HtmlTableHelper $htmlTableHelper + * @param ChargeService $chargeService * @param array $data + * @throws Exception */ public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Framework\Registry $registry, - array $data = [] + Context $context, + Registry $registry, + HtmlTableHelper $htmlTableHelper, + ChargeService $chargeService, + array $data = [] ) { Magento2CoreSetup::bootstrap(); - $this->_coreRegistry = $registry; + $this->registry = $registry; + $this->htmlTableHelper = $htmlTableHelper; + $this->chargeService = $chargeService; parent::__construct($context, $data); } /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order + * @return string + * @throws InvalidParamException */ - public function getOrder() + public function getChargesTableBody() { - return $this->_coreRegistry->registry('current_order'); + $tbody = ''; + + foreach ($this->getCharges() as $charge) { + $tbody .= ''; + $tbody .= $this->htmlTableHelper->formatTableDataCell($charge->getPagarmeId()->getValue()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getPaidAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getCanceledAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getRefundedAmount()); + $tbody .= $this->htmlTableHelper->formatTableDataCell($charge->getStatus()->getStatus()); + $tbody .= $this->htmlTableHelper->formatTableDataCell($this->getAmountInput($charge), 'amount'); + $tbody .= $this->getCaptureChargeButtonDataCell($charge); + $tbody .= $this->getCancelChargeButtonDataCell($charge); + $tbody .= ''; + } + + return $tbody; } - public function getCharges() + /** + * @param Charge $charge + * @return string + */ + public function getAmountInput($charge) { - //@todo Create service to return the charges - $platformOrderID = $this->getOrderIncrementId(); - $pagarmeOrder = (new OrderRepository)->findByPlatformId($platformOrderID); + return sprintf('', $charge->getAmount()); + } - if ($pagarmeOrder === null) { - return []; + /** + * @param Charge $charge + * @return string + */ + public function getCaptureChargeButtonDataCell($charge) + { + $buttonTableDataCell = ''; + + if ($charge->getCanceledAmount() <= 0) { + $button = $this->getActionChargeButton( + $charge, + 'capture', + __('Do you want to capture this charge?'), + __('Capture') + ); + $buttonTableDataCell .= $this->htmlTableHelper->formatTableDataCell($button); } - $charges = (new ChargeRepository)->findByOrderId( - new OrderId($pagarmeOrder->getPagarmeId()->getValue()) - ); - - return $charges; + return $buttonTableDataCell; } /** - * Retrieve order model instance - * - * @return \Magento\Sales\Model\Order + * @param Charge $charge + * @return string */ - public function getOrderId() + public function getCancelChargeButtonDataCell($charge) { - return $this->getOrder()->getEntityId(); + $button = $this->getActionChargeButton( + $charge, + 'cancel', + __('Do you want to cancel this charge?'), + __('Cancel') + ); + return $this->htmlTableHelper->formatTableDataCell($button); } /** - * Retrieve order increment id - * + * @param Charge $charge + * @param string $action + * @param string $message + * @param string $label * @return string */ - public function getOrderIncrementId() + public function getActionChargeButton($charge, $action, $message, $label) { - return $this->getOrder()->getIncrementId(); + return sprintf( + '', + $action, + $charge->getOrderId()->getValue(), + $charge->getPagarmeId()->getValue(), + $message, + $label + ); } /** @@ -90,7 +161,7 @@ public function getTabLabel() */ public function getTabTitle() { - return __('Charges'); + return $this->getTabLabel(); } /** @@ -118,4 +189,35 @@ public function getChargeCaptureUrl() { return $this->_urlBuilder->getUrl('pagarme_pagarme/charges/capture'); } + + /** + * Retrieve order model instance + * + * @return Order + */ + private function getOrder() + { + return $this->registry->registry('current_order'); + } + + /** + * @return array + * @throws InvalidParamException + */ + private function getCharges() + { + return $this->chargeService->findChargesByIncrementId( + $this->getOrderIncrementId() + ); + } + + /** + * Retrieve order increment id + * + * @return string + */ + private function getOrderIncrementId() + { + return $this->getOrder()->getIncrementId(); + } } diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index 659bc07f..1803a452 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -25,7 +25,7 @@ use Pagarme\Core\Kernel\Abstractions\AbstractEntity; use Pagarme\Core\Recurrence\Repositories\ChargeRepository; use Pagarme\Core\Recurrence\Aggregates\Charge; -use Pagarme\Pagarme\Helper\NumberFormatHelper; +use Pagarme\Pagarme\Helper\HtmlTableHelper; class Invoice extends Template { @@ -50,30 +50,28 @@ class Invoice extends Template protected $coreRegistry; /** - * @var NumberFormatHelper + * @var HtmlTableHelper */ - private $numberFormatter; + private $htmlTableHelper; /** * @param Context $context * @param Session $customerSession * @param Registry $coreRegistry - * @param NumberFormatHelper $numberFormatter - * @throws AuthorizationException - * @throws InvalidParamException + * @param HtmlTableHelper $htmlTableHelper */ public function __construct( Context $context, Session $customerSession, Registry $coreRegistry, - NumberFormatHelper $numberFormatter + HtmlTableHelper $htmlTableHelper ) { parent::__construct($context, []); Magento2CoreSetup::bootstrap(); $this->coreRegistry = $coreRegistry; $this->customerSession = $customerSession; - $this->numberFormatter = $numberFormatter; + $this->htmlTableHelper = $htmlTableHelper; $this->chargeRepository = new ChargeRepository(); $this->subscriptionRepository = new SubscriptionRepository(); @@ -130,13 +128,13 @@ public function getInvoicesTableBody() foreach ($this->getAllChargesByCodeOrder() as $id => $item) { $tbody .= ""; $visualId = $id + 1; - $tbody .= $this->formatTableDataCell($visualId); - $tbody .= $this->formatNumberTableDataCell($item->getAmount()); - $tbody .= $this->formatNumberTableDataCell($item->getPaidAmount()); - $tbody .= $this->formatNumberTableDataCell($item->getCanceledAmount()); - $tbody .= $this->formatNumberTableDataCell($item->getRefundedAmount()); - $tbody .= $this->formatTableDataCell($item->getStatus()->getStatus()); - $tbody .= $this->formatTableDataCell($item->getPaymentMethod()->getPaymentMethod()); + $tbody .= $this->htmlTableHelper->formatTableDataCell($visualId); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getPaidAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getCanceledAmount()); + $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getRefundedAmount()); + $tbody .= $this->htmlTableHelper->formatTableDataCell($item->getStatus()->getStatus()); + $tbody .= $this->htmlTableHelper->formatTableDataCell($item->getPaymentMethod()->getPaymentMethod()); $tbody .= $this->addBilletButton($item); $tbody .= ''; } @@ -169,33 +167,6 @@ private function addBilletButton($item) return $button; } - /** - * @param mixed $text - * @return string - */ - private function formatTableDataCell($text) - { - return sprintf('%s', $text); - } - - /** - * @param mixed $number - * @return string - */ - private function formatNumberTableDataCell($number) - { - return $this->formatTableDataCell($this->formatNumber($number)); - } - - /** - * @param mixed $number - * @return false|string - */ - private function formatNumber($number) - { - return $this->numberFormatter->formatToLocalCurrency(($number) / 100); - } - /** * @return bool */ diff --git a/Block/Payment/Info/BilletCreditCard.php b/Block/Payment/Info/BilletCreditCard.php index 636fd545..d6cefa27 100644 --- a/Block/Payment/Info/BilletCreditCard.php +++ b/Block/Payment/Info/BilletCreditCard.php @@ -14,17 +14,16 @@ use Exception; use Magento\Framework\DataObject; use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\View\Element\Template\Context; use Magento\Payment\Block\Info\Cc; use Magento\Payment\Model\Config; -use Pagarme\Core\Kernel\Aggregates\Charge; use Pagarme\Core\Kernel\Aggregates\Order; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Core\Kernel\Services\OrderService; use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Concrete\Magento2PlatformOrderDecorator; -use Pagarme\Pagarme\Helper\NumberFormatHelper; use Pagarme\Pagarme\Helper\Payment\Billet as BilletHelper; class BilletCreditCard extends Cc @@ -32,17 +31,23 @@ class BilletCreditCard extends Cc const TEMPLATE = 'Pagarme_Pagarme::info/billetCreditCard.phtml'; /** - * @var NumberFormatHelper + * @var Data */ - private $numberFormatter; + private $priceHelper; + /** + * @param Context $context + * @param Config $paymentConfig + * @param Data $priceHelper + * @param array $data + */ public function __construct( Context $context, Config $paymentConfig, - NumberFormatHelper $numberFormatter, + Data $priceHelper, array $data = [] ) { - $this->numberFormatter = $numberFormatter; + $this->priceHelper = $priceHelper; parent::__construct($context, $paymentConfig, $data); } @@ -113,23 +118,23 @@ public function getBilletUrl() } /** - * @return false|string + * @return float|string * @throws LocalizedException */ public function getCcAmountWithTax() { $ccAmountWithTax = (float) $this->getInfo()->getAdditionalInformation('cc_cc_amount') + (float) $this->getInfo()->getAdditionalInformation('cc_cc_tax_amount'); - return $this->numberFormatter->formatToLocalCurrency($ccAmountWithTax); + return $this->priceHelper->currency($ccAmountWithTax); } /** - * @return false|string + * @return float|string * @throws LocalizedException */ public function getBilletAmount() { - return $this->numberFormatter->formatToLocalCurrency( + return $this->priceHelper->currency( $this->getInfo()->getAdditionalInformation('cc_billet_amount') ); } diff --git a/Helper/HtmlTableHelper.php b/Helper/HtmlTableHelper.php new file mode 100644 index 00000000..10414efe --- /dev/null +++ b/Helper/HtmlTableHelper.php @@ -0,0 +1,54 @@ +priceHelper = $priceHelper; + } + + /** + * @param string $text + * @param string $className + * @return string + */ + public function formatTableDataCell($text, $className = '') + { + $classAttribute = ''; + if (!empty($className)) { + $classAttribute = sprintf('class="%s"', $className); + } + return sprintf('%s', $classAttribute, $text); + } + + /** + * @param mixed $number + * @return string + */ + public function formatNumberTableDataCell($number) + { + return $this->formatTableDataCell($this->formatNumber($number)); + } + + /** + * @param mixed $number + * @return float|string + */ + private function formatNumber($number) + { + return $this->priceHelper->currency(($number) / 100); + } +} diff --git a/Service/Order/ChargeService.php b/Service/Order/ChargeService.php new file mode 100644 index 00000000..c15cbec7 --- /dev/null +++ b/Service/Order/ChargeService.php @@ -0,0 +1,32 @@ +findByPlatformId($incrementId); + + if ($order === null) { + return []; + } + + $chargeRepository = new ChargeRepository(); + return $chargeRepository->findByOrderId( + new OrderId($order->getPagarmeId()->getValue()) + ); + } +} diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 12edae6f..b0b00ed4 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -292,3 +292,12 @@ "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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 7b3b380e..e74a8584 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -471,3 +471,12 @@ "You must be logged in.","Você deve estar logado." "Created At","Criado em" "This order does not belong to this user","Esse pedido não pertence a esse usuário" +"Do you want to capture this charge?","Você deseja capturar esta cobrança?" +"Do you want to cancel this charge?","Você deseja cancelar esta cobrança?" +"Charges","Cobranças" +"Charge ID","ID da Cobrança" +"Paid Amount","Valor Pago" +"Canceled Amount","Valor Cancelado" +"Refunded Amount","Valor Reembolsado" +"Capture","Capturar" +"Cancel","Cancelar" diff --git a/view/adminhtml/layout/sales_order_view.xml b/view/adminhtml/layout/sales_order_view.xml index 41e61aad..54455250 100755 --- a/view/adminhtml/layout/sales_order_view.xml +++ b/view/adminhtml/layout/sales_order_view.xml @@ -1,14 +1,8 @@ - - - Pagarme_Pagarme::order/view/info.phtml - - - charges Pagarme\Pagarme\Block\Adminhtml\Order\Charge\Tab\View diff --git a/view/adminhtml/requirejs-config.js b/view/adminhtml/requirejs-config.js new file mode 100644 index 00000000..38839381 --- /dev/null +++ b/view/adminhtml/requirejs-config.js @@ -0,0 +1,7 @@ +const config = { + map: { + '*': { + orderCharge: 'Pagarme_Pagarme/js/view/order/orderCharge' + } + } +} diff --git a/view/adminhtml/templates/tab/view/order_charge.phtml b/view/adminhtml/templates/tab/view/order_charge.phtml index 4ddcb548..fa54038b 100644 --- a/view/adminhtml/templates/tab/view/order_charge.phtml +++ b/view/adminhtml/templates/tab/view/order_charge.phtml @@ -2,109 +2,37 @@ /** * @var $block \Pagarme\Pagarme\Block\Adminhtml\Order\Charge\Tab\View */ - -$objectManager = \Magento\Framework\App\ObjectManager::getInstance(); // Instance of Object Manager -$priceHelper = $objectManager->create('Magento\Framework\Pricing\Helper\Data'); // Instance of Pricing Helper - ?>
- +
- - - - - - + + + + + + - getCharges() as $charge) :?> - - - - - - - - - getCanceledAmount() <= 0) :?> - - - - - + getChargesTableBody() ?>
getPagarmeId()->getValue();?>currency($charge->getAmount() / 100, true, false); ?>currency($charge->getPaidAmount() / 100, true, false);?>currency($charge->getCanceledAmount() / 100, true, false);?>currency($charge->getRefundedAmount() / 100, true, false);?>getStatus()->getStatus();?> - - - -
- diff --git a/view/adminhtml/web/js/view/order/orderCharge.js b/view/adminhtml/web/js/view/order/orderCharge.js new file mode 100644 index 00000000..ea7e78ce --- /dev/null +++ b/view/adminhtml/web/js/view/order/orderCharge.js @@ -0,0 +1,47 @@ +define(['jquery', 'numberFormatter'], ($, numberFormatter) => { + return (config) => { + $('.charge-button').click(function(){ + const action = $(this).data('action'); + const charge = $(this).data('charge'); + const order = $(this).data('order'); + const amount = $(this).parent() + .parent() + .children('td.amount') + .children() + .val(); + const msg = $(this).data('message'); + if (confirm(msg)) { + let serviceUrl = config.urlCapture; + + if (action === 'cancel') { + serviceUrl = config.urlCancel; + } + serviceUrl += `amount/${amount}/chargeId/${charge}/orderId/${order}`; + + return $.ajax({ + method: 'GET', + beforeSend: function(request) { + request.setRequestHeader('Content-type', 'application/json'); + }, + url: serviceUrl, + showLoader: true, + cache: false, + success: function(data) { + if (data.code === 200) { + document.location.reload(); + } + alert(data.message); + } + }); + } + }); + + const amountValueElement = $('.amount-value'); + amountValueElement.keyup(function(){ + let amountValue = $(this).val(); + amountValue = numberFormatter.formatToPrice(amountValue); + return $(this).val(amountValue); + }); + amountValueElement.keyup(); + } +}); diff --git a/view/base/requirejs-config.js b/view/base/requirejs-config.js new file mode 100644 index 00000000..868164c2 --- /dev/null +++ b/view/base/requirejs-config.js @@ -0,0 +1,7 @@ +const config = { + map: { + '*': { + numberFormatter: 'Pagarme_Pagarme/js/helper/numberFormatter' + } + } +} diff --git a/view/base/web/js/helper/numberFormatter.js b/view/base/web/js/helper/numberFormatter.js new file mode 100644 index 00000000..def28211 --- /dev/null +++ b/view/base/web/js/helper/numberFormatter.js @@ -0,0 +1,10 @@ +define([], () => { + return { + formatToPrice: (number) => { + return number.replace(/\D/g,"") + .replace(/(\d)(\d{8})$/,"$1.$2") + .replace(/(\d)(\d{5})$/,"$1.$2") + .replace(/(\d)(\d{2})$/,"$1,$2"); + } + } +}) From 03d1c62786b5f65395ad7dca49d45adc936d9270 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Thu, 20 Jul 2023 19:19:55 -0300 Subject: [PATCH 14/83] removing unnecessary return statement --- view/adminhtml/web/js/view/order/orderCharge.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/adminhtml/web/js/view/order/orderCharge.js b/view/adminhtml/web/js/view/order/orderCharge.js index ea7e78ce..496ebbe0 100644 --- a/view/adminhtml/web/js/view/order/orderCharge.js +++ b/view/adminhtml/web/js/view/order/orderCharge.js @@ -18,7 +18,7 @@ define(['jquery', 'numberFormatter'], ($, numberFormatter) => { } serviceUrl += `amount/${amount}/chargeId/${charge}/orderId/${order}`; - return $.ajax({ + $.ajax({ method: 'GET', beforeSend: function(request) { request.setRequestHeader('Content-type', 'application/json'); From 361921800707b4027fd3d196ea8fd168502151e9 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Fri, 21 Jul 2023 10:27:22 -0300 Subject: [PATCH 15/83] changing space location in html generator --- Helper/HtmlTableHelper.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Helper/HtmlTableHelper.php b/Helper/HtmlTableHelper.php index 10414efe..faadd32d 100644 --- a/Helper/HtmlTableHelper.php +++ b/Helper/HtmlTableHelper.php @@ -29,9 +29,9 @@ public function formatTableDataCell($text, $className = '') { $classAttribute = ''; if (!empty($className)) { - $classAttribute = sprintf('class="%s"', $className); + $classAttribute = sprintf(' class="%s"', $className); } - return sprintf('%s', $classAttribute, $text); + return sprintf('%s', $classAttribute, $text); } /** From 34a03227ee72558b73f1e71a307159b4f737064e Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Fri, 21 Jul 2023 15:00:14 -0300 Subject: [PATCH 16/83] Refactoring twoCreditCard info class and phtml --- Block/Payment/Info/CreditCard.php | 3 +- Block/Payment/Info/TwoCreditCard.php | 100 ++++++++++++++---- .../templates/info/twoCreditCard.phtml | 52 ++++----- 3 files changed, 106 insertions(+), 49 deletions(-) diff --git a/Block/Payment/Info/CreditCard.php b/Block/Payment/Info/CreditCard.php index a4e2121c..9d15ecbe 100644 --- a/Block/Payment/Info/CreditCard.php +++ b/Block/Payment/Info/CreditCard.php @@ -97,13 +97,14 @@ public function getTransactionInfo() $platformOrder = $this->loadPlatformOrderByIncrementId($orderEntityId); $orderPagarmeId = $platformOrder->getPagarmeId(); + if ($orderPagarmeId === null) { return []; } $orderObject = $this->getOrderObjectByPagarmeId($orderService, $orderPagarmeId); - if ($orderObject === null) { + if ($orderObject === null || !is_object($orderObject)) { return []; } diff --git a/Block/Payment/Info/TwoCreditCard.php b/Block/Payment/Info/TwoCreditCard.php index 28e27b06..49af1cc0 100644 --- a/Block/Payment/Info/TwoCreditCard.php +++ b/Block/Payment/Info/TwoCreditCard.php @@ -1,6 +1,6 @@ setTemplate(self::TEMPLATE); } + /** + * @return string + */ public function getCcType() { return $this->getCcTypeName(); } + /** + * @return string + */ public function getCardNumber() { return '**** **** **** ' . $this->getInfo()->getCcLast4(); } + /** + * @return mixed + */ public function getTitle() { return $this->getInfo()->getAdditionalInformation('method_title'); } + /** + * @return mixed + */ public function getInstallments() { return $this->getInfo()->getAdditionalInformation('cc_installments'); } + /** + * @return mixed + */ public function getInstallmentsFirstCard() { return $this->getInfo()->getAdditionalInformation('cc_installments_first'); } + /** + * @return mixed + */ public function getCcTypeFirst() { return $this->getInfo()->getAdditionalInformation('cc_type_first'); } + /** + * @return float + */ public function getFirstCardAmount() { return (float)$this->getInfo()->getAdditionalInformation('cc_first_card_amount') + (float)$this->getInfo()->getAdditionalInformation('cc_first_card_tax_amount'); } + /** + * @return string + */ public function getFirstCardLast4() { return '**** **** **** ' . $this->getInfo()->getAdditionalInformation('cc_last_4_first'); } + /** + * @return mixed + */ public function getInstallmentsSecondCard() { return $this->getInfo()->getAdditionalInformation('cc_installments_second'); } + /** + * @return mixed + */ public function getCcTypeSecond() { return $this->getInfo()->getAdditionalInformation('cc_type_second'); } + /** + * @return float + */ public function getSecondCardAmount() { return (float)$this->getInfo()->getAdditionalInformation('cc_second_card_amount') + (float)$this->getInfo()->getAdditionalInformation('cc_second_card_tax_amount'); } + /** + * @return string + */ public function getSecondCardLast4() { return '**** **** **** ' . $this->getInfo()->getAdditionalInformation('cc_last_4_second'); @@ -101,9 +139,7 @@ public function getTransactionInfo() $orderService = new OrderService(); $orderEntityId = $this->getInfo()->getOrder()->getIncrementId(); - - $platformOrder = new Magento2PlatformOrderDecorator(); - $platformOrder->loadByIncrementId($orderEntityId); + $platformOrder = $this->loadPlatformOrderByIncrementId($orderEntityId); $orderPagarmeId = $platformOrder->getPagarmeId(); @@ -111,27 +147,47 @@ public function getTransactionInfo() return []; } - /** - * @var Order orderObject - */ - $orderObject = $orderService->getOrderByPagarmeId(new OrderId($orderPagarmeId)); + $orderObject = $this->getOrderObjectByPagarmeId($orderService, $orderPagarmeId); - if ($orderObject === null) { + if ($orderObject === null || !is_object($orderObject)) { return []; } - if (is_object($orderObject->getCharges())) { - return [ - 'card1' => array_merge( - $orderObject->getCharges()[0]->getAcquirerTidCapturedAndAutorize(), - ['tid' => $this->getTid($orderObject->getCharges()[0])] - ), - 'card2' => array_merge( - $orderObject->getCharges()[1]->getAcquirerTidCapturedAndAutorize(), - ['tid' => $this->getTid($orderObject->getCharges()[1])] - ) - ]; - } + $chargeOne = current($orderObject->getCharges()); + $chargeTwo = next($chargeOne); + + return [ + 'card1' => array_merge( + $chargeOne->getAcquirerTidCapturedAndAutorize(), + ['tid' => $this->getTid($chargeOne)] + ), + 'card2' => array_merge( + $chargeTwo->getAcquirerTidCapturedAndAutorize(), + ['tid' => $this->getTid($chargeTwo)] + ) + ]; + } + + /** + * @param mixed $incrementId + * @return Magento2PlatformOrderDecorator + */ + private function loadPlatformOrderByIncrementId($incrementId) + { + $platformOrder = new Magento2PlatformOrderDecorator(); + $platformOrder->loadByIncrementId($incrementId); + return $platformOrder; + } + + /** + * @param mixed $orderService + * @param mixed $pagarmeId + * @return mixed + */ + private function getOrderObjectByPagarmeId($orderService, $pagarmeId) + { + $orderId = new OrderId($pagarmeId); + return $orderService->getOrderByPagarmeId($orderId); } private function getTid(Charge $charge) diff --git a/view/frontend/templates/info/twoCreditCard.phtml b/view/frontend/templates/info/twoCreditCard.phtml index 9bd562c4..09e00de7 100644 --- a/view/frontend/templates/info/twoCreditCard.phtml +++ b/view/frontend/templates/info/twoCreditCard.phtml @@ -1,26 +1,26 @@ -getCcTypeFirst() && $this->getCcTypeSecond()): ?> - getTitle()); ?> -
-
- -
- : getCcTypeFirst(); ?> -
- : getFirstCardLast4(); ?> -
- : getInstallmentsFirstCard(); ?> -
- : getFirstCardAmount(),2,',','.'); ?> -
-
- -
- : getCcTypeSecond(); ?> -
- : getSecondCardLast4(); ?> -
- : getInstallmentsSecondCard(); ?> -
- : getSecondCardAmount(),2,',','.'); ?> - - + +

getTitle()); ?>

+

+

+ : getCcTypeFirst()); ?>
+ : getFirstCardLast4(); ?>
+ : getInstallmentsFirstCard(); ?>
+ : getFirstCardAmount(),2,',','.'); ?> +

+

+

+ : getCcTypeSecond()); ?>
+ : getSecondCardLast4(); ?>
+ : getInstallmentsSecondCard(); ?>
+ : getSecondCardAmount(),2,',','.'); ?> +

From 88a5ab3745c8c5e97e80b46332af638d8e1877ec Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Mon, 24 Jul 2023 19:04:34 -0300 Subject: [PATCH 17/83] refactoring pix block and template --- Block/Payment/Pix.php | 59 ++++++++- i18n/en_US.csv | 8 +- i18n/pt_BR.csv | 8 +- .../layout/checkout_onepage_success.xml | 3 + view/frontend/requirejs-config.js | 5 + view/frontend/templates/payment/pix.phtml | 119 +++++++----------- .../frontend/web/css/pagarme_success_page.css | 64 ++++++++++ .../js/view/payment/checkout/success/pix.js | 39 ++++++ 8 files changed, 223 insertions(+), 82 deletions(-) create mode 100644 view/frontend/web/css/pagarme_success_page.css create mode 100644 view/frontend/web/js/view/payment/checkout/success/pix.js diff --git a/Block/Payment/Pix.php b/Block/Payment/Pix.php index 7f6a997e..c2a74038 100644 --- a/Block/Payment/Pix.php +++ b/Block/Payment/Pix.php @@ -19,7 +19,16 @@ use Pagarme\Pagarme\Helper\Payment\Pix as PixHelper; class Pix extends Template { + /** + * @var CheckoutSession + */ protected $checkoutSession; + + /** + * @var array + */ + private $pixInfo; + /** * Link constructor. * @param Context $context @@ -61,12 +70,56 @@ protected function getPayment() return $this->getLastOrder()->getPayment(); } + /** + * @return bool + */ + public function showPixInformation() + { + return !empty($this->getPixInfo()); + } + + /** + * @return mixed + */ + public function getPixUrl() + { + return $this->getPixInfo()['qr_code_url'] ?? ''; + } + + /** + * @return mixed + */ + public function getPixQrCode() + { + return $this->getPixInfo()['qr_code'] ?? ''; + } + /** * @return string */ - public function getPixInfo() + public function getErrorCopyMessage() { - $pixHelper = new PixHelper(); - return $pixHelper->getQrCode($this->getPayment()); + return __('Failed to copy! Please, manually copy the code using the field bellow the button.'); + } + + /** + * @return string + */ + public function getSuccessMessage() + { + return __('Copied PIX code!'); + } + + /** + * @return array + */ + private function getPixInfo() + { + if (empty($this->pixInfo)) { + $pixHelper = new PixHelper(); + $this->pixInfo = $pixHelper->getQrCode($this->getPayment()); + } + + return $this->pixInfo; } } diff --git a/i18n/en_US.csv b/i18n/en_US.csv index b0b00ed4..80c4ff9a 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -300,4 +300,10 @@ "Canceled Amount","Canceled Amount" "Refunded Amount","Refunded Amount" "Capture","Capture" -"Cancel","Cancel" +"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." +"Copied PIX code!","Copied PIX code!" +"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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index e74a8584..a6d6343f 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -479,4 +479,10 @@ "Canceled Amount","Valor Cancelado" "Refunded Amount","Valor Reembolsado" "Capture","Capturar" -"Cancel","Cancelar" +"Cancel","Cancelar", +"Failed to copy! Please, manually copy the code using the field bellow the button.","Falha ao copiar! Por favor, copie o código manualmente utilizando o campo abaixo do botão." +"Copied PIX code!","Código PIX copiado!" +"Copy PIX code","Copiar código PIX" +"Open your bank app","Abra o app do seu banco" +"Scan the QR Code","Escaneie o QR Code" +"Confirm the payment","Confirme o pagamento" diff --git a/view/frontend/layout/checkout_onepage_success.xml b/view/frontend/layout/checkout_onepage_success.xml index 2090b0ae..f25748f6 100755 --- a/view/frontend/layout/checkout_onepage_success.xml +++ b/view/frontend/layout/checkout_onepage_success.xml @@ -9,6 +9,9 @@ */ --> + + + getPixInfo(); -if (!empty($pixInfo)): +/** + * @var \Pagarme\Pagarme\Block\Payment\Pix $block + */ +if ($block->showPixInformation()): ?>
-
- -
- +
+
+ pix logo
- - - -
- - - +
+ pix qr code
- - - -
- -
-
+ -
- - - -
-
-
Abra o app do seu banco
-
- 1
+
+
+
+
1
-
-
Escaneie o QR Code
-
- 2
+
+
+
2
-
-
Confirme o pagamento
-
- 3
+
+
+
3
-
- - - \ No newline at end of file + diff --git a/view/frontend/web/css/pagarme_success_page.css b/view/frontend/web/css/pagarme_success_page.css new file mode 100644 index 00000000..efdcfc0c --- /dev/null +++ b/view/frontend/web/css/pagarme_success_page.css @@ -0,0 +1,64 @@ +.pix-wrapper { + margin: 0 auto; + width: 360px; +} + +.pix-wrapper .pix-logo-wrapper { + margin: 0 auto 30px; + text-align: center; +} + +.pix-wrapper .qr-code-wrapper { + margin: 0 auto 10px; + text-align: center; +} + +.pix-wrapper .copy-qr-code-wrapper { + margin: 0 auto 0; + min-height: 10px; + text-align: center; +} + +.pix-wrapper .copy-qr-code-wrapper .copy-inline { + display: inline-block; + padding-bottom: 32px; +} + +.pix-wrapper .copy-qr-code-wrapper .copy-inline svg { + display: inline-block; + vertical-align: middle; + margin: 0 5px 0 0; + width: 20px; +} + +.pix-wrapper .copy-qr-code-wrapper .copy-inline a { + display: inline-block; + vertical-align: middle; + margin: 0 5px 0 0; + cursor: pointer; +} + +.pix-wrapper .copy-qr-code-wrapper .copy-inline input { + margin: 1.5em 0; + display: none; +} + +.pix-wrapper .pix-instructions-wrapper { + margin: 0 auto 30px; + text-align: center; +} + +.pix-wrapper .pix-instructions-wrapper .pix-instruction { + display: inline-block; + vertical-align: top; + margin: 0 10px; + width: 25%; +} + +.pix-wrapper .pix-instructions-wrapper .pix-instruction .pix-instruction-number { + display: inline-block; + background-color: gainsboro; + border-radius: 50%; + padding: 10px 15px; + margin-top: 10px; +} diff --git a/view/frontend/web/js/view/payment/checkout/success/pix.js b/view/frontend/web/js/view/payment/checkout/success/pix.js new file mode 100644 index 00000000..122ce3ac --- /dev/null +++ b/view/frontend/web/js/view/payment/checkout/success/pix.js @@ -0,0 +1,39 @@ +define(['jquery'], ($) => { + return (config) => { + $('.copy-pix').click(async () => { + const qrCodeJqueryElement = $('#pagarme_qr_code'); + + if (qrCodeJqueryElement.length < 1) { + return; + } + + const rawCode = qrCodeJqueryElement.attr("value"); + const alternativeCopyQrCode = () => { + qrCodeJqueryElement.show(); + qrCodeJqueryElement.focus(); + qrCodeJqueryElement.select(); + alert(config.errorCopyMessage); + }; + + if (window.isSecureContext && navigator.clipboard) { + try { + await navigator.clipboard.writeText(rawCode); + alert(config.successCopyMessage); + } catch (err) { + alternativeCopyQrCode(rawCode); + } + return; + } + + const [qrCodeDOMElement] = qrCodeJqueryElement; + qrCodeDOMElement.select(); + qrCodeDOMElement.setSelectionRange(0, qrCodeJqueryElement.val().length); + try { + document.execCommand('copy', false); + alert(config.successCopyMessage); + } catch (err) { + alternativeCopyQrCode(rawCode); + } + }); + }; +}); From b0417a76be0eba10068a33c81df2a0ab4f0a173c Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Mon, 24 Jul 2023 19:10:52 -0300 Subject: [PATCH 18/83] removing unnecessary parameter passage --- view/frontend/web/js/view/payment/checkout/success/pix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/frontend/web/js/view/payment/checkout/success/pix.js b/view/frontend/web/js/view/payment/checkout/success/pix.js index 122ce3ac..3438a6ab 100644 --- a/view/frontend/web/js/view/payment/checkout/success/pix.js +++ b/view/frontend/web/js/view/payment/checkout/success/pix.js @@ -20,7 +20,7 @@ define(['jquery'], ($) => { await navigator.clipboard.writeText(rawCode); alert(config.successCopyMessage); } catch (err) { - alternativeCopyQrCode(rawCode); + alternativeCopyQrCode(); } return; } @@ -32,7 +32,7 @@ define(['jquery'], ($) => { document.execCommand('copy', false); alert(config.successCopyMessage); } catch (err) { - alternativeCopyQrCode(rawCode); + alternativeCopyQrCode(); } }); }; From 0d95b549304b47a23809b4556dd4cdfe09d1180e Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 25 Jul 2023 09:59:00 -0300 Subject: [PATCH 19/83] injecting PixHelper via di --- Block/Payment/Pix.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Block/Payment/Pix.php b/Block/Payment/Pix.php index c2a74038..845e34de 100644 --- a/Block/Payment/Pix.php +++ b/Block/Payment/Pix.php @@ -29,14 +29,20 @@ class Pix extends Template */ private $pixInfo; + /** + * @var PixHelper + */ + private $pixHelper; + /** * Link constructor. * @param Context $context * @param CheckoutSession $checkoutSession */ - public function __construct(Context $context, CheckoutSession $checkoutSession) + public function __construct(Context $context, CheckoutSession $checkoutSession, PixHelper $pixHelper) { $this->checkoutSession = $checkoutSession; + $this->pixHelper = $pixHelper; parent::__construct($context, []); } @@ -116,8 +122,7 @@ public function getSuccessMessage() private function getPixInfo() { if (empty($this->pixInfo)) { - $pixHelper = new PixHelper(); - $this->pixInfo = $pixHelper->getQrCode($this->getPayment()); + $this->pixInfo = $this->pixHelper->getQrCode($this->getPayment()); } return $this->pixInfo; From 78d23ad46969d8daf5d9e2b7c7cbe9ff3da5dc44 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 25 Jul 2023 15:40:28 -0300 Subject: [PATCH 20/83] fixing text and adding space between use statements and class declaration --- Block/Payment/Pix.php | 3 ++- i18n/en_US.csv | 2 +- i18n/pt_BR.csv | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Block/Payment/Pix.php b/Block/Payment/Pix.php index 845e34de..43f0bdd0 100644 --- a/Block/Payment/Pix.php +++ b/Block/Payment/Pix.php @@ -17,6 +17,7 @@ use Magento\Sales\Api\Data\OrderInterface as Order; use Magento\Sales\Api\Data\OrderPaymentInterface as Payment; use Pagarme\Pagarme\Helper\Payment\Pix as PixHelper; + class Pix extends Template { /** @@ -113,7 +114,7 @@ public function getErrorCopyMessage() */ public function getSuccessMessage() { - return __('Copied PIX code!'); + return __('PIX code copied!'); } /** diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 80c4ff9a..404250ef 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -302,7 +302,7 @@ "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." -"Copied PIX code!","Copied PIX code!" +"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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index a6d6343f..45a172b7 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -481,7 +481,7 @@ "Capture","Capturar" "Cancel","Cancelar", "Failed to copy! Please, manually copy the code using the field bellow the button.","Falha ao copiar! Por favor, copie o código manualmente utilizando o campo abaixo do botão." -"Copied PIX code!","Código PIX copiado!" +"PIX code copied!","Código PIX copiado!" "Copy PIX code","Copiar código PIX" "Open your bank app","Abra o app do seu banco" "Scan the QR Code","Escaneie o QR Code" From 3d037f3b054b28e3dcfb049b70dc729ce711ff3b Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Wed, 26 Jul 2023 17:45:13 -0300 Subject: [PATCH 21/83] refactor: Refactoring billet info class and phtml --- Block/Payment/Info/Billet.php | 53 ++++++++++++++++++----- view/frontend/templates/info/billet.phtml | 28 +++++++++--- 2 files changed, 66 insertions(+), 15 deletions(-) diff --git a/Block/Payment/Info/Billet.php b/Block/Payment/Info/Billet.php index bdaee8b9..6cafed91 100644 --- a/Block/Payment/Info/Billet.php +++ b/Block/Payment/Info/Billet.php @@ -11,9 +11,8 @@ namespace Pagarme\Pagarme\Block\Payment\Info; - -use Magento\Payment\Block\Info; use Magento\Framework\DataObject; +use Magento\Payment\Block\Info; use Pagarme\Core\Kernel\Services\OrderService; use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; @@ -24,6 +23,9 @@ class Billet extends Info { const TEMPLATE = 'Pagarme_Pagarme::info/billet.phtml'; + /** + * @return void + */ public function _construct() { $this->setTemplate(self::TEMPLATE); @@ -42,17 +44,31 @@ protected function _prepareSpecificInformation($transport = null) return $transport; } + /** + * @return string|null + */ public function getBilletUrl() { $billetHelper = new BilletHelper(); return $billetHelper->getBilletUrl($this->getInfo()); } + /** + * @return mixed + */ public function getTitle() { return $this->getInfo()->getAdditionalInformation('method_title'); } + public function showBilletUrl() + { + if($this->getInfo()->getOrder()->getStatus() !== 'pending'){ + return false; + } + return true; + } + /** * @return mixed * @throws \Magento\Framework\Exception\LocalizedException @@ -64,9 +80,7 @@ public function getTransactionInfo() $orderService = new OrderService(); $orderEntityId = $this->getInfo()->getOrder()->getIncrementId(); - - $platformOrder = new Magento2PlatformOrderDecorator(); - $platformOrder->loadByIncrementId($orderEntityId); + $platformOrder = $this->loadPlatformOrderByIncrementId($orderEntityId); $orderPagarmeId = $platformOrder->getPagarmeId(); @@ -74,15 +88,34 @@ public function getTransactionInfo() return []; } - /** - * @var \Pagarme\Core\Kernel\Aggregates\Order orderObject - */ - $orderObject = $orderService->getOrderByPagarmeId(new OrderId($orderPagarmeId)); + $orderObject = $this->getOrderObjectByPagarmeId($orderService, $orderPagarmeId); if ($orderObject === null) { return []; } - return $orderObject->getCharges()[0]->getLastTransaction(); + return current($orderObject->getCharges())->getLastTransaction(); + } + + /** + * @param mixed $incrementId + * @return Magento2PlatformOrderDecorator + */ + private function loadPlatformOrderByIncrementId($incrementId) + { + $platformOrder = new Magento2PlatformOrderDecorator(); + $platformOrder->loadByIncrementId($incrementId); + return $platformOrder; + } + + /** + * @param mixed $orderService + * @param mixed $pagarmeId + * @return mixed + */ + private function getOrderObjectByPagarmeId($orderService, $pagarmeId) + { + $orderId = new OrderId($pagarmeId); + return $orderService->getOrderByPagarmeId($orderId); } } diff --git a/view/frontend/templates/info/billet.phtml b/view/frontend/templates/info/billet.phtml index 94a69099..a14152c1 100644 --- a/view/frontend/templates/info/billet.phtml +++ b/view/frontend/templates/info/billet.phtml @@ -1,7 +1,25 @@ -getBilletUrl() && $this->getInfo()->getOrder()->getStatus() == 'pending'): ?> - getTitle()) ?> + + +

getTitle()) ?>

+showBilletUrl()): ?>
- - - getTitle()) ?> +

+ + + +

From 81d9ddbf84de289f358ee093922f206f05dffda8 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:31:28 -0300 Subject: [PATCH 22/83] refactor: pix in the admin and customer view (#212) --- Block/Payment/Info/Pix.php | 14 ++- Block/Payment/Pix.php | 22 +---- .../Base/Command/AuthorizeCommand.php | 21 +++++ .../AbstractAddressDataProvider.php | 62 +++++++++++++ .../Create/RequestDataProvider.php | 61 ++----------- .../Create/RequestDataProvider.php | 61 ++----------- .../Create/RequestDataProvider.php | 62 ++----------- .../Create/RequestDataProvider.php | 59 +++++++++++++ .../Create/Response/Validator.php | 34 +++++++ .../Create/RequestDataProvider.php | 59 +------------ Helper/Payment/Pix.php | 88 +++++++++++++------ etc/di.xml | 24 +++-- view/adminhtml/templates/info/pix.phtml | 42 ++------- view/frontend/templates/info/pix.phtml | 24 +++-- view/frontend/templates/payment/pix.phtml | 4 +- 15 files changed, 305 insertions(+), 332 deletions(-) create mode 100644 Gateway/Transaction/Base/Command/AuthorizeCommand.php create mode 100644 Gateway/Transaction/Base/ResourceGateway/AbstractAddressDataProvider.php create mode 100644 Gateway/Transaction/Pix/ResourceGateway/Create/RequestDataProvider.php create mode 100644 Gateway/Transaction/Pix/ResourceGateway/Create/Response/Validator.php diff --git a/Block/Payment/Info/Pix.php b/Block/Payment/Info/Pix.php index b39cf86f..ec54c2c5 100644 --- a/Block/Payment/Info/Pix.php +++ b/Block/Payment/Info/Pix.php @@ -22,13 +22,13 @@ public function _construct() } /** - * @return string|null + * @return PixHelper * @throws LocalizedException */ public function getPixInfo() { $pixHelper = new PixHelper(); - return $pixHelper->getQrCode($this->getInfo()); + return $pixHelper->getInfo($this->getInfo()); } public function getTitle() @@ -65,7 +65,15 @@ public function getTransactionInfo() if ($orderObject === null) { return []; } + $charge = current($orderObject->getCharges()); + return $charge->getLastTransaction(); + } - return $orderObject->getCharges()[0]->getLastTransaction(); + public function showPrintButton() + { + if (!empty($this->getPixInfo()) && $this->getInfo()->getOrder()->getStatus() == 'pending') { + return true; + } + return false; } } diff --git a/Block/Payment/Pix.php b/Block/Payment/Pix.php index 43f0bdd0..ee71fea9 100644 --- a/Block/Payment/Pix.php +++ b/Block/Payment/Pix.php @@ -85,22 +85,6 @@ public function showPixInformation() return !empty($this->getPixInfo()); } - /** - * @return mixed - */ - public function getPixUrl() - { - return $this->getPixInfo()['qr_code_url'] ?? ''; - } - - /** - * @return mixed - */ - public function getPixQrCode() - { - return $this->getPixInfo()['qr_code'] ?? ''; - } - /** * @return string */ @@ -118,12 +102,12 @@ public function getSuccessMessage() } /** - * @return array + * @return PixHelper */ - private function getPixInfo() + public function getPixInfo() { if (empty($this->pixInfo)) { - $this->pixInfo = $this->pixHelper->getQrCode($this->getPayment()); + $this->pixInfo = $this->pixHelper->getInfo($this->getPayment()); } return $this->pixInfo; diff --git a/Gateway/Transaction/Base/Command/AuthorizeCommand.php b/Gateway/Transaction/Base/Command/AuthorizeCommand.php new file mode 100644 index 00000000..54e27815 --- /dev/null +++ b/Gateway/Transaction/Base/Command/AuthorizeCommand.php @@ -0,0 +1,21 @@ +getShippingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); + } + + return $this->getBillingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); + } + + /** + * @return string + */ + public function getCustomerAddressNumber($shipping) + { + if ($shipping) { + return $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); + } + + return $this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); + } + + /** + * @return string + */ + public function getCustomerAddressComplement($shipping) + { + if ($shipping) { + return !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()) ? 'street_3' : $this->getConfig()->getCustomerAddressComplement(); + } + + return !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressComplement()) ? 'street_3' : $this->getConfig()->getCustomerAddressComplement(); + } + + /** + * @return string + */ + public function getCustomerAddressDistrict($shipping) + { + if ($shipping) { + $streetLine = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_4' : $this->getConfig()->getCustomerAddressDistrict(); + return $this->getShippingAddressAttribute($streetLine); + } + $streetLine = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_4' : $this->getConfig()->getCustomerAddressDistrict(); + return $this->getBillingAddressAttribute($streetLine); + } + + +} diff --git a/Gateway/Transaction/Billet/ResourceGateway/Create/RequestDataProvider.php b/Gateway/Transaction/Billet/ResourceGateway/Create/RequestDataProvider.php index 071ec236..4fc872d9 100644 --- a/Gateway/Transaction/Billet/ResourceGateway/Create/RequestDataProvider.php +++ b/Gateway/Transaction/Billet/ResourceGateway/Create/RequestDataProvider.php @@ -11,7 +11,7 @@ namespace Pagarme\Pagarme\Gateway\Transaction\Billet\ResourceGateway\Create; - +use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractAddressDataProvider; use Magento\Checkout\Model\Session; use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Payment\Model\InfoInterface; @@ -21,9 +21,12 @@ use Pagarme\Pagarme\Helper\CustomerAddressInterface; class RequestDataProvider - extends AbstractRequestDataProvider + extends AbstractAddressDataProvider implements BilletRequestDataProviderInterface { + /** + * @var ConfigInterface + */ protected $config; public function __construct ( @@ -80,58 +83,4 @@ protected function setConfig(ConfigInterface $config) return $this; } - /** - * @return string - */ - public function getCustomerAddressStreet($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - /** - * @return string - */ - public function getCustomerAddressNumber($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - /** - * @return string - */ - public function getCustomerAddressComplement($shipping) - { - if ($shipping) { - $response = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - }else{ - $response = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - } - - return $response; - } - - /** - * @return string - */ - public function getCustomerAddressDistrict($shipping) - { - if ($shipping) { - $streetLine = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getShippingAddressAttribute($streetLine); - }else{ - $streetLine = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getBillingAddressAttribute($streetLine); - } - - return $response; - } - } diff --git a/Gateway/Transaction/BilletCreditCard/ResourceGateway/Create/RequestDataProvider.php b/Gateway/Transaction/BilletCreditCard/ResourceGateway/Create/RequestDataProvider.php index e5ff48c9..1cb85c68 100644 --- a/Gateway/Transaction/BilletCreditCard/ResourceGateway/Create/RequestDataProvider.php +++ b/Gateway/Transaction/BilletCreditCard/ResourceGateway/Create/RequestDataProvider.php @@ -19,11 +19,15 @@ use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractRequestDataProvider; use Pagarme\Pagarme\Gateway\Transaction\CreditCard\Config\ConfigInterface; use Pagarme\Pagarme\Helper\CustomerAddressInterface; +use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractAddressDataProvider; class RequestDataProvider - extends AbstractRequestDataProvider + extends AbstractAddressDataProvider implements BilletCreditCardRequestDataProviderInterface { + /** + * @var ConfigInterface + */ protected $config; public function __construct ( @@ -204,59 +208,4 @@ protected function setConfig(ConfigInterface $config) return $this; } - - /** - * @return string - */ - public function getCustomerAddressStreet($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - /** - * @return string - */ - public function getCustomerAddressNumber($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - /** - * @return string - */ - public function getCustomerAddressComplement($shipping) - { - if ($shipping) { - $response = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - }else{ - $response = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - } - - return $response; - } - - /** - * @return string - */ - public function getCustomerAddressDistrict($shipping) - { - if ($shipping) { - $streetLine = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getShippingAddressAttribute($streetLine); - }else{ - $streetLine = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getBillingAddressAttribute($streetLine); - } - - return $response; - } - } diff --git a/Gateway/Transaction/CreditCard/ResourceGateway/Create/RequestDataProvider.php b/Gateway/Transaction/CreditCard/ResourceGateway/Create/RequestDataProvider.php index eacfcf40..a26d3e5b 100644 --- a/Gateway/Transaction/CreditCard/ResourceGateway/Create/RequestDataProvider.php +++ b/Gateway/Transaction/CreditCard/ResourceGateway/Create/RequestDataProvider.php @@ -16,14 +16,17 @@ use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Payment\Model\InfoInterface; use Pagarme\Pagarme\Api\CreditCardRequestDataProviderInterface; -use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractRequestDataProvider; +use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractAddressDataProvider; use Pagarme\Pagarme\Gateway\Transaction\CreditCard\Config\ConfigInterface; use Pagarme\Pagarme\Helper\CustomerAddressInterface; class RequestDataProvider - extends AbstractRequestDataProvider + extends AbstractAddressDataProvider implements CreditCardRequestDataProviderInterface { + /** + * @var ConfigInterface + */ protected $config; public function __construct ( @@ -195,59 +198,4 @@ protected function setConfig(ConfigInterface $config) $this->config = $config; return $this; } - - /** - * @return string - */ - public function getCustomerAddressStreet($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - /** - * @return string - */ - public function getCustomerAddressNumber($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressNumber()); - } - - /** - * @return string - */ - public function getCustomerAddressComplement($shipping) - { - if ($shipping) { - $response = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - }else{ - $response = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - } - - return $response; - } - - /** - * @return string - */ - public function getCustomerAddressDistrict($shipping) - { - if ($shipping) { - $streetLine = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getShippingAddressAttribute($streetLine); - }else{ - $streetLine = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getBillingAddressAttribute($streetLine); - } - - return $response; - } - } diff --git a/Gateway/Transaction/Pix/ResourceGateway/Create/RequestDataProvider.php b/Gateway/Transaction/Pix/ResourceGateway/Create/RequestDataProvider.php new file mode 100644 index 00000000..5332cf47 --- /dev/null +++ b/Gateway/Transaction/Pix/ResourceGateway/Create/RequestDataProvider.php @@ -0,0 +1,59 @@ +setConfig($config); + } + + /** + * @return ConfigInterface + */ + protected function getConfig() + { + return $this->config; + } + + /** + * @param ConfigInterface $config + * @return $this + */ + protected function setConfig($config) + { + $this->config = $config; + return $this; + } + +} diff --git a/Gateway/Transaction/Pix/ResourceGateway/Create/Response/Validator.php b/Gateway/Transaction/Pix/ResourceGateway/Create/Response/Validator.php new file mode 100644 index 00000000..be931876 --- /dev/null +++ b/Gateway/Transaction/Pix/ResourceGateway/Create/Response/Validator.php @@ -0,0 +1,34 @@ +createResult($isValid, $fails); + } +} diff --git a/Gateway/Transaction/TwoCreditCard/ResourceGateway/Create/RequestDataProvider.php b/Gateway/Transaction/TwoCreditCard/ResourceGateway/Create/RequestDataProvider.php index 431a982e..bf509311 100644 --- a/Gateway/Transaction/TwoCreditCard/ResourceGateway/Create/RequestDataProvider.php +++ b/Gateway/Transaction/TwoCreditCard/ResourceGateway/Create/RequestDataProvider.php @@ -16,12 +16,12 @@ use Magento\Payment\Gateway\Data\OrderAdapterInterface; use Magento\Payment\Model\InfoInterface; use Pagarme\Pagarme\Api\CreditCardRequestDataProviderInterface; -use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractRequestDataProvider; use Pagarme\Pagarme\Gateway\Transaction\TwoCreditCard\Config\ConfigInterface; use Pagarme\Pagarme\Helper\CustomerAddressInterface; +use Pagarme\Pagarme\Gateway\Transaction\Base\ResourceGateway\AbstractAddressDataProvider; class RequestDataProvider - extends AbstractRequestDataProvider + extends AbstractAddressDataProvider implements CreditCardRequestDataProviderInterface { protected $config; @@ -203,59 +203,4 @@ protected function setConfig(ConfigInterface $config) $this->config = $config; return $this; } - - /** - * @return string - */ - public function getCustomerAddressStreet($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerStreetAttribute()); - } - - /** - * @return string - */ - public function getCustomerAddressNumber($shipping) - { - if ($shipping) { - return $this->getShippingAddressAttribute($this->getConfig()->getCustomerNumberAttribute()); - } - - return $this->getBillingAddressAttribute($this->getConfig()->getCustomerNumberAttribute()); - } - - /** - * @return string - */ - public function getCustomerAddressComplement($shipping) - { - if ($shipping) { - $response = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - }else{ - $response = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? '' : $this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressComplement()); - } - - return $response; - } - - /** - * @return string - */ - public function getCustomerAddressDistrict($shipping) - { - if ($shipping) { - $streetLine = !$this->getShippingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getShippingAddressAttribute($streetLine); - }else{ - $streetLine = !$this->getBillingAddressAttribute($this->getConfig()->getCustomerAddressDistrict()) ? 'street_3' : $this->getConfig()->getCustomerAddressDistrict(); - $response = $this->getBillingAddressAttribute($streetLine); - } - - return $response; - } - } diff --git a/Helper/Payment/Pix.php b/Helper/Payment/Pix.php index ef17c6ed..19d66213 100644 --- a/Helper/Payment/Pix.php +++ b/Helper/Payment/Pix.php @@ -1,27 +1,65 @@ getMethod(); - if (strpos($method, "pagarme_pix") === false) { - return null; - } - - $lastTransId = $info->getLastTransId(); - if ($lastTransId) { - $orderId = substr($lastTransId, 0, 19); - } - - Magento2CoreSetup::bootstrap(); - $orderService= new OrderService(); - return $orderService->getPixQrCodeInfoFromOrder(new OrderId($orderId)); + +namespace Pagarme\Pagarme\Helper\Payment; + +use Pagarme\Pagarme\Concrete\Magento2CoreSetup; +use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; +use Pagarme\Core\Payment\Services\OrderService; + +class Pix +{ + private $qrCodeUrl; + private $qrCode; + + /** + * @return $this + */ + public function getInfo($info) + { + $orderId = null; + $method = $info->getMethod(); + if (strpos($method, "pagarme_pix") === false) { + return null; } - } \ No newline at end of file + + $lastTransId = $info->getLastTransId(); + if ($lastTransId) { + $orderId = substr($lastTransId, 0, 19); + } + + Magento2CoreSetup::bootstrap(); + $orderService = new OrderService(); + $qrCodeData = $orderService->getPixQrCodeInfoFromOrder(new OrderId($orderId)); + $this->setQrCode($qrCodeData['qr_code']); + $this->setQrCodeUrl($qrCodeData['qr_code_url']); + return $this; + } + + + /** + * @return string + */ + public function getQrCodeUrl() + { + return $this->qrCodeUrl ?? ''; + } + + /** + * @return string + */ + public function getQrCode() + { + return $this->qrCode ?? ''; + } + + + private function setQrCodeUrl($qrCodeUrl) + { + $this->qrCodeUrl = $qrCodeUrl; + } + + private function setQrCode($qrCode) + { + $this->qrCode = $qrCode; + } +} diff --git a/etc/di.xml b/etc/di.xml index 1cc2e5fb..5342bfe4 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -221,7 +221,20 @@ Pagarme\Pagarme\Block\Payment\Info\Pix - + + + + Pagarme\Pagarme\Gateway\Transaction\Pix\ResourceGateway\Create\Response\GeneralHandler + + + + + + Pagarme\Pagarme\Gateway\Transaction\Pix\ResourceGateway\Create\RequestBuilder + PagarmePixCommandResponseHandlerPool + Pagarme\Pagarme\Gateway\Transaction\Pix\ResourceGateway\Create\Response\Validator + + @@ -246,8 +259,7 @@ Pagarme\Pagarme\Gateway\Transaction\Base\Command\InitializeCommand - - PagarmeBilletAuthorizeCommand + PagarmePixAuthorizeCommand @@ -293,15 +305,15 @@ - + Pagarme\Pagarme\Gateway\Transaction\Billet\ResourceGateway\Create\RequestBuilder - PagarmeBilletAuthorizeCommandResponseHandlerPool + PagarmeBilletCommandResponseHandlerPool Pagarme\Pagarme\Gateway\Transaction\Billet\ResourceGateway\Create\Response\Validator - + Pagarme\Pagarme\Gateway\Transaction\Billet\ResourceGateway\Create\Response\GeneralHandler diff --git a/view/adminhtml/templates/info/pix.phtml b/view/adminhtml/templates/info/pix.phtml index 8022f7c0..7ceaf9ce 100644 --- a/view/adminhtml/templates/info/pix.phtml +++ b/view/adminhtml/templates/info/pix.phtml @@ -1,43 +1,11 @@ getTransactionInfo(); -if (!empty($lastTransaction)) { - $postData = (json_decode($lastTransaction->getPostData()->tran_data, true)); -} ?> - - - : - -
- - - - - : - -
-
- - -getPixInfo() && $this->getInfo()->getOrder()->getStatus() == 'pending'): ?> - getTitle()) ?> -
- Pix QrCode -
- - - getTitle()) ?> +

getTitle())?>

+showPrintButton()) : ?> + pix qrcode +

getPixInfo()->getQrCode()?>

\ No newline at end of file diff --git a/view/frontend/templates/info/pix.phtml b/view/frontend/templates/info/pix.phtml index 0e551396..0f36bdf8 100644 --- a/view/frontend/templates/info/pix.phtml +++ b/view/frontend/templates/info/pix.phtml @@ -1,16 +1,12 @@ getPixInfo(); - if (!empty($pixInfo) && $this->getInfo()->getOrder()->getStatus() == 'pending'): +/** + * @var Pagarme\Pagarme\Block\Payment\Pix $this + * + */ + ?> - getTitle()) ?> -
-
- - - -
- - getTitle()) ?> -
- - +

getTitle())?>

+showPrintButton()) : ?> + pix qrcode +

getPixInfo()->getQrCode()?>

+ \ No newline at end of file diff --git a/view/frontend/templates/payment/pix.phtml b/view/frontend/templates/payment/pix.phtml index 67e642ed..b5ed2f6e 100644 --- a/view/frontend/templates/payment/pix.phtml +++ b/view/frontend/templates/payment/pix.phtml @@ -14,7 +14,7 @@ if ($block->showPixInformation()): />
- pix qr code + pix qr code
@@ -31,7 +31,7 @@ if ($block->showPixInformation()): - +
From 4ebcba81b45868664045196042ffd8e2cb452939 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:04:54 -0300 Subject: [PATCH 23/83] refactor: html elements be in template in order_charge and invoice blocks (#210) --- Block/Adminhtml/Order/Charge/Tab/View.php | 117 ++---------------- Block/BaseTemplateWithCurrency.php | 45 +++++++ Block/Customer/Invoice.php | 85 ++----------- Helper/HtmlTableHelper.php | 54 -------- Helper/NumberFormatHelper.php | 27 ---- i18n/en_US.csv | 1 + i18n/pt_BR.csv | 1 + .../templates/tab/view/order_charge.phtml | 32 ++++- .../frontend/templates/customer/invoice.phtml | 25 +++- 9 files changed, 123 insertions(+), 264 deletions(-) create mode 100644 Block/BaseTemplateWithCurrency.php delete mode 100644 Helper/HtmlTableHelper.php delete mode 100644 Helper/NumberFormatHelper.php diff --git a/Block/Adminhtml/Order/Charge/Tab/View.php b/Block/Adminhtml/Order/Charge/Tab/View.php index 19e878b6..3908aa1c 100644 --- a/Block/Adminhtml/Order/Charge/Tab/View.php +++ b/Block/Adminhtml/Order/Charge/Tab/View.php @@ -3,18 +3,17 @@ namespace Pagarme\Pagarme\Block\Adminhtml\Order\Charge\Tab; use Exception; -use Magento\Backend\Block\Template; use Magento\Backend\Block\Template\Context; use Magento\Backend\Block\Widget\Tab\TabInterface; +use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\Registry; use Magento\Sales\Model\Order; -use Pagarme\Core\Kernel\Aggregates\Charge; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; +use Pagarme\Pagarme\Block\BaseTemplateWithCurrency; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; -use Pagarme\Pagarme\Helper\HtmlTableHelper; use Pagarme\Pagarme\Service\Order\ChargeService; -class View extends Template implements TabInterface +class View extends BaseTemplateWithCurrency implements TabInterface { // @codingStandardsIgnoreLine protected $_template = 'tab/view/order_charge.phtml'; @@ -24,11 +23,6 @@ class View extends Template implements TabInterface */ private $registry; - /** - * @var HtmlTableHelper - */ - private $htmlTableHelper; - /** * @var ChargeService */ @@ -37,7 +31,7 @@ class View extends Template implements TabInterface /** * @param Context $context * @param Registry $registry - * @param HtmlTableHelper $htmlTableHelper + * @param Data $priceHelper * @param ChargeService $chargeService * @param array $data * @throws Exception @@ -45,106 +39,26 @@ class View extends Template implements TabInterface public function __construct( Context $context, Registry $registry, - HtmlTableHelper $htmlTableHelper, + Data $priceHelper, ChargeService $chargeService, array $data = [] ) { Magento2CoreSetup::bootstrap(); $this->registry = $registry; - $this->htmlTableHelper = $htmlTableHelper; $this->chargeService = $chargeService; - parent::__construct($context, $data); + parent::__construct($context, $priceHelper, $data); } /** - * @return string + * @return array * @throws InvalidParamException */ - public function getChargesTableBody() - { - $tbody = ''; - - foreach ($this->getCharges() as $charge) { - $tbody .= ''; - $tbody .= $this->htmlTableHelper->formatTableDataCell($charge->getPagarmeId()->getValue()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getPaidAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getCanceledAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($charge->getRefundedAmount()); - $tbody .= $this->htmlTableHelper->formatTableDataCell($charge->getStatus()->getStatus()); - $tbody .= $this->htmlTableHelper->formatTableDataCell($this->getAmountInput($charge), 'amount'); - $tbody .= $this->getCaptureChargeButtonDataCell($charge); - $tbody .= $this->getCancelChargeButtonDataCell($charge); - $tbody .= ''; - } - - return $tbody; - } - - /** - * @param Charge $charge - * @return string - */ - public function getAmountInput($charge) - { - return sprintf('', $charge->getAmount()); - } - - /** - * @param Charge $charge - * @return string - */ - public function getCaptureChargeButtonDataCell($charge) - { - $buttonTableDataCell = ''; - - if ($charge->getCanceledAmount() <= 0) { - $button = $this->getActionChargeButton( - $charge, - 'capture', - __('Do you want to capture this charge?'), - __('Capture') - ); - $buttonTableDataCell .= $this->htmlTableHelper->formatTableDataCell($button); - } - - return $buttonTableDataCell; - } - - /** - * @param Charge $charge - * @return string - */ - public function getCancelChargeButtonDataCell($charge) + public function getCharges() { - $button = $this->getActionChargeButton( - $charge, - 'cancel', - __('Do you want to cancel this charge?'), - __('Cancel') - ); - return $this->htmlTableHelper->formatTableDataCell($button); - } - - /** - * @param Charge $charge - * @param string $action - * @param string $message - * @param string $label - * @return string - */ - public function getActionChargeButton($charge, $action, $message, $label) - { - return sprintf( - '', - $action, - $charge->getOrderId()->getValue(), - $charge->getPagarmeId()->getValue(), - $message, - $label + return $this->chargeService->findChargesByIncrementId( + $this->getOrderIncrementId() ); } @@ -200,17 +114,6 @@ private function getOrder() return $this->registry->registry('current_order'); } - /** - * @return array - * @throws InvalidParamException - */ - private function getCharges() - { - return $this->chargeService->findChargesByIncrementId( - $this->getOrderIncrementId() - ); - } - /** * Retrieve order increment id * diff --git a/Block/BaseTemplateWithCurrency.php b/Block/BaseTemplateWithCurrency.php new file mode 100644 index 00000000..463c0783 --- /dev/null +++ b/Block/BaseTemplateWithCurrency.php @@ -0,0 +1,45 @@ +priceHelper = $priceHelper; + } + + /** + * @param mixed $number + * @return float|string + */ + public function formatToCurrency($number) + { + return $this->priceHelper->currency(($number) / 100); + } +} diff --git a/Block/Customer/Invoice.php b/Block/Customer/Invoice.php index 1803a452..13cd00f9 100755 --- a/Block/Customer/Invoice.php +++ b/Block/Customer/Invoice.php @@ -13,21 +13,20 @@ namespace Pagarme\Pagarme\Block\Customer; use Magento\Framework\Exception\AuthorizationException; -use Magento\Framework\View\Element\Template; +use Magento\Framework\Pricing\Helper\Data; use Magento\Framework\View\Element\Template\Context; use Magento\Framework\Registry; use Magento\Customer\Model\Session; use Pagarme\Core\Kernel\ValueObjects\Id\SubscriptionId; -use Pagarme\Pagarme\Api\Data\RecurrenceProductsSubscriptionInterface; +use Pagarme\Pagarme\Block\BaseTemplateWithCurrency; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Core\Recurrence\Repositories\SubscriptionRepository; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Core\Kernel\Abstractions\AbstractEntity; use Pagarme\Core\Recurrence\Repositories\ChargeRepository; use Pagarme\Core\Recurrence\Aggregates\Charge; -use Pagarme\Pagarme\Helper\HtmlTableHelper; -class Invoice extends Template +class Invoice extends BaseTemplateWithCurrency { /** * @var Session @@ -49,29 +48,23 @@ class Invoice extends Template */ protected $coreRegistry; - /** - * @var HtmlTableHelper - */ - private $htmlTableHelper; - /** * @param Context $context * @param Session $customerSession * @param Registry $coreRegistry - * @param HtmlTableHelper $htmlTableHelper + * @param Data $priceHelper */ public function __construct( Context $context, Session $customerSession, Registry $coreRegistry, - HtmlTableHelper $htmlTableHelper + Data $priceHelper ) { - parent::__construct($context, []); + parent::__construct($context, $priceHelper, []); Magento2CoreSetup::bootstrap(); $this->coreRegistry = $coreRegistry; $this->customerSession = $customerSession; - $this->htmlTableHelper = $htmlTableHelper; $this->chargeRepository = new ChargeRepository(); $this->subscriptionRepository = new SubscriptionRepository(); @@ -106,73 +99,21 @@ public function getSubscriptionPaymentMethod() } /** - * @return string - */ - public function getBilletHeader() - { - if (!$this->isBillet()) { - return ""; - } - - return sprintf('%s', __('Billet')); - } - - /** - * @return string - * @throws InvalidParamException + * @param int $id + * @return int */ - public function getInvoicesTableBody() + public function getVisualChargeId($id) { - $tbody = ""; - - foreach ($this->getAllChargesByCodeOrder() as $id => $item) { - $tbody .= ""; - $visualId = $id + 1; - $tbody .= $this->htmlTableHelper->formatTableDataCell($visualId); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getPaidAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getCanceledAmount()); - $tbody .= $this->htmlTableHelper->formatNumberTableDataCell($item->getRefundedAmount()); - $tbody .= $this->htmlTableHelper->formatTableDataCell($item->getStatus()->getStatus()); - $tbody .= $this->htmlTableHelper->formatTableDataCell($item->getPaymentMethod()->getPaymentMethod()); - $tbody .= $this->addBilletButton($item); - $tbody .= ''; - } - - return $tbody; - } - - /** - * @param mixed $item - * @return string - */ - private function addBilletButton($item) - { - $button = ''; - if (!$this->isBillet()) { - return $button; - } - - $button = ''; - $hasBilletLink = !empty($item->getBoletoLink()); - if ($hasBilletLink) { - $button .= sprintf( - '', - $item->getBoletoLink(), - 'download' - ); - } - $button .= ''; - - return $button; + return $id + 1; } /** + * @param Charge $item * @return bool */ - private function isBillet() + public function isBillet($item) { - return $this->getSubscriptionPaymentMethod() === RecurrenceProductsSubscriptionInterface::BOLETO; + return !empty($item->getBoletoLink()); } /** diff --git a/Helper/HtmlTableHelper.php b/Helper/HtmlTableHelper.php deleted file mode 100644 index faadd32d..00000000 --- a/Helper/HtmlTableHelper.php +++ /dev/null @@ -1,54 +0,0 @@ -priceHelper = $priceHelper; - } - - /** - * @param string $text - * @param string $className - * @return string - */ - public function formatTableDataCell($text, $className = '') - { - $classAttribute = ''; - if (!empty($className)) { - $classAttribute = sprintf(' class="%s"', $className); - } - return sprintf('%s', $classAttribute, $text); - } - - /** - * @param mixed $number - * @return string - */ - public function formatNumberTableDataCell($number) - { - return $this->formatTableDataCell($this->formatNumber($number)); - } - - /** - * @param mixed $number - * @return float|string - */ - private function formatNumber($number) - { - return $this->priceHelper->currency(($number) / 100); - } -} diff --git a/Helper/NumberFormatHelper.php b/Helper/NumberFormatHelper.php deleted file mode 100644 index 00446adc..00000000 --- a/Helper/NumberFormatHelper.php +++ /dev/null @@ -1,27 +0,0 @@ -numberFormatter = new NumberFormatter('pt-BR', NumberFormatter::CURRENCY); - } - - public function formatToLocalCurrency($number) - { - return $this->numberFormatter->format($number); - } - -} diff --git a/i18n/en_US.csv b/i18n/en_US.csv index 404250ef..8e8c4000 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -307,3 +307,4 @@ "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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 45a172b7..f8a204d5 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -486,3 +486,4 @@ "Open your bank app","Abra o app do seu banco" "Scan the QR Code","Escaneie o QR Code" "Confirm the payment","Confirme o pagamento" +"View Billet","Visualizar Boleto" diff --git a/view/adminhtml/templates/tab/view/order_charge.phtml b/view/adminhtml/templates/tab/view/order_charge.phtml index fa54038b..10e53d0a 100644 --- a/view/adminhtml/templates/tab/view/order_charge.phtml +++ b/view/adminhtml/templates/tab/view/order_charge.phtml @@ -21,7 +21,37 @@ - getChargesTableBody() ?> + getCharges() as $charge): ?> + + getPagarmeId()->getValue(); ?> + formatToCurrency($charge->getAmount()); ?> + formatToCurrency($charge->getPaidAmount()); ?> + formatToCurrency($charge->getCanceledAmount()); ?> + formatToCurrency($charge->getRefundedAmount()); ?> + getStatus()->getStatus(); ?> + + + + + + + + +
diff --git a/view/frontend/templates/customer/invoice.phtml b/view/frontend/templates/customer/invoice.phtml index 238969e7..861002da 100755 --- a/view/frontend/templates/customer/invoice.phtml +++ b/view/frontend/templates/customer/invoice.phtml @@ -5,7 +5,6 @@ ?>
- @@ -15,11 +14,31 @@ - getBilletHeader() ?> + - getInvoicesTableBody() ?> + getAllChargesByCodeOrder() as $id => $item): ?> + + + + + + + + + + +
getVisualChargeId($id); ?>formatToCurrency($item->getAmount()); ?>formatToCurrency($item->getPaidAmount()); ?>formatToCurrency($item->getCanceledAmount()); ?>formatToCurrency($item->getRefundedAmount()); ?>getStatus()->getStatus(); ?>getPaymentMethod()->getPaymentMethod(); ?> + isBillet($item)): ?> + + +
From 97ecd659ba35c37aa3d61b58c4ec9729c0f32532 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 1 Aug 2023 16:09:22 -0300 Subject: [PATCH 24/83] refactor: removing unused priceFinal template (#211) --- Concrete/integrityData | 2 +- Plugin/Princing/Render/FinalPricePlugin.php | 132 ------------------ etc/di.xml | 4 - .../templates/product/priceFinal.phtml | 72 ---------- 4 files changed, 1 insertion(+), 209 deletions(-) delete mode 100644 Plugin/Princing/Render/FinalPricePlugin.php delete mode 100644 view/frontend/templates/product/priceFinal.phtml diff --git a/Concrete/integrityData b/Concrete/integrityData index f1294ca3..c885e528 100644 --- a/Concrete/integrityData +++ b/Concrete/integrityData @@ -1 +1 @@ -{"Api\/BaseRequestDataProviderInterface.php":"a3fdc44584c2ebea97041c464a4b3537","Api\/BilletCreditCardRequestDataProviderInterface.php":"acd369021f7ca56acf812c5127455ab4","Api\/BilletRequestDataProviderInterface.php":"f2adc2feeeab796f2f8ea3af6df5f0d9","Api\/BulkApiInterface.php":"e2cb981f205f6d47aa809b9c4a02d81f","Api\/BulkSingleResponseInterface.php":"6af56ffdb64e05023e7d0ae869f0d40f","Api\/CardsRepositoryInterface.php":"1391d4314aca2b474d5ac2d54d83b180","Api\/CartItemRequestDataProviderInterface.php":"efeec6d8d81b4e16bdba05cd019eb416","Api\/ChargeApiInterface.php":"fc02cc0342790cb475d7b765280921ac","Api\/ChargesRepositoryInterface.php":"6dc223249c0f43dcd6f79bb21a51063a","Api\/CreditCardRequestDataProviderInterface.php":"8985d5d269d7a06532bf0a10e553e255","Api\/Data\/CardsInterface.php":"278f719fc6c042300e6a2156f7e76c07","Api\/Data\/CardsSearchResultsInterface.php":"d4bc9e79bc5c176791f15752e6e2b0c2","Api\/Data\/ChargesInterface.php":"8f1bd48765186084b0ea219ed4ddc490","Api\/Data\/ChargesSearchResultsInterface.php":"4b5786b4e0db410af8fe3690c3ac6920","Api\/Data\/InstallmentInterface.php":"4a1ff2a051f0a4f611c6a47c7aff3ed9","Api\/HubCommandInterface.php":"5cffdca857f6dae9fa98919d9400dd83","Api\/InstallmentsByBrandAndAmountManagementInterface.php":"34531e74f83f9f44d00ffb304f6b04b1","Api\/InstallmentsByBrandManagementInterface.php":"3938666296af2dcb07fac5fc602c349b","Api\/InstallmentsManagementInterface.php":"d66755cd2956a66312fa7edd4d35af96","Api\/InvoiceApiInterface.php":"8e3be8ee5fa24c362a5e3c02dd8a3aef","Api\/MaintenanceInterface.php":"7ff4300a43ae35961b52aebea5918b90","Api\/ObjectMapper\/ProductPlan\/ProductPlanMapperInterface.php":"f781bc611a8cab4a06e4ac773a650724","Api\/ObjectMapper\/ProductPlan\/SubProduct.php":"0038aaada32f85f1daa0577150e9983b","Api\/ObjectMapper\/ProductSubscription\/ProductSubscriptionMapperInterface.php":"f336ade7fbee4ca9404503903a6be705","Api\/ObjectMapper\/ProductSubscription\/RepetitionInterface.php":"1fe05b5e8ccdedaf85961ddaddbcb244","Api\/PixRequestDataProviderInterface.php":"f0f072fa2248af27f6c0e67b45a7b0e6","Api\/ProductPlanApiInterface.php":"840615ebcbaf6b90428bd49b508ac48b","Api\/ProductPlanInterface.php":"b230677fce0a196d1730a9984a1a1bfc","Api\/ProductSubscriptionApiInterface.php":"d43c0078b32274426cc4b4eb7fe2dc06","Api\/ProductSubscriptionInterface.php":"fc195b0e01e2b21b70643fed2fbdc755","Api\/SubscriptionApiInterface.php":"5eab18115c3f96fbaa7e0b83ca8b5a40","Api\/TwoCreditCardRequestDataProviderInterface.php":"d85968ced59736de93a023412f7d8d29","Api\/WebhookManagementInterface.php":"3e34391f524ad9e8f57cf48719959258","Block\/Adminhtml\/Customer\/Cards.php":"493ca9983db5f2837904d43d14b7ab26","Block\/Adminhtml\/Form\/Field\/HubEnvironment.php":"c3a3229d67b1519579b9f892d5831ed6","Block\/Adminhtml\/Form\/Field\/HubIntegration.php":"8bd50fd9b0d0cd05bd12494cfa893c49","Block\/Adminhtml\/Form\/Field\/ModuleVersion.php":"4a2ee8c2a2bfcc749ad5c11518857a81","Block\/Adminhtml\/Order\/Charge\/Tab\/View.php":"5a67843f461c700431ca4e26c2e5c15f","Block\/Adminhtml\/Recurrence\/Plans\/Plan.php":"b5ec57237da588e2e1ba38a9322b4ba4","Block\/Adminhtml\/Recurrence\/Subscriptions\/Subscription.php":"4debcd4df946d280b7ddc4548b06d079","Block\/Adminhtml\/System\/Config\/Fieldset\/CycleDiscount.php":"5caf4c22a4b4caf4cef9d58e632467d9","Block\/Adminhtml\/System\/Config\/Fieldset\/Group.php":"ff9b429c07c1b2dc59a1d9cf906221a6","Block\/Adminhtml\/System\/Config\/Fieldset\/Payment.php":"0acb1bb8166117c3c8197d85d8a93248","Block\/Customer\/Cards.php":"05498783fe43a9bd54a7129b237496ce","Block\/Customer\/Invoice.php":"4b825454ed14b183341a3d827cb62c52","Block\/Customer\/Subscription.php":"f03586f9e6404132b4340e67292eaec2","Block\/Form.php":"c752d4bf9dbbd1ca49e4d9ec381c4cec","Block\/Payment\/Billet.php":"bce33f8374632ed23684583a45095f00","Block\/Payment\/Info\/Billet.php":"6e58b04ee960922c85492139b27e0ecb","Block\/Payment\/Info\/BilletCreditCard.php":"e6201331cb0fbb0243b92570b483f081","Block\/Payment\/Info\/CreditCard.php":"5020455e238e649e1cd74ce856885628","Block\/Payment\/Info\/Debit.php":"ec3987d4cebee7ed7b1385d02c786d70","Block\/Payment\/Info\/Pix.php":"6e87e8e98b9e25bdd1db5752baf40252","Block\/Payment\/Info\/TwoCreditCard.php":"ec8bd7d939d46f2cb8067745b351e0cb","Block\/Payment\/Info\/Voucher.php":"5751aca84267178db0981a9a7d42f792","Block\/Payment\/Pix.php":"8ab558b48d650b527f199753b28f428e","Concrete\/Magento2CoreSetup.php":"395c9d6a461b52045c4264c064e040e6","Concrete\/Magento2DataService.php":"8592acfad796484bd5efa608392b7077","Concrete\/Magento2DatabaseDecorator.php":"b352ae49262de2edd03b5a58ec81a216","Concrete\/Magento2PlatformCreditmemoDecorator.php":"84296416830d48cb261679739c670d29","Concrete\/Magento2PlatformCustomerDecorator.php":"3dd6e3401c98ad38833b29c3a7d5f081","Concrete\/Magento2PlatformInvoiceDecorator.php":"6c40be51cd279f1ddd58ca045194bed4","Concrete\/Magento2PlatformOrderDecorator.php":"3ccc8481c1f02abc5f1ab43dbcbdc405","Concrete\/Magento2PlatformPaymentMethodDecorator.php":"a72a24793c4c21508b04a045b7330867","Concrete\/Magento2PlatformProductDecorator.php":"29b51ba3ea4ceed3f617e6234af04f31","Concrete\/Magento2SavedCardAdapter.php":"a4a6464ebad93a7e9138cf24344ea32f","Controller\/Adminhtml\/Cards\/Index.php":"c689df20170615d8579cab25cfe624c1","Controller\/Adminhtml\/Charges\/Cancel.php":"8e194b315b1d39e38b1f37f317f113bc","Controller\/Adminhtml\/Charges\/Capture.php":"c16c718bae327320f9a074f27165fd2d","Controller\/Adminhtml\/Charges\/ChargeAction.php":"4f2eb6603be3806762657ff4c632257c","Controller\/Adminhtml\/Charges\/Index.php":"e756bb11bed78f0822efa4f0fd61b989","Controller\/Adminhtml\/Hub\/Index.php":"a0604016175c7d491a9cf47a0354e9ad","Controller\/Adminhtml\/Invoices\/Delete.php":"3f1c6775fe792e4a98f2bb755b32f2ec","Controller\/Adminhtml\/Invoices\/Index.php":"aa39d70426b48bc7d20a456aa5386e69","Controller\/Adminhtml\/Plans\/Create.php":"af9b10f4f5304f532e4fbd1238b21eed","Controller\/Adminhtml\/Plans\/Delete.php":"f1d3dabdfa44061bac44b0b1344c3723","Controller\/Adminhtml\/Plans\/Index.php":"cbb446e47f7f241e755aac73a8912cdd","Controller\/Adminhtml\/Plans\/PlanAction.php":"35b8f2f8706c7eeeefa6c488fe2d4e1c","Controller\/Adminhtml\/Plans\/SearchProduct.php":"61bbfd53a2d291a3311090314874055e","Controller\/Adminhtml\/RecurrenceProducts\/Create.php":"f9487f6b907fcfb84a240d731fc9d3a3","Controller\/Adminhtml\/RecurrenceProducts\/Delete.php":"64895404eb98ad9857782e4fbb085790","Controller\/Adminhtml\/RecurrenceProducts\/Index.php":"864744d5ffedfe584d27dfeeb7cbd8b1","Controller\/Adminhtml\/Subscriptions\/Delete.php":"b740c07a33e31b9b8e015524a95952d1","Controller\/Adminhtml\/Subscriptions\/Details.php":"b22306c13d19a7bd0e92a02eccf560da","Controller\/Adminhtml\/Subscriptions\/Index.php":"c8a84b21345f459b89afa4afc025745b","Controller\/Customer\/Cards.php":"a839d3a6a4b8970b43426e449a38ffc6","Controller\/Customer\/Invoice.php":"439f667282053ee11a03265dddd713aa","Controller\/Customer\/Remove.php":"52c9076bd86ac59b3fb963465b198e1d","Controller\/Customer\/Subscription.php":"e3469ecb1ecd2206233f05b8968637ce","Factories\/BulkSingleResponseFactory.php":"788ff6950209c610d74ebda0d29b26d5","Gateway\/Transaction\/Base\/Command\/AbstractApiCommand.php":"dbcfefb25d2bee7fb1a1cf05a1ea1501","Gateway\/Transaction\/Base\/Command\/InitializeCommand.php":"c6bca86e2e452a11206196b5fe0837fa","Gateway\/Transaction\/Base\/Config\/AbstractConfig.php":"03ec8f382c525e4937c5e67d62f47235","Gateway\/Transaction\/Base\/Config\/Config.php":"5084aa0d9b09c4577d652c0217b0fb0a","Gateway\/Transaction\/Base\/Config\/ConfigInterface.php":"56b4a7a13b90eebcf925808f610125cf","Gateway\/Transaction\/Base\/ResourceGateway\/AbstractRequestDataProvider.php":"e46066a53bff34e964bef28d27a98cb4","Gateway\/Transaction\/Base\/ResourceGateway\/CartItemRequestDataProvider.php":"08f65fc67a1569f45ac75e0284c4f16d","Gateway\/Transaction\/Base\/ResourceGateway\/Response\/AbstractHandler.php":"8347ed2c90c35443a6dfc284719c86bc","Gateway\/Transaction\/Base\/ResourceGateway\/Response\/AbstractValidator.php":"e66941ef701125b68b4fe8f14d3dbbd6","Gateway\/Transaction\/Billet\/Command\/AuthorizeCommand.php":"d64c0d2613bb1722d4b1173648f424a8","Gateway\/Transaction\/Billet\/Config\/Config.php":"ddef33e39170023842f01878f29fbad7","Gateway\/Transaction\/Billet\/Config\/ConfigInterface.php":"284234453377a178bcf320589fd7322b","Gateway\/Transaction\/Billet\/ResourceGateway\/Create\/RequestDataProvider.php":"126b622ca5c073a418c7819c5237751f","Gateway\/Transaction\/Billet\/ResourceGateway\/Create\/Response\/Validator.php":"a790d7459fd2737802e441a2abd86f12","Gateway\/Transaction\/BilletCreditCard\/Command\/AuthorizeCommand.php":"b0c951990b07121936a570d7fc90811b","Gateway\/Transaction\/BilletCreditCard\/Command\/CaptureCommand.php":"75647754dc381088aa0215fc55f73a7c","Gateway\/Transaction\/BilletCreditCard\/Command\/RefundCommand.php":"a087df263d5c121cb65174dfa0230e4a","Gateway\/Transaction\/BilletCreditCard\/Config\/Config.php":"60d8679b7df40a617dbe6e49f37a059f","Gateway\/Transaction\/BilletCreditCard\/Config\/ConfigInterface.php":"c2786da1bfc8daf6288404dcb8d7863d","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"2a1a3d32c136235c0ad1a0e49f2768f2","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"3f4379b5a7ebff6026fa8b8fc48af0ee","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"ab559ae31a175e66708919cdf9868f18","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"4519598e553001a1a6ac0968b136250c","Gateway\/Transaction\/CreditCard\/Command\/AuthorizeCommand.php":"040f21a1ff363be6ef1075d81bbdf13c","Gateway\/Transaction\/CreditCard\/Command\/CaptureCommand.php":"725a509ad624be59fa78cb8d4f6ebcd4","Gateway\/Transaction\/CreditCard\/Command\/RefundCommand.php":"db4dd625e44679a6c3d4accbf1911444","Gateway\/Transaction\/CreditCard\/Config\/Config.php":"b93df339fa30033fa188b28b95a1871b","Gateway\/Transaction\/CreditCard\/Config\/ConfigInterface.php":"93f08c285b8300c86709808da97f0aec","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Capture\/Response\/GeneralHandler.php":"2dd81d817c3cf3271beac1736f8e57cd","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"2cc693bd44c49a59e2cd10239f4bcd8b","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"0a08490321ab1e4950266726a94eee67","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"1be04e105120b30e7dd835b0ca554b9b","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Refund\/Response\/GeneralHandler.php":"cf1aeb148bb53488aff4d49fc120def6","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"e070f0fcf345925ccd9b193811567d97","Gateway\/Transaction\/TwoCreditCard\/Command\/AuthorizeCommand.php":"984d76eec10d644f6a02c312cadc2a5f","Gateway\/Transaction\/TwoCreditCard\/Command\/CaptureCommand.php":"3b17314ffb9ac796f3c1f27f25b85d96","Gateway\/Transaction\/TwoCreditCard\/Command\/RefundCommand.php":"e480ee822cc2db5aaa54c9a372f297f7","Gateway\/Transaction\/TwoCreditCard\/Config\/Config.php":"3b1be172e32efba7a7371f8d88d932a1","Gateway\/Transaction\/TwoCreditCard\/Config\/ConfigInterface.php":"367e736bab8a6b332304bd133cbe5e9c","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"883123c0460b4efaf0f1f0a261a06fb2","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"ea77649a47f20199c42419e751b131d7","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"96c1f002dab776c020c3cd471fcc1d37","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"773b4107526a09446a9f58e5914afb33","Helper\/AbstractHelper.php":"87da1986967f4da6320f236c308d4702","Helper\/Adminhtml\/CheckoutHelper.php":"3b88d1453870921f63c5f479a9ed1a29","Helper\/BuildChargeAddtionalInformationHelper.php":"23dc867ab38379d720952b00c6afc970","Helper\/Cards\/CreateCard.php":"7bec2850d5b095616d0df1bba58a3109","Helper\/CustomerAddress.php":"3f6f0ee15cddd895dfb6cb177e24186f","Helper\/CustomerAddressInterface.php":"9f723dd31eb76ad70bb7b8659fc1a120","Helper\/CustomerCustomAttributesHelper.php":"88ae2860bc8b03c9bb660a33ec0315e1","Helper\/CustomerUpdatePagarmeHelper.php":"a84df51bcb9d009f757935bd072e6f82","Helper\/ModuleHelper.php":"61e03e3dab3584ea4bf2e732446532c5","Helper\/Product\/Configuration\/Plugin\/Plan.php":"35dab5fd3303f06f53f46648b78335cd","Helper\/ProductHelper.php":"fd89d994c4c9eea6b268a4c81d7d4408","Helper\/ProductPlanHelper.php":"f28a1083b7a89cb74eadf75b16790f83","Helper\/ProductSubscriptionHelper.php":"3740b5f72361e373cf2ad98f36708f89","Helper\/RecurrenceProductHelper.php":"ed7620351551a071fdc3e8ecd8b6cf9d","Helper\/RulesCartRun.php":"014121cb07969350f804511dd8edfff0","Model\/AbstractInstallmentManagement.php":"dec788dd12cfc0552e9b4c6ac7ddb8a5","Model\/Api\/Bulk.php":"8f26197aaaacf28a964c80c8ca3f955e","Model\/Api\/BulkSingleResponse.php":"d8e7ad0b8ce6afd0540bc5657e3238db","Model\/Api\/Charge.php":"317b9da3de066501d910b983a2703623","Model\/Api\/HubCommand.php":"1293c542f82252b4e19ab9196b8886c9","Model\/Api\/Invoice.php":"1a1342f81c7b14927da07eb0a7cc69fb","Model\/Api\/ProductsPlan.php":"b827aa52f13d38ac897503bf7b0a7fd8","Model\/Api\/ProductsSubscription.php":"1e72e02b03a0e2ed633600d6a6af66cd","Model\/Api\/ResponseMessage.php":"4cc6fdf266763c9983345d47aed43923","Model\/Api\/Subscription.php":"2f90dff449aa2de15b2ac92a22d71f1a","Model\/Cards.php":"3cb39fc5ec17e1acbcea1928764b92a1","Model\/CardsRepository.php":"47ef94d35b20e9be75f5d7d17d0f3b2c","Model\/Cart\/CartConflict.php":"773d019a49b7f5c6a02bf2a168adcf2e","Model\/Charges.php":"6c2e6707c6bce66dd9d27c2a0c8ee42e","Model\/ChargesRepository.php":"dbc4fdaf2ad341a19941960220a1534b","Model\/Enum\/BankEnum.php":"0d7cd40e69d010f77dce11873a99b7cf","Model\/Enum\/CountryEnum.php":"25d3f3c2118013907874e3c2036fb20e","Model\/Enum\/CreditCardBrandEnum.php":"38046790649e063c50ad9b17c0687d76","Model\/Enum\/CreditCardOperationEnum.php":"386977a6dd579aaddbd7fe70ea7fd035","Model\/Enum\/DocumentTypeEnum.php":"5ad9cddbf736b0f13624f91bc866a21f","Model\/Enum\/PersonTypeEnum.php":"fc4d5759d05eb76b71def40d1f9f1fbe","Model\/Installment.php":"b875fe5acf098abc33b0e514794b6edf","Model\/Installments\/Builder.php":"3d2f6841b92e242d16a7b1690899beab","Model\/Installments\/BuilderByBrand.php":"b11fff0e54eef9c5385501b8cb1af306","Model\/Installments\/BuilderByBrandAndAmount.php":"94d196934237932b7929b4e676f2fcac","Model\/Installments\/Config\/Config.php":"b6aa518a72efea846a992a57d409e61f","Model\/Installments\/Config\/ConfigByBrand.php":"dc6c1a80a6bf613a31b0f710d16caa9f","Model\/Installments\/Config\/ConfigByBrandInterface.php":"4c454389f5a6039fa01a3b5ff6a6c69f","Model\/Installments\/Config\/ConfigInterface.php":"be24d358d670ab7e1bda8e588b7f8d47","Model\/InstallmentsByBrandAndAmountManagement.php":"e3bce81ff7ca0c4de175ac0ad70d65f7","Model\/InstallmentsByBrandManagement.php":"d33667cfd3e11ac99d6b442175f288a3","Model\/InstallmentsManagement.php":"15539ea3b27d4c97588ba45474d2bc7a","Model\/Invoices.php":"d83b3c9c8e3eb84d05f547d0d657b8d1","Model\/Maintenance.php":"23da98c3350d19b04068ca0b4b3300b6","Model\/PagarmeConfigProvider.php":"d2331abc83534b79b296094af63e1db0","Model\/Payment.php":"ae773cf6b9f404ed94557c383fe5da48","Model\/Product\/OnlyPlanItem.php":"d26a338455cba312992e7657c75aa64e","Model\/Product\/ProductPlan\/Cart\/Configuration\/Plugin\/Plan.php":"09e7b687f211ca72a3644b51527a7e95","Model\/Product\/ProductPlan\/CopyConstructor\/Plan.php":"63309836bf27c8bc645613d246ed4517","Model\/Product\/ProductPlan\/Initialization\/Helper\/ProductLinks\/Plugin\/Plan.php":"adfa6b11bcc6f0d8fe8ac95b605bf766","Model\/Product\/ProductPlan\/Plan.php":"11173e45b24a8752a82fc744a565fdc4","Model\/Product\/ProductPlan\/Type\/Plugin.php":"36eb6e2505a87210ec6f496a4fcb3ca2","Model\/Product\/Recurrence.php":"e460c4707d593b0cd74919cc35a3d8b1","Model\/ProductsPlan.php":"c3a552eed0db0e7c17f4ea1f574b3318","Model\/ProductsSubscription.php":"e57ac629a4b527b4b4c15cf40ddc071f","Model\/ResourceModel\/Cards\/Collection.php":"0be875c656b22f1ec917bffb623ce3b7","Model\/ResourceModel\/Cards.php":"684dceb44bc9dda259dfeaf39ffde27c","Model\/ResourceModel\/Charges\/Collection.php":"7d869d192399534fb9cb197aa39ac497","Model\/ResourceModel\/Charges.php":"673e8ccf2bbebafb3b6cc3fdbe0c66af","Model\/ResourceModel\/Invoices\/Collection.php":"b763a7a6ee29052506cfe8c5bd01a9f5","Model\/ResourceModel\/Invoices.php":"1298438e5f6a4b5aabeb446537411e64","Model\/ResourceModel\/ProductsPlan\/Collection.php":"574d01bc0649be59315bb85e8868cdc4","Model\/ResourceModel\/ProductsPlan.php":"f490678d47f15e4ae81de36d3a521f60","Model\/ResourceModel\/ProductsSubscription\/Collection.php":"a4b9cb0aeff628b152d25e70370c10c2","Model\/ResourceModel\/ProductsSubscription.php":"c1cd11095b04daa12714f94340efbc7f","Model\/ResourceModel\/Subscriptions\/Collection.php":"372e7614c94b01a8e68d2239dc5fae03","Model\/ResourceModel\/Subscriptions.php":"d631d391c5dd4326d9f996231b53d55c","Model\/Sales\/AdminOrder\/Product\/Quote\/Plugin\/Initializer.php":"077864471bcaaec2bfce38175c9f0af3","Model\/Source\/Bank.php":"9821cc9081a8bd0871e74fc669ee3b54","Model\/Source\/BilletTypes.php":"9762f11fbe5c925972ccb576a8f0a1e2","Model\/Source\/Billing.php":"1c577ac30681c772053f866d42ccb304","Model\/Source\/BrandTypes.php":"45b242889c4019eeb773e5a9bb918ece","Model\/Source\/Cctype.php":"c369a46b6f523b219437fffce87eb9ff","Model\/Source\/CctypePSP.php":"6a3f4c788242ce6384f168cec5978601","Model\/Source\/Debittype.php":"0cd3b277246d78a34851dededa5b7bf2","Model\/Source\/EavBillingType.php":"8c16b9513a53632036a4e8284a219ea2","Model\/Source\/EavInterval.php":"63e7a4c590c5b1920e8e2a9f10c6e0a1","Model\/Source\/EavPaymentMethods.php":"d35400de85bb40afed107785627dd28c","Model\/Source\/Interval.php":"e3f2e56a5ba4ba1862257bcfba3ac21c","Model\/Source\/PaymentAction.php":"8ab3e1337bb5ac2b1be2ddf13a26069a","Model\/Source\/PaymentMethods.php":"3da04d9c68692a4c25f722829da72705","Model\/Source\/PixTypes.php":"3d38fd2775c0c6a82b1f1c8c0ef5de9f","Model\/Source\/Sequence.php":"ab4170daf783d46b92c8dc3df071983c","Model\/Source\/SequenceCriteria.php":"123d2be23a33d0ec30d945411a399301","Model\/Source\/Status\/NewPending.php":"54318ca544e367e7eee8fe482313eb8e","Model\/Source\/Status\/Review.php":"8fc5f78aed2f58e0a2aa7b0819710031","Model\/Source\/Vouchertype.php":"b95ad2c6132bec030b54f6382f29559b","Model\/Subscriptions.php":"cf3e708798910261b1b6b2936eb487c4","Model\/Validation\/GenericValidation.php":"f0444865f1ec6ff1a299c8c49e70e40b","Model\/WebhookManagement.php":"431d81028f39564e2ea607aa1eb8771e","Observer\/AdminCustomerBeforeSave.php":"1a4a81ecf243374e16e07abf479ead8a","Observer\/BilletCreditCardDataAssignObserver.php":"2579d352081764e48c9614742d2d1add","Observer\/BilletDataAssignObserver.php":"af0e85f1d40b64fd109678e6d71f6ffd","Observer\/CartAddProductAfterObserver.php":"32d7eb39aa17937042232c69f46f7efa","Observer\/CreditCardDataAssignObserver.php":"ad9e573e5e75ca0fdee511cff135f349","Observer\/CreditCardOrderPlaceBeforeObserver.php":"8228c7b9a3c281dad892f5de3b2c2bc8","Observer\/CustomerAddressSaveBefore.php":"273b4db38b6439abbc59a2bad75cde4b","Observer\/DataValidateAdmin.php":"591a6ae72e710212d907df96107358f9","Observer\/DebitDataAssignObserver.php":"8c30cdda92900b5c9ea98d6650da4283","Observer\/OrderCancelAfter.php":"56adf6a468e341d0f409eb7733657cd8","Observer\/OrderPlaceBeforeObserver.php":"bd48ef3108625b4f91f0896281c4afe5","Observer\/PaymentMethodAvailable.php":"83c06458f2272ee26624bf6a80db69ce","Observer\/PixDataAssignObserver.php":"e3eddda7d20cd6eb8b0894fb543f492a","Observer\/SalesOrderPlaceAfter.php":"c2c1b8c4011ad79cbb78fed7fa719b65","Observer\/TwoCreditCardDataAssignObserver.php":"b3a052072b2c1436da3d036fe6b300d6","Observer\/UpdateProductPlanObserver.php":"ef8f5f5121c4745f95bd3a0a04cd9330","Observer\/VoucherDataAssignObserver.php":"a84415ddfa1f1dff23e82972c4f5ff50","Plugin\/Admin\/CustomerPlugin.php":"0e36a10a67a142c6f0c4b08eb7cb6ecf","Plugin\/Princing\/Render\/FinalPricePlugin.php":"0a620ccd42c351221810afcc3517b410","Plugin\/Webapi\/RestResponse\/JsonPlugin.php":"490703f70a11551c9176bb3d9fdc9af2","Setup\/InstallData.php":"7f402d3cb214a31b2abc03b31344c9fe","Setup\/InstallSchema.php":"86130278ae4622e89f92a8c8c72784c1","Setup\/MigrateData.php":"42fc4bf315480edcec697ce5167b181d","Setup\/UpgradeData.php":"c5cc771dc676366fce4949d0ba603d1b","Setup\/UpgradeSchema.php":"ad68c94b0829a8e21cfd94ea2b20dcba","Test\/.gitignore":"ba12e4bb11bf03f72b5fca4598676180","Test\/Unit\/bootstrap.php":"31c2829c5f68634e4dd4eba2bd6e0697","Ui\/Component\/Column\/Actions.php":"ab278b043ce22ec5e7b07d8a63be5330","Ui\/Component\/Column\/Invoices\/Actions.php":"d3574046bcd7b16052c10299be8e57bb","Ui\/Component\/Column\/Invoices\/Boleto.php":"16bc8640d8ba77e2c5b5477a9dd9587f","Ui\/Component\/Column\/Subscriptions\/Actions.php":"d55878fd3a5234e79e606fece8daf9a6","Ui\/Component\/Listing\/Column\/BrazilCurrency.php":"e58024dad7dd7043f7691105bef22e4d","Ui\/Component\/Listing\/Column\/Translate.php":"67578d6182b6a674e02fc7c80e9aa27d","Ui\/Component\/Recurrence\/Column\/CreatedAt.php":"e54fa620a5e651285becaf3156b9b20c","Ui\/Component\/Recurrence\/Column\/CustomerName.php":"5fdae5b4a665e0352d4a61e861fd4f75","Ui\/Component\/Recurrence\/Column\/Interval.php":"a52697dfbd4d619987fc8c7936c7ca79","Ui\/Component\/Recurrence\/Column\/PaymentMethodColumn.php":"759629abb7d0b49c740d1d6d8e1dbf20","Ui\/Component\/Recurrence\/Column\/ProductRecurrenceName.php":"c324ffe8ed5d7e078a99e4073c12856b","Ui\/Component\/Recurrence\/Column\/RepetitionsColumn.php":"ac32324baa92eaf5eda1830d0b580c6b","Ui\/Component\/Recurrence\/Column\/TotalCyclesByProduct.php":"e541957924f01abf9ee7f48dd3676b95","Ui\/DataProvider\/Product\/Form\/Modifier\/Plan.php":"852b344f6f58d1a801e737a43130e411","Ui\/DataProvider\/Product\/GroupedProductDataProvider.php":"92ceee9c0bdf292f0aa82023a4369ea7","etc\/_product_types.xml":"596a72b85e1d77c23885c9fb61819a32","etc\/acl.xml":"fbf02b25fb2c76a1afd495f6d0b65bf1","etc\/adminhtml\/di.xml":"33475410b322d04a7171f1cec6a87092","etc\/adminhtml\/menu.xml":"9cc54ed838c2925b49798c8d41a55408","etc\/adminhtml\/routes.xml":"9840414d1096739703fef1d29b4a9f26","etc\/adminhtml\/system\/antifraud.xml":"3f1bc947245d0940d832c67604a158f2","etc\/adminhtml\/system\/customer\/address.xml":"345a05516722e877fd72e1330ed76536","etc\/adminhtml\/system\/customer.xml":"9b133c99036a4f4635586f22cdcd69a5","etc\/adminhtml\/system\/global.xml":"dcf23c408331272d850563d48f74daf5","etc\/adminhtml\/system\/recurrence.xml":"effc905fd40ccc96cf83fad2a96479bf","etc\/adminhtml\/system\/transaction\/_recurrence.xml":"83f8ed0e8cec81d758a75741236129d6","etc\/adminhtml\/system\/transaction\/billet.xml":"809e52a6015cfa243f2b0bfe6e85d742","etc\/adminhtml\/system\/transaction\/creditcard\/antifraud.xml":"4c3d1f44ad2b079b15c2f94512e3b0c3","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/amex.xml":"a6371c197e214a3ef0d84e2bebb6134d","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/aura.xml":"9364ac675ba0e5dd442263fc6161db66","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/banese.xml":"bcb5e208596ba4535737eee0ae56d29b","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/cabal.xml":"c0a44b113c1b7993624b8770a98caab2","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/credz.xml":"21c96988b918a16f9ad6d0ee81dd3477","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/diners.xml":"cd00780429dfc97ed4be83462664636e","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/discover.xml":"0ac1bfd93317d58156dff288b0b9f4c8","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/elo.xml":"dd620e25b286773300e264cad91f46e2","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/hipercard.xml":"2830e08bfdb8f607213cf89017094fdf","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/jcb.xml":"d7388ea8caf0f28909142ef25a7e0f21","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/mastercard.xml":"76b187fb264d7b6712b24e24ad313406","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/visa.xml":"abaa1b113c10b2d3d451a5ac9d34bf87","etc\/adminhtml\/system\/transaction\/creditcard\/installments.xml":"1dcdf097399b51f3ab71deba8ab63042","etc\/adminhtml\/system\/transaction\/creditcard\/types.xml":"9941595d4276c99738c830537c1a22b2","etc\/adminhtml\/system\/transaction\/creditcard.xml":"e0ca0b7abe0a48d1228197a87de0af51","etc\/adminhtml\/system\/transaction\/debit\/types.xml":"f5be611051dfa466ba5dec74922a32c3","etc\/adminhtml\/system\/transaction\/debit.xml":"52e7ee70da0fbd9d248a3c2b1ecbd6e5","etc\/adminhtml\/system\/transaction\/multibuyer.xml":"d7810c4aa68da90b95292bd483159793","etc\/adminhtml\/system\/transaction\/multipleactionscreditcardbillet.xml":"add2981e23f2cf7ade5d58c10570bada","etc\/adminhtml\/system\/transaction\/multipleactionstwocreditcard.xml":"fd47229ac3b954e6813683fdee77bc78","etc\/adminhtml\/system\/transaction\/pix.xml":"9a7ac83c28bac31e0842b6c0543a97b9","etc\/adminhtml\/system\/transaction\/voucher\/types.xml":"302407ee57c094cde8f8a0f566137ecf","etc\/adminhtml\/system\/transaction\/voucher.xml":"7efd0b1b4684a5ae17b060c020c6ede5","etc\/adminhtml\/system\/transaction.xml":"4e009e07e85376eef2e04d8e900dd5b3","etc\/adminhtml\/system.xml":"545c384ff621caa8282a6dfb0da9e9d9","etc\/adminhtml\/ui_component\/plan_product_listing.xml":"efa1956c1c3462b07f4df8d8b8d7d100","etc\/config.xml":"73a839b3d159c0551136dd4e7df3baf0","etc\/csp_whitelist.xml":"e47c7ae2c05d0df46b91d29cf3cb6cf2","etc\/di.xml":"4bbb7bce859cd1b5b9594a59a640dad1","etc\/events.xml":"8c03a9dbecf8526d383a88a030e794e1","etc\/frontend\/di.xml":"225e69ef6b17dfb39b145bf7657415a1","etc\/frontend\/routes.xml":"ad43e5a9c1f0ddf6da3d9d195dcfbba6","etc\/module.xml":"d45c4eb4c94ccbd6441e6258c32bb41f","etc\/payment.xml":"f6593f60f29bffd45ed4557b15c231cd","etc\/webapi.xml":"c6014a5d5d62b61efa6b1a99304837c5","i18n\/en_US.csv":"19f557f442d5b695cdd272a1fc758720","i18n\/pt_BR.csv":"376fc0a477e83425fd9be2f87ecd1950","patches\/0001-issues-18195.patch":"3579be995b868e8bc31470b82511f58e","view\/adminhtml\/layout\/adminhtml_system_config_edit.xml":"4e4607bb13fe2162966af52bede68057","view\/adminhtml\/layout\/pagarme_pagarme_cards_index.xml":"887a43156f512585a7b7f65f453fdce4","view\/adminhtml\/layout\/pagarme_pagarme_charges_index.xml":"3f6f17a466f2f620a61fea6c4470dc70","view\/adminhtml\/layout\/pagarme_pagarme_invoices_index.xml":"bf1331af0834aca51c671451ae57f537","view\/adminhtml\/layout\/pagarme_pagarme_plans_create.xml":"d6c0a4859c7c194ff03d0a2ecdd08763","view\/adminhtml\/layout\/pagarme_pagarme_plans_index.xml":"502cf46c4bc9fb132ffdd2e279179002","view\/adminhtml\/layout\/pagarme_pagarme_recurrenceproducts_create.xml":"1a7d78ebee01d01277d9a324a83e8508","view\/adminhtml\/layout\/pagarme_pagarme_recurrenceproducts_index.xml":"859b1612c4b9d3bb5ced6419cb5f7ff0","view\/adminhtml\/layout\/pagarme_pagarme_subscriptions_details.xml":"7d60a66fe93c90b7b75f2ed505906550","view\/adminhtml\/layout\/pagarme_pagarme_subscriptions_index.xml":"4f56d86566620045615705e37620fcf5","view\/adminhtml\/layout\/sales_order_create_index.xml":"8c308a488b49b8b42cb92c3e4ddf7343","view\/adminhtml\/layout\/sales_order_create_load_block_billing_method.xml":"10675c985e014d470c4d9bee97bb678f","view\/adminhtml\/layout\/sales_order_view.xml":"5eb7f65b38129182f76e26e76385ab33","view\/adminhtml\/templates\/customer\/cards.phtml":"83c7d80f3a32d427c3821ed9709bad2e","view\/adminhtml\/templates\/form\/creditcard.phtml":"add5e213e202df2143c432e01c73d9e9","view\/adminhtml\/templates\/info\/billet.phtml":"2f5a004728b0a5f7adb224cd220a1ef9","view\/adminhtml\/templates\/info\/billetCreditCard.phtml":"0a07344a071306c681834735fb86b3d9","view\/adminhtml\/templates\/info\/creditCard.phtml":"b7b77923e3d1d42afc826427f3e75b1a","view\/adminhtml\/templates\/info\/pix.phtml":"c5ba26e88a3fed78e16f1f467b42864b","view\/adminhtml\/templates\/info\/twoCreditCard.phtml":"0a220c7417af668dbf3ce1102a44b2bc","view\/adminhtml\/templates\/payment\/info\/billet.phtml":"9e6806b30916bad2cc4bbaf8b6ef0171","view\/adminhtml\/templates\/recurrence\/plans\/create.phtml":"ee52e7b04521fe49151b7b36105be063","view\/adminhtml\/templates\/recurrence\/subscriptions\/create.phtml":"8f31d226eeead0a42f2ad1362e2e1c37","view\/adminhtml\/templates\/recurrence\/subscriptions\/details.phtml":"c364c5a3b218ce55a7cc1e2e2c2925e4","view\/adminhtml\/templates\/tab\/view\/order_charge.phtml":"942d56890867faf265f7fe5cee283aa2","view\/adminhtml\/ui_component\/pagarme_pagarme_cards_index.xml":"4a8edc3cf66deeda8149bcd86e8925ee","view\/adminhtml\/ui_component\/pagarme_pagarme_charges_index.xml":"7239b9e237b04739c013291385e3e2d7","view\/adminhtml\/ui_component\/pagarme_pagarme_invoices_listing.xml":"5eee50f41de04e97558aa8c538d0ac15","view\/adminhtml\/ui_component\/pagarme_pagarme_plans_listing.xml":"1869cab509e383e05e813fa807505b75","view\/adminhtml\/ui_component\/pagarme_pagarme_recurrenceproducts_listing.xml":"f5b81b21aa80a9641ca44c5a74379882","view\/adminhtml\/ui_component\/pagarme_pagarme_subscriptions_listing.xml":"579e0e87d3a0d8eaecbe408ac543efcc","view\/adminhtml\/web\/css\/hub_button.css":"a458bbe14174c7d6b9a9363f65ff8142","view\/adminhtml\/web\/css\/jquery-ui.min.css":"8dcebf12fbabea677390cfa6d9ad09fb","view\/adminhtml\/web\/css\/pagarme_style.css":"a49a28987438356ff07856f12193dbf2","view\/frontend\/layout\/checkout_index_index.xml":"b3bc872d6ab401c34ed3c498da3a892d","view\/frontend\/layout\/checkout_onepage_success.xml":"7254e97cf57d1c75eada7951fbbd2375","view\/frontend\/layout\/customer_account.xml":"cd5ee0022db7bd1306085321d795313d","view\/frontend\/layout\/pagarme_customer_cards.xml":"45326aa3e6e248bef518c53943c863fc","view\/frontend\/layout\/pagarme_customer_invoice.xml":"ce219436de951ad151a517bd06d1a362","view\/frontend\/layout\/pagarme_customer_subscription.xml":"c6d86376a8e4feeac79965a6cfacb1d6","view\/frontend\/requirejs-config.js":"5142463c632c65b2090fb3f4140f3539","view\/frontend\/templates\/customer\/cards.phtml":"e42a42935c6a0624ef98e4933400716e","view\/frontend\/templates\/customer\/invoice.phtml":"82c2eb5a1ee7e0d8a1eb4b5f6f111d63","view\/frontend\/templates\/customer\/subscription.phtml":"83b3b972e741fbde1882b3690e48367f","view\/frontend\/templates\/info\/billet.phtml":"18e2e36e8da4433f68df5f658ca35baa","view\/frontend\/templates\/info\/billetCreditCard.phtml":"9913bb0d2613b4a0dbcbe6587c18465d","view\/frontend\/templates\/info\/creditCard.phtml":"ceecdd60e7955c4427827c61fa27f589","view\/frontend\/templates\/info\/pix.phtml":"7e93afc4237e622446e8ab7463ca24d3","view\/frontend\/templates\/info\/twoCreditCard.phtml":"c4faca2b8efe544aea4d435eca78ca76","view\/frontend\/templates\/payment\/billet.phtml":"008e05d15ac3dd7f2d5db882619b3778","view\/frontend\/templates\/payment\/pix.phtml":"6f7fd1a92e1e9c6ab1c4fe0dc2f18f61","view\/frontend\/templates\/product\/priceFinal.phtml":"4165160fda9cb695c2911c59f42491a4","view\/frontend\/web\/css\/pagarme_style.css":"7755a0d3a04d2ecb788eadf3bb4fb205","view\/frontend\/web\/template\/payment\/boleto-form.html":"a4d7db1d36c9a1e18249d64c5803fcd5","view\/frontend\/web\/template\/payment\/boleto.html":"c52e34221346043ac23221e2182bcece","view\/frontend\/web\/template\/payment\/boletocreditcard.html":"6e257471cb9091c3f0624b80eeba69eb","view\/frontend\/web\/template\/payment\/creditcard-form.html":"53cfca9d53bf33d9434d4ccf8c797e42","view\/frontend\/web\/template\/payment\/creditcard.html":"59a8715f141f5486eaa2969b118f35b5","view\/frontend\/web\/template\/payment\/debit.html":"7ea6e00a8e5fde553ce5ef2bf0fa8ece","view\/frontend\/web\/template\/payment\/default.html":"a34e52a9c642afd5f5fa32240651c252","view\/frontend\/web\/template\/payment\/multibuyer-form.html":"ef6faf29c52fffae0914a8974bbe7cf0","view\/frontend\/web\/template\/payment\/pix-form.html":"99b4332117619550d10a7534c5e33466","view\/frontend\/web\/template\/payment\/pix.html":"dc0445c884e16179ff07c18fc6c4cd07","view\/frontend\/web\/template\/payment\/twocreditcards.html":"c788874c3d3c2c69219cc32fc19bc566","view\/frontend\/web\/template\/payment\/voucher.html":"7ea6e00a8e5fde553ce5ef2bf0fa8ece"} \ No newline at end of file +{"Api\/BaseRequestDataProviderInterface.php":"a3fdc44584c2ebea97041c464a4b3537","Api\/BilletCreditCardRequestDataProviderInterface.php":"acd369021f7ca56acf812c5127455ab4","Api\/BilletRequestDataProviderInterface.php":"f2adc2feeeab796f2f8ea3af6df5f0d9","Api\/BulkApiInterface.php":"e2cb981f205f6d47aa809b9c4a02d81f","Api\/BulkSingleResponseInterface.php":"6af56ffdb64e05023e7d0ae869f0d40f","Api\/CardsManagementInterface.php":"046aace3483cf065bb08f7473173a99a","Api\/CardsRepositoryInterface.php":"1391d4314aca2b474d5ac2d54d83b180","Api\/CartItemRequestDataProviderInterface.php":"efeec6d8d81b4e16bdba05cd019eb416","Api\/ChargeApiInterface.php":"fc02cc0342790cb475d7b765280921ac","Api\/ChargesRepositoryInterface.php":"6dc223249c0f43dcd6f79bb21a51063a","Api\/CreditCardRequestDataProviderInterface.php":"8985d5d269d7a06532bf0a10e553e255","Api\/CustomerRepositoryInterface.php":"532334f0f837cb933ddb1a2c0c1ec99d","Api\/Data\/CardsInterface.php":"278f719fc6c042300e6a2156f7e76c07","Api\/Data\/CardsSearchResultsInterface.php":"d4bc9e79bc5c176791f15752e6e2b0c2","Api\/Data\/ChargesInterface.php":"8f1bd48765186084b0ea219ed4ddc490","Api\/Data\/ChargesSearchResultsInterface.php":"4b5786b4e0db410af8fe3690c3ac6920","Api\/Data\/CustomerInterface.php":"9018a580fa6673e269303224c8d79b04","Api\/Data\/CustomerSearchResultsInterface.php":"e994da3200f1cb24b5782d156e92c15e","Api\/Data\/InstallmentInterface.php":"4a1ff2a051f0a4f611c6a47c7aff3ed9","Api\/Data\/RecurrencePriceInterface.php":"e637ea69dda6d89bd8b6c0f2a7baa4c0","Api\/Data\/RecurrenceProductsSubscriptionInterface.php":"afc1af4ecd0bc0463066473b468734b5","Api\/Data\/RecurrenceProductsSubscriptionSearchResultsInterface.php":"9d3a236b8c4c210eede6218c1c3c5dca","Api\/Data\/RecurrenceSubscriptionRepetitionsInterface.php":"4cd98a7ca1ce805bb4eff86dbcb7cf13","Api\/Data\/RecurrenceSubscriptionRepetitionsSearchResultsInterface.php":"2bcd31dde0e09d5d1959b5bf7eb967d8","Api\/Data\/SavedCardInterface.php":"a88d96adafc0cb17b0ab44d14f94bf81","Api\/Data\/SavedCardSearchResultsInterface.php":"79046c1e78855413757e60c15ad30cd8","Api\/HubCommandInterface.php":"5cffdca857f6dae9fa98919d9400dd83","Api\/InstallmentsByBrandAndAmountManagementInterface.php":"34531e74f83f9f44d00ffb304f6b04b1","Api\/InstallmentsByBrandManagementInterface.php":"3938666296af2dcb07fac5fc602c349b","Api\/InstallmentsManagementInterface.php":"d66755cd2956a66312fa7edd4d35af96","Api\/InvoiceApiInterface.php":"8e3be8ee5fa24c362a5e3c02dd8a3aef","Api\/MaintenanceInterface.php":"7ff4300a43ae35961b52aebea5918b90","Api\/ObjectMapper\/ProductPlan\/ProductPlanMapperInterface.php":"f781bc611a8cab4a06e4ac773a650724","Api\/ObjectMapper\/ProductPlan\/SubProduct.php":"0038aaada32f85f1daa0577150e9983b","Api\/ObjectMapper\/ProductSubscription\/ProductSubscriptionMapperInterface.php":"f336ade7fbee4ca9404503903a6be705","Api\/ObjectMapper\/ProductSubscription\/RepetitionInterface.php":"1fe05b5e8ccdedaf85961ddaddbcb244","Api\/PagarmeServiceApiInterface.php":"0ef94ea30fa5439fee4c6f6d977b801a","Api\/PixRequestDataProviderInterface.php":"f0f072fa2248af27f6c0e67b45a7b0e6","Api\/ProductPlanApiInterface.php":"840615ebcbaf6b90428bd49b508ac48b","Api\/ProductPlanInterface.php":"b230677fce0a196d1730a9984a1a1bfc","Api\/ProductSubscriptionApiInterface.php":"d43c0078b32274426cc4b4eb7fe2dc06","Api\/ProductSubscriptionInterface.php":"fc195b0e01e2b21b70643fed2fbdc755","Api\/RecipientInterface.php":"678d8dbab44aefd38a65fcfe50d963b1","Api\/RecurrenceProductsSubscriptionRepositoryInterface.php":"5543f6f8699d660bc097475523c8528d","Api\/RecurrenceSubscriptionRepetitionsRepositoryInterface.php":"e81e207bf174e9b66a9d99328b3079b2","Api\/SavedCardRepositoryInterface.php":"68cb6e6404b1a07b55eefb4d7a46ab43","Api\/SubscriptionApiInterface.php":"5eab18115c3f96fbaa7e0b83ca8b5a40","Api\/SystemInterface.php":"622eca974cbfcc0fda4205f5ad28f99b","Api\/TwoCreditCardRequestDataProviderInterface.php":"d85968ced59736de93a023412f7d8d29","Api\/WebhookManagementInterface.php":"3e34391f524ad9e8f57cf48719959258","Block\/Adminhtml\/Customer\/Cards.php":"493ca9983db5f2837904d43d14b7ab26","Block\/Adminhtml\/Marketplace\/Recipient.php":"39f07cd0a14996af5224e2d0de0cd0e8","Block\/Adminhtml\/Order\/Charge\/Tab\/View.php":"39d5a739179ee6c95500ebcfd9676445","Block\/Adminhtml\/Recurrence\/Plans\/Plan.php":"b5ec57237da588e2e1ba38a9322b4ba4","Block\/Adminhtml\/Recurrence\/Subscriptions\/Subscription.php":"ce8887316d4f692474c8c6a8e43b2d4b","Block\/Adminhtml\/System\/Config\/Form\/Field\/HubEnvironment.php":"89bbe419e2ab45ea3acb0f9197010c9f","Block\/Adminhtml\/System\/Config\/Form\/Field\/HubIntegration.php":"28c76eb58b48ae29b523285f9e5b5577","Block\/Adminhtml\/System\/Config\/Form\/Field\/MarketplaceMessage.php":"4596fc2c969067ea22e3d22d65cde6ab","Block\/Adminhtml\/System\/Config\/Form\/Field\/ModuleVersion.php":"8b8f19bfa85f65c30ec332be235aa9ea","Block\/Adminhtml\/System\/Config\/Form\/Field\/SearchRecipient.php":"9b51d2cab7844082349f9466c849d409","Block\/Adminhtml\/System\/Config\/Form\/Fieldset\/CycleDiscount.php":"deb67822224809de7bba438042006ef4","Block\/Adminhtml\/System\/Config\/Form\/Fieldset\/Group.php":"985dc2e0dfc6ea99ad8aac3bf99651a2","Block\/Adminhtml\/System\/Config\/Form\/Fieldset\/Payment.php":"da7327dbe0e26b142d77534e20170469","Block\/Customer\/Cards\/Container.php":"2561edfbbbace756d6cea9a5c45ac533","Block\/Customer\/Cards.php":"714242518ad955fd1aba034c594e508e","Block\/Customer\/Invoice.php":"dd42c008b7b137e63e9350d0901e73e9","Block\/Customer\/Subscription.php":"f03586f9e6404132b4340e67292eaec2","Block\/Form.php":"c752d4bf9dbbd1ca49e4d9ec381c4cec","Block\/Payment\/Billet.php":"87e0693690132c281a6b113f8b2af56f","Block\/Payment\/Info\/Billet.php":"1ae2f22f17dd14676d9bf31faf8e4acd","Block\/Payment\/Info\/BilletCreditCard.php":"fb49099882ae8af6b920a3a205f37d1e","Block\/Payment\/Info\/CreditCard.php":"9f308c552219919783afda2d8019eae1","Block\/Payment\/Info\/Debit.php":"ec3987d4cebee7ed7b1385d02c786d70","Block\/Payment\/Info\/Pix.php":"4e87ee0584824a2cb80b1526020f265d","Block\/Payment\/Info\/TwoCreditCard.php":"f570925789e6b52f7dc0d061a767e848","Block\/Payment\/Info\/Voucher.php":"5751aca84267178db0981a9a7d42f792","Block\/Payment\/Pix.php":"a6ddfdf8ef7cbf8069b1a73e7e254bb2","Block\/Product\/View\/Price\/Recurrence.php":"1421ee2fc608ebb4f431fde6d90bf43e","Concrete\/Magento2CoreSetup.php":"03eb50cd7638a84325c219e5b7084620","Concrete\/Magento2DataService.php":"1cc4d39605c9dfdf5d30d0f0d791a322","Concrete\/Magento2DatabaseDecorator.php":"acafabaee67d3383c1470bbf921c8b6f","Concrete\/Magento2PlatformCreditmemoDecorator.php":"84296416830d48cb261679739c670d29","Concrete\/Magento2PlatformCustomerDecorator.php":"f213a2f858068d40e187b44c47281e94","Concrete\/Magento2PlatformInvoiceDecorator.php":"ea333b7ca55816895ebd185f0a2419b0","Concrete\/Magento2PlatformOrderDecorator.php":"7634d1f7ba7489cf4d3995eb8e474fc3","Concrete\/Magento2PlatformPaymentMethodDecorator.php":"840ac3a0fb382b20067811bead6b814f","Concrete\/Magento2PlatformProductDecorator.php":"29b51ba3ea4ceed3f617e6234af04f31","Concrete\/Magento2SavedCardAdapter.php":"a4a6464ebad93a7e9138cf24344ea32f","Console\/Command\/MigrateExecute.php":"1a45ba803a609a20ea3c6e1ce7810b04","Console\/Command\/MigrateList.php":"40db660172d349a91e780f80556b3914","Console\/MigrateData.php":"f7db41676f1c6dbf7266721f5c8f91eb","Controller\/Adminhtml\/Cards\/Index.php":"c689df20170615d8579cab25cfe624c1","Controller\/Adminhtml\/Charges\/Cancel.php":"e54edebaf78eb573754167d1f9740d22","Controller\/Adminhtml\/Charges\/Capture.php":"dae3338c19c5092593b999029457b504","Controller\/Adminhtml\/Charges\/ChargeAction.php":"4f2eb6603be3806762657ff4c632257c","Controller\/Adminhtml\/Charges\/Index.php":"e756bb11bed78f0822efa4f0fd61b989","Controller\/Adminhtml\/Hub\/Index.php":"245191d5c2a36b1a80a6cc8218c38f0d","Controller\/Adminhtml\/Invoices\/Delete.php":"3f1c6775fe792e4a98f2bb755b32f2ec","Controller\/Adminhtml\/Invoices\/Index.php":"aa39d70426b48bc7d20a456aa5386e69","Controller\/Adminhtml\/Plans\/Create.php":"af9b10f4f5304f532e4fbd1238b21eed","Controller\/Adminhtml\/Plans\/Delete.php":"f1d3dabdfa44061bac44b0b1344c3723","Controller\/Adminhtml\/Plans\/Index.php":"cbb446e47f7f241e755aac73a8912cdd","Controller\/Adminhtml\/Plans\/PlanAction.php":"35b8f2f8706c7eeeefa6c488fe2d4e1c","Controller\/Adminhtml\/Plans\/SearchProduct.php":"c6f4dbce39573cc6acf8f3b9b1ce0d2f","Controller\/Adminhtml\/Recipients\/Create.php":"51433213e5a9aa507f4bbdfd2067dcb8","Controller\/Adminhtml\/Recipients\/Delete.php":"e28b3a877e110aee48461895ae799e71","Controller\/Adminhtml\/Recipients\/Index.php":"2ef3c0c23d324bb9f232093807d7141d","Controller\/Adminhtml\/Recipients\/RecipientAction.php":"d9b77ce0dd861f72a8effdadd72fc569","Controller\/Adminhtml\/RecurrenceProducts\/Create.php":"f9487f6b907fcfb84a240d731fc9d3a3","Controller\/Adminhtml\/RecurrenceProducts\/Delete.php":"64895404eb98ad9857782e4fbb085790","Controller\/Adminhtml\/RecurrenceProducts\/Index.php":"864744d5ffedfe584d27dfeeb7cbd8b1","Controller\/Adminhtml\/Subscriptions\/Delete.php":"b740c07a33e31b9b8e015524a95952d1","Controller\/Adminhtml\/Subscriptions\/Details.php":"b22306c13d19a7bd0e92a02eccf560da","Controller\/Adminhtml\/Subscriptions\/Index.php":"c8a84b21345f459b89afa4afc025745b","Controller\/Cards\/Remove.php":"15b198e77fdeadac1a07ed4b8935d517","Controller\/Customer\/Cards.php":"f9fcc7d6648af33cc72f22515bdce52c","Controller\/Customer\/Invoice.php":"439f667282053ee11a03265dddd713aa","Controller\/Customer\/Remove.php":"8dcc9bf447bf5488228f9c958cce3d12","Controller\/Customer\/Subscription.php":"e3469ecb1ecd2206233f05b8968637ce","Factories\/BulkSingleResponseFactory.php":"788ff6950209c610d74ebda0d29b26d5","Gateway\/Transaction\/Base\/Command\/AbstractApiCommand.php":"dbcfefb25d2bee7fb1a1cf05a1ea1501","Gateway\/Transaction\/Base\/Command\/InitializeCommand.php":"c818ffe1b6f7c6b48cdd03fb28cc7d39","Gateway\/Transaction\/Base\/Config\/AbstractConfig.php":"03ec8f382c525e4937c5e67d62f47235","Gateway\/Transaction\/Base\/Config\/Config.php":"47abe02041090584cdaf8355cacd17fb","Gateway\/Transaction\/Base\/Config\/ConfigInterface.php":"e90c15a0f057fa4186653e69970259f8","Gateway\/Transaction\/Base\/ResourceGateway\/AbstractRequestDataProvider.php":"f1140a27bb429859595d1ac5abcdc9a6","Gateway\/Transaction\/Base\/ResourceGateway\/CartItemRequestDataProvider.php":"08f65fc67a1569f45ac75e0284c4f16d","Gateway\/Transaction\/Base\/ResourceGateway\/Response\/AbstractHandler.php":"8347ed2c90c35443a6dfc284719c86bc","Gateway\/Transaction\/Base\/ResourceGateway\/Response\/AbstractValidator.php":"e66941ef701125b68b4fe8f14d3dbbd6","Gateway\/Transaction\/Billet\/Command\/AuthorizeCommand.php":"830f06f9e8350187992f2b1e46f73198","Gateway\/Transaction\/Billet\/Config\/Config.php":"ddef33e39170023842f01878f29fbad7","Gateway\/Transaction\/Billet\/Config\/ConfigInterface.php":"284234453377a178bcf320589fd7322b","Gateway\/Transaction\/Billet\/ResourceGateway\/Create\/RequestDataProvider.php":"126b622ca5c073a418c7819c5237751f","Gateway\/Transaction\/Billet\/ResourceGateway\/Create\/Response\/Validator.php":"b83be35cc9570e0652ff55d0c0f2fb8e","Gateway\/Transaction\/BilletCreditCard\/Command\/AuthorizeCommand.php":"b0c951990b07121936a570d7fc90811b","Gateway\/Transaction\/BilletCreditCard\/Command\/CaptureCommand.php":"75647754dc381088aa0215fc55f73a7c","Gateway\/Transaction\/BilletCreditCard\/Command\/RefundCommand.php":"a087df263d5c121cb65174dfa0230e4a","Gateway\/Transaction\/BilletCreditCard\/Config\/Config.php":"60d8679b7df40a617dbe6e49f37a059f","Gateway\/Transaction\/BilletCreditCard\/Config\/ConfigInterface.php":"c2786da1bfc8daf6288404dcb8d7863d","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"932f43765505ceed349855e09dc6c6be","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"3f4379b5a7ebff6026fa8b8fc48af0ee","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"748a88e8125ddcf69ec18a32a1d2411f","Gateway\/Transaction\/BilletCreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"25c534e22063c9dcd1e3745f4ed271cc","Gateway\/Transaction\/CreditCard\/Command\/AuthorizeCommand.php":"040f21a1ff363be6ef1075d81bbdf13c","Gateway\/Transaction\/CreditCard\/Command\/CaptureCommand.php":"725a509ad624be59fa78cb8d4f6ebcd4","Gateway\/Transaction\/CreditCard\/Command\/RefundCommand.php":"db4dd625e44679a6c3d4accbf1911444","Gateway\/Transaction\/CreditCard\/Config\/Config.php":"b93df339fa30033fa188b28b95a1871b","Gateway\/Transaction\/CreditCard\/Config\/ConfigInterface.php":"93f08c285b8300c86709808da97f0aec","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Capture\/Response\/GeneralHandler.php":"2dd81d817c3cf3271beac1736f8e57cd","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"2cc693bd44c49a59e2cd10239f4bcd8b","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"0a08490321ab1e4950266726a94eee67","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"1be04e105120b30e7dd835b0ca554b9b","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Refund\/Response\/GeneralHandler.php":"cf1aeb148bb53488aff4d49fc120def6","Gateway\/Transaction\/CreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"e070f0fcf345925ccd9b193811567d97","Gateway\/Transaction\/TwoCreditCard\/Command\/AuthorizeCommand.php":"984d76eec10d644f6a02c312cadc2a5f","Gateway\/Transaction\/TwoCreditCard\/Command\/CaptureCommand.php":"3b17314ffb9ac796f3c1f27f25b85d96","Gateway\/Transaction\/TwoCreditCard\/Command\/RefundCommand.php":"e480ee822cc2db5aaa54c9a372f297f7","Gateway\/Transaction\/TwoCreditCard\/Config\/Config.php":"3b1be172e32efba7a7371f8d88d932a1","Gateway\/Transaction\/TwoCreditCard\/Config\/ConfigInterface.php":"367e736bab8a6b332304bd133cbe5e9c","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Capture\/Response\/Validator.php":"2a0aae505868b099da3c89a95f31cc03","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Create\/RequestDataProvider.php":"ea77649a47f20199c42419e751b131d7","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Create\/Response\/Validator.php":"a23b696b2e2a0c0d8bae101682a388f7","Gateway\/Transaction\/TwoCreditCard\/ResourceGateway\/Refund\/Response\/Validator.php":"773b4107526a09446a9f58e5914afb33","Helper\/AbstractHelper.php":"87da1986967f4da6320f236c308d4702","Helper\/Adminhtml\/CheckoutHelper.php":"a1d8dbb6bebd39ac44057b00f03ef0c6","Helper\/BuildChargeAddtionalInformationHelper.php":"a20c054bd32177431bcde5bd65e03b88","Helper\/Cards\/CreateCard.php":"7bec2850d5b095616d0df1bba58a3109","Helper\/CustomerAddress.php":"3f6f0ee15cddd895dfb6cb177e24186f","Helper\/CustomerAddressInterface.php":"9f723dd31eb76ad70bb7b8659fc1a120","Helper\/CustomerCustomAttributesHelper.php":"88ae2860bc8b03c9bb660a33ec0315e1","Helper\/CustomerUpdatePagarmeHelper.php":"4c29653b82fbe48f967239818dac9d7e","Helper\/HtmlTableHelper.php":"b071cd3c99b7e8b5bd138b18647bb45b","Helper\/Marketplace\/Handlers\/ExtrasAndDiscountsHandler.php":"660ebfb5604ac7c28099316577524de6","Helper\/Marketplace\/Handlers\/MarketplaceHandler.php":"ef8ae2aa0e196d5febec8f78ab4565f9","Helper\/Marketplace\/Handlers\/SplitRemainderHandler.php":"f1d5034d06a02b3b31ed7e35c90a664a","Helper\/Marketplace\/Traits\/SplitExtrasAndDiscountsRuleTrait.php":"96a94f7a179351998d8321d8d8a422dc","Helper\/Marketplace\/Traits\/SplitRemainderRuleTrait.php":"0f14ec48f57d793311967161e03d4156","Helper\/Marketplace\/WebkulHelper.php":"2e1aa4bd94a6471e40eece2c53b66b6c","Helper\/ModuleHelper.php":"61e03e3dab3584ea4bf2e732446532c5","Helper\/MultiBuyerDataAssign.php":"29995fd5c3d3b483106d0e4c870bcb48","Helper\/NumberFormatHelper.php":"f7ddebaab1881c026e3060dfe7ac3884","Helper\/Payment\/Billet.php":"7b770ebe2dfbd692683851a148897c8c","Helper\/Payment\/Pix.php":"bd324cec2d9bcc09f674d44cf55ad0a7","Helper\/Product\/Configuration\/Plugin\/Plan.php":"35dab5fd3303f06f53f46648b78335cd","Helper\/ProductHelper.php":"a0830bfdcdb14c31e00870e66ff93958","Helper\/ProductPlanHelper.php":"f28a1083b7a89cb74eadf75b16790f83","Helper\/ProductSubscriptionHelper.php":"3740b5f72361e373cf2ad98f36708f89","Helper\/RecurrenceProductHelper.php":"ed7620351551a071fdc3e8ecd8b6cf9d","Helper\/RulesCartRun.php":"014121cb07969350f804511dd8edfff0","Model\/AbstractInstallmentManagement.php":"dec788dd12cfc0552e9b4c6ac7ddb8a5","Model\/Api\/Bulk.php":"8f26197aaaacf28a964c80c8ca3f955e","Model\/Api\/BulkSingleResponse.php":"d8e7ad0b8ce6afd0540bc5657e3238db","Model\/Api\/Charge.php":"317b9da3de066501d910b983a2703623","Model\/Api\/HubCommand.php":"1293c542f82252b4e19ab9196b8886c9","Model\/Api\/Invoice.php":"1a1342f81c7b14927da07eb0a7cc69fb","Model\/Api\/ProductsPlan.php":"b827aa52f13d38ac897503bf7b0a7fd8","Model\/Api\/ProductsSubscription.php":"dafb49c49484ad68bbbb267846b432b1","Model\/Api\/Recipient.php":"3c03196304ad7d3bfac742d88b222df3","Model\/Api\/ResponseMessage.php":"4cc6fdf266763c9983345d47aed43923","Model\/Api\/Subscription.php":"2f90dff449aa2de15b2ac92a22d71f1a","Model\/Cards.php":"3cb39fc5ec17e1acbcea1928764b92a1","Model\/CardsRepository.php":"779033ba25fa3b74cc3910312d04807b","Model\/Cart\/CartConflict.php":"773d019a49b7f5c6a02bf2a168adcf2e","Model\/Charges.php":"6c2e6707c6bce66dd9d27c2a0c8ee42e","Model\/ChargesRepository.php":"dbc4fdaf2ad341a19941960220a1534b","Model\/ConfigNotification.php":"7e0d5f6e92349a5a2e047e8835498fd3","Model\/Customer.php":"916380e43673adce760913669f6e76b2","Model\/CustomerRepository.php":"3bafe9f2fc8ab827dcc349ddbbeb8a8d","Model\/Enum\/BankEnum.php":"0d7cd40e69d010f77dce11873a99b7cf","Model\/Enum\/CountryEnum.php":"25d3f3c2118013907874e3c2036fb20e","Model\/Enum\/CreditCardBrandEnum.php":"38046790649e063c50ad9b17c0687d76","Model\/Enum\/CreditCardOperationEnum.php":"386977a6dd579aaddbd7fe70ea7fd035","Model\/Enum\/DocumentTypeEnum.php":"5ad9cddbf736b0f13624f91bc866a21f","Model\/Enum\/PersonTypeEnum.php":"fc4d5759d05eb76b71def40d1f9f1fbe","Model\/Installment.php":"b875fe5acf098abc33b0e514794b6edf","Model\/Installments\/Builder.php":"3d2f6841b92e242d16a7b1690899beab","Model\/Installments\/BuilderByBrand.php":"b11fff0e54eef9c5385501b8cb1af306","Model\/Installments\/BuilderByBrandAndAmount.php":"94d196934237932b7929b4e676f2fcac","Model\/Installments\/Config\/Config.php":"b6aa518a72efea846a992a57d409e61f","Model\/Installments\/Config\/ConfigByBrand.php":"dc6c1a80a6bf613a31b0f710d16caa9f","Model\/Installments\/Config\/ConfigByBrandInterface.php":"4c454389f5a6039fa01a3b5ff6a6c69f","Model\/Installments\/Config\/ConfigInterface.php":"be24d358d670ab7e1bda8e588b7f8d47","Model\/InstallmentsByBrandAndAmountManagement.php":"3d154a623476f2c691dfe89c6b16ee89","Model\/InstallmentsByBrandManagement.php":"d33667cfd3e11ac99d6b442175f288a3","Model\/InstallmentsManagement.php":"15539ea3b27d4c97588ba45474d2bc7a","Model\/Invoices.php":"d83b3c9c8e3eb84d05f547d0d657b8d1","Model\/Maintenance.php":"648af2142ca2536aed521ebf542938fa","Model\/Notifications.php":"5be4a951c7d66abc7bfa375ec03c2e37","Model\/PagarmeConfigProvider.php":"58460a29e5611f77a4a8ac609000d77d","Model\/Payment.php":"d1f1a5b3389e801b238fade135efb4a6","Model\/Product\/OnlyPlanItem.php":"d26a338455cba312992e7657c75aa64e","Model\/Product\/ProductPlan\/Cart\/Configuration\/Plugin\/Plan.php":"09e7b687f211ca72a3644b51527a7e95","Model\/Product\/ProductPlan\/CopyConstructor\/Plan.php":"63309836bf27c8bc645613d246ed4517","Model\/Product\/ProductPlan\/Initialization\/Helper\/ProductLinks\/Plugin\/Plan.php":"adfa6b11bcc6f0d8fe8ac95b605bf766","Model\/Product\/ProductPlan\/Plan.php":"11173e45b24a8752a82fc744a565fdc4","Model\/Product\/ProductPlan\/Type\/Plugin.php":"36eb6e2505a87210ec6f496a4fcb3ca2","Model\/Product\/Recurrence.php":"e460c4707d593b0cd74919cc35a3d8b1","Model\/ProductsPlan.php":"c3a552eed0db0e7c17f4ea1f574b3318","Model\/ProductsSubscription.php":"e57ac629a4b527b4b4c15cf40ddc071f","Model\/Recipient.php":"22060a84bcfa77a178d8aa5a1a5ff298","Model\/RecurrenceProductsSubscription.php":"f3745d79597f510e29ab71ece5eccd58","Model\/RecurrenceProductsSubscriptionRepository.php":"3d5037074261c7e8d3dfe53592704942","Model\/RecurrenceSubscriptionRepetitions.php":"e46b4b4783672369faab3ef92a055481","Model\/RecurrenceSubscriptionRepetitionsRepository.php":"5dd4be8245ec269a0f71ba841419b94a","Model\/ResourceModel\/Cards\/Collection.php":"0be875c656b22f1ec917bffb623ce3b7","Model\/ResourceModel\/Cards.php":"684dceb44bc9dda259dfeaf39ffde27c","Model\/ResourceModel\/Charges\/Collection.php":"7d869d192399534fb9cb197aa39ac497","Model\/ResourceModel\/Charges.php":"673e8ccf2bbebafb3b6cc3fdbe0c66af","Model\/ResourceModel\/Customer\/Collection.php":"9a831856e434725b861c75007a43a658","Model\/ResourceModel\/Customer.php":"ead0f7ef3884c5cbe8fac49dfddccaee","Model\/ResourceModel\/Invoices\/Collection.php":"b763a7a6ee29052506cfe8c5bd01a9f5","Model\/ResourceModel\/Invoices.php":"1298438e5f6a4b5aabeb446537411e64","Model\/ResourceModel\/ProductsPlan\/Collection.php":"574d01bc0649be59315bb85e8868cdc4","Model\/ResourceModel\/ProductsPlan.php":"f490678d47f15e4ae81de36d3a521f60","Model\/ResourceModel\/ProductsSubscription\/Collection.php":"a4b9cb0aeff628b152d25e70370c10c2","Model\/ResourceModel\/ProductsSubscription.php":"c1cd11095b04daa12714f94340efbc7f","Model\/ResourceModel\/Recipients\/Collection.php":"ebed79d3df0c6e80694b5c53ca873842","Model\/ResourceModel\/Recipients.php":"d2027b275ddf97bcab6e161d8b2a9b9d","Model\/ResourceModel\/RecurrenceProductsSubscription\/Collection.php":"d782e63483c41d4e9e23035bcbb313c2","Model\/ResourceModel\/RecurrenceProductsSubscription.php":"db4d63d27efb4e3a999e7cff9e584721","Model\/ResourceModel\/RecurrenceSubscriptionRepetitions\/Collection.php":"40943c9cb4d8e72bb6052013e9fd2f08","Model\/ResourceModel\/RecurrenceSubscriptionRepetitions.php":"291153a2ee88e83168d727a69e63ac70","Model\/ResourceModel\/SavedCard\/Collection.php":"cd135edc6a8579b4ed89d3c542577337","Model\/ResourceModel\/SavedCard\/CollectionFactory.php":"348809cb4a07d7889d29e59f86287bd9","Model\/ResourceModel\/SavedCard\/CollectionFactoryInterface.php":"d80c090ec949c99983752530cc7807d3","Model\/ResourceModel\/SavedCard.php":"041a4cf78528fdf472a0a82552c14170","Model\/ResourceModel\/Subscriptions\/Collection.php":"372e7614c94b01a8e68d2239dc5fae03","Model\/ResourceModel\/Subscriptions.php":"d631d391c5dd4326d9f996231b53d55c","Model\/Sales\/AdminOrder\/Product\/Quote\/Plugin\/Initializer.php":"077864471bcaaec2bfce38175c9f0af3","Model\/SavedCard.php":"4f68122d5cc166eb5ef9e397479a54cc","Model\/SavedCardRepository.php":"015d85738be3875d4037b64885e4af7c","Model\/Source\/Bank.php":"9821cc9081a8bd0871e74fc669ee3b54","Model\/Source\/BilletTypes.php":"9762f11fbe5c925972ccb576a8f0a1e2","Model\/Source\/Billing.php":"1c577ac30681c772053f866d42ccb304","Model\/Source\/BrandTypes.php":"45b242889c4019eeb773e5a9bb918ece","Model\/Source\/Cctype.php":"c369a46b6f523b219437fffce87eb9ff","Model\/Source\/CctypePSP.php":"6a3f4c788242ce6384f168cec5978601","Model\/Source\/Debittype.php":"0cd3b277246d78a34851dededa5b7bf2","Model\/Source\/DocumentType.php":"505764e0a298f2a9f0f9f86df2acb813","Model\/Source\/EavBillingType.php":"8c16b9513a53632036a4e8284a219ea2","Model\/Source\/EavInterval.php":"63e7a4c590c5b1920e8e2a9f10c6e0a1","Model\/Source\/EavPaymentMethods.php":"d35400de85bb40afed107785627dd28c","Model\/Source\/Interval.php":"e3f2e56a5ba4ba1862257bcfba3ac21c","Model\/Source\/Marketplace\/Recipient.php":"d6f1c2c7da6d966fc16d073ff28040ac","Model\/Source\/PaymentAction.php":"8ab3e1337bb5ac2b1be2ddf13a26069a","Model\/Source\/PaymentMethods.php":"3da04d9c68692a4c25f722829da72705","Model\/Source\/PixTypes.php":"3d38fd2775c0c6a82b1f1c8c0ef5de9f","Model\/Source\/Sequence.php":"ab4170daf783d46b92c8dc3df071983c","Model\/Source\/SequenceCriteria.php":"123d2be23a33d0ec30d945411a399301","Model\/Source\/Status\/NewPending.php":"54318ca544e367e7eee8fe482313eb8e","Model\/Source\/Status\/Review.php":"8fc5f78aed2f58e0a2aa7b0819710031","Model\/Source\/Vouchertype.php":"b95ad2c6132bec030b54f6382f29559b","Model\/Subscriptions.php":"cf3e708798910261b1b6b2936eb487c4","Model\/Validation\/GenericValidation.php":"f0444865f1ec6ff1a299c8c49e70e40b","Model\/WebhookManagement.php":"431d81028f39564e2ea607aa1eb8771e","Observer\/AdminCustomerBeforeSave.php":"6247e03cf9adc34c5273f605535d2eab","Observer\/BilletCreditCardDataAssignObserver.php":"031d4470112767dc7acee725d2943095","Observer\/BilletDataAssignObserver.php":"86772c5470e812de7271808de4da4037","Observer\/CartAddProductAfterObserver.php":"32d7eb39aa17937042232c69f46f7efa","Observer\/CreditCardDataAssignObserver.php":"b12087dfb17570a569cffdd1fc9a7703","Observer\/CreditCardOrderPlaceBeforeObserver.php":"a6520a89102d6ef4cf7af035774b3765","Observer\/CustomerAddressSaveBefore.php":"bde35ddc9e5a44786d0183affe1ad94f","Observer\/CustomerLogin.php":"85e7f6fa1ad8fbbf0603b5a8fedd40e2","Observer\/DataValidateAdmin.php":"591a6ae72e710212d907df96107358f9","Observer\/DebitDataAssignObserver.php":"243943e915460c7866796b22063d38f5","Observer\/DiscountCyclesObserver.php":"211007e52d2a973ab9f7e1dcd6be9483","Observer\/OrderCancelAfter.php":"56adf6a468e341d0f409eb7733657cd8","Observer\/OrderPlaceBeforeObserver.php":"bd48ef3108625b4f91f0896281c4afe5","Observer\/PaymentMethodAvailable.php":"20cd59f9ff04d6241ac1819d93d07d56","Observer\/PixDataAssignObserver.php":"e83b9c3c89f1fb5fcf119b6a25930d26","Observer\/SalesOrderPlaceAfter.php":"c2c1b8c4011ad79cbb78fed7fa719b65","Observer\/TwoCreditCardDataAssignObserver.php":"12b2b81df19adee6702df2ba9c236010","Observer\/UpdateProductPlanObserver.php":"ef8f5f5121c4745f95bd3a0a04cd9330","Observer\/VoucherDataAssignObserver.php":"4f0cc241ba3a1f2416d8e78690f30a87","Plugin\/Admin\/CustomerPlugin.php":"d8c43238bec51959b54c2751469c97ab","Plugin\/CatalogWidget\/Block\/Product\/ProductsList.php":"5e4ca265ef85c6cbd51ca74d2ea720bb","Plugin\/Framework\/Webapi\/ServicePayloadConverterInterface.php":"3a5969ac2df76999f9827353ed9f0d30","Plugin\/Princing\/Render\/ProductPriceCyclesPlugin.php":"89de116887e8b2bd4e932d69bf1778c4","Plugin\/Webapi\/RestResponse\/JsonPlugin.php":"490703f70a11551c9176bb3d9fdc9af2","Service\/Client\/Api.php":"f2c0832aaf06ffc0aed877959b469389","Service\/Config\/AbstractSystem.php":"c65df4b80d93de7d66f2ffaf51552630","Service\/Config\/Path.php":"99bb0f50feae6c130537e80911813c11","Service\/Config\/System.php":"1c3bd482442c2a27397735b6d7c7e992","Service\/Customer\/CardsManagement.php":"a8e73ab6640145ed882003d9f8beba66","Service\/Data\/RecurrencePrice.php":"fd51e7bb41097787680bd816bc289ece","Service\/Order\/ChargeService.php":"4a4671245313fd7b06c201ef37366c1d","Setup\/InstallData.php":"7f402d3cb214a31b2abc03b31344c9fe","Setup\/InstallSchema.php":"27062b252377e1ad01c9c265447f92e2","Setup\/UpgradeData.php":"c5cc771dc676366fce4949d0ba603d1b","Setup\/UpgradeSchema.php":"f73eafe36961233cf667053abaffa9df","Test\/.gitignore":"ba12e4bb11bf03f72b5fca4598676180","Test\/Unit\/bootstrap.php":"31c2829c5f68634e4dd4eba2bd6e0697","Ui\/Component\/Column\/Actions.php":"764e92d09a752ecc96e68bb6561e07e8","Ui\/Component\/Column\/Invoices\/Actions.php":"d3574046bcd7b16052c10299be8e57bb","Ui\/Component\/Column\/Invoices\/Boleto.php":"16bc8640d8ba77e2c5b5477a9dd9587f","Ui\/Component\/Column\/Subscriptions\/Actions.php":"d55878fd3a5234e79e606fece8daf9a6","Ui\/Component\/Listing\/Column\/BrazilCurrency.php":"e58024dad7dd7043f7691105bef22e4d","Ui\/Component\/Listing\/Column\/Translate.php":"67578d6182b6a674e02fc7c80e9aa27d","Ui\/Component\/Recurrence\/Column\/CreatedAt.php":"e54fa620a5e651285becaf3156b9b20c","Ui\/Component\/Recurrence\/Column\/CustomerName.php":"5fdae5b4a665e0352d4a61e861fd4f75","Ui\/Component\/Recurrence\/Column\/Interval.php":"a52697dfbd4d619987fc8c7936c7ca79","Ui\/Component\/Recurrence\/Column\/PaymentMethodColumn.php":"759629abb7d0b49c740d1d6d8e1dbf20","Ui\/Component\/Recurrence\/Column\/ProductRecurrenceName.php":"c324ffe8ed5d7e078a99e4073c12856b","Ui\/Component\/Recurrence\/Column\/RepetitionsColumn.php":"ac32324baa92eaf5eda1830d0b580c6b","Ui\/Component\/Recurrence\/Column\/TotalCyclesByProduct.php":"e541957924f01abf9ee7f48dd3676b95","Ui\/DataProvider\/Product\/Form\/Modifier\/Plan.php":"852b344f6f58d1a801e737a43130e411","Ui\/DataProvider\/Product\/GroupedProductDataProvider.php":"92ceee9c0bdf292f0aa82023a4369ea7","e2e\/.gitignore":"5ed82221279229d4dd693aa8b4d4ee6b","e2e\/Dockerfile":"32335ae3bf765f1d70719e34e2801d05","e2e\/README.md":"eceb2997e8354e40ce0f4f4502e03404","e2e\/helper\/checkout_helper.js":"f652815d723fdedb1cbfcb84e6bc5f1a","e2e\/helper\/data_helper.js":"f586ef9df3abf47bc74e533887601fb0","e2e\/helper\/pagarme_helper.js":"443c4c969781bddd4091e2318c3feb12","e2e\/helper\/product_helper.js":"12fa508b68694d2a048e3fe7126a101e","e2e\/package-lock.json":"018a4d07f2ddb82951e4908f40309717","e2e\/package.json":"1ef4ee087cf71de059d3f546e5b5965a","e2e\/playwright.config.js":"a7301a751cf86de9f496e298f4057f86","e2e\/tests\/cartao-de-credito.e2e.test.js":"035815d46743657486089ba52f55eee5","etc\/_product_types.xml":"596a72b85e1d77c23885c9fb61819a32","etc\/acl.xml":"c38440d18e835c665b2833a767a3774d","etc\/adminhtml\/di.xml":"72a39c38880e32cc21f485784f46ee43","etc\/adminhtml\/menu.xml":"ae09c8bc4612f61356172d3d0a5e232b","etc\/adminhtml\/routes.xml":"9840414d1096739703fef1d29b4a9f26","etc\/adminhtml\/system\/antifraud.xml":"5d4880c957378aba49a9a39abbd0b487","etc\/adminhtml\/system\/customer-address.xml":"a84f8d53ad714f00fc2b11f78c1b1381","etc\/adminhtml\/system\/global.xml":"493b58e6ea31325ec4ffffd67066e385","etc\/adminhtml\/system\/marketplace.xml":"81617c19f32d64111142d1d4cd15fab2","etc\/adminhtml\/system\/recurrence.xml":"66239b232f3a245cd9fd28bda968722a","etc\/adminhtml\/system\/transaction\/billet.xml":"430ee385ff9f231c08f4bd140b73735b","etc\/adminhtml\/system\/transaction\/creditcard\/antifraud.xml":"af25116d5b8541dc43ed42b00ed51072","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/amex.xml":"daf15a1760875482f7051983654267a8","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/aura.xml":"4fbf98ce6e919f8f40476ea7b9064cc7","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/banese.xml":"09e379d0cb21d922156c27137d83e0a6","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/cabal.xml":"be3a8baf937211801d82bb6de0caf53d","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/credz.xml":"914f77e62e76848cb61c86c1d4568b88","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/diners.xml":"2312b605528026e898cde95d8ca7d838","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/discover.xml":"433f1ac39a45b06e70ee463b344bcaa3","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/elo.xml":"1c8423105c5e34620f78d2398ef32c88","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/hipercard.xml":"1ca7b61db6cc48adb6ab5e7d41b9718c","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/jcb.xml":"aa807bb1a17f74c21e08f18852977ab2","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/mastercard.xml":"d86aa23a5d25db62c0f46952e3513784","etc\/adminhtml\/system\/transaction\/creditcard\/installments\/visa.xml":"fa47ba50cdc1ba4d2d5fe27fc5719a42","etc\/adminhtml\/system\/transaction\/creditcard\/installments.xml":"38372b0f20ec7c4fd2611440de32cea7","etc\/adminhtml\/system\/transaction\/creditcard.xml":"77a7ce0b412d3f8dcdd7d50238e23841","etc\/adminhtml\/system\/transaction\/debit.xml":"2a716d81447c2626e3336582743f93ca","etc\/adminhtml\/system\/transaction\/multipleactionscreditcardbillet.xml":"7024090df4d3d2163ff4737184a20150","etc\/adminhtml\/system\/transaction\/multipleactionstwocreditcard.xml":"27be22612ed58811f451548fb1a47488","etc\/adminhtml\/system\/transaction\/pix.xml":"8d68ee3a66ff896fb432669e1f002684","etc\/adminhtml\/system\/transaction\/voucher.xml":"269dc2dd7481eb9248c68b921aa106e3","etc\/adminhtml\/system.xml":"014140d885e2913f2a1ea69ec3530291","etc\/adminhtml\/ui_component\/plan_product_listing.xml":"efa1956c1c3462b07f4df8d8b8d7d100","etc\/config.xml":"75770a1f7228dcb987ae26a558ab03ce","etc\/csp_whitelist.xml":"7113cf397f7cad4a2277d8f9360d009a","etc\/db_schema.xml":"d81315ecc627c174292a364f502b9b1f","etc\/db_schema_whitelist.json":"80083f6279daffbaa4a16985fb3ecac3","etc\/di.xml":"daac42fa7e6a2a48d106ee43ddfb78bb","etc\/events.xml":"3467ed9ee33d8841c1dba464d9213667","etc\/frontend\/di.xml":"f028148b0ab27b0f158a413179cd3e42","etc\/frontend\/routes.xml":"c68607a0b33008cf6e119988cdd4aade","etc\/module.xml":"75f6a902ab7d9d866e27a347561cfdb5","etc\/payment.xml":"f6593f60f29bffd45ed4557b15c231cd","etc\/webapi.xml":"7c83f4fc545849153b4c317a93d86850","etc\/webapi_rest\/di.xml":"836e324ec56725f3eda5846b99622f91","etc\/webapi_soap\/di.xml":"836e324ec56725f3eda5846b99622f91","i18n\/en_US.csv":"ca23c152872d20ee914389ae09340ddb","i18n\/pt_BR.csv":"49f0ff1266f153a51d6e0f4549ea14ef","view\/adminhtml\/layout\/adminhtml_system_config_edit.xml":"e3e25772f1ee24544633e10f8d90e65f","view\/adminhtml\/layout\/default.xml":"051ee83a2ed37af10be35d659a437aff","view\/adminhtml\/layout\/pagarme_pagarme_cards_index.xml":"887a43156f512585a7b7f65f453fdce4","view\/adminhtml\/layout\/pagarme_pagarme_charges_index.xml":"3f6f17a466f2f620a61fea6c4470dc70","view\/adminhtml\/layout\/pagarme_pagarme_invoices_index.xml":"bf1331af0834aca51c671451ae57f537","view\/adminhtml\/layout\/pagarme_pagarme_plans_create.xml":"d6c0a4859c7c194ff03d0a2ecdd08763","view\/adminhtml\/layout\/pagarme_pagarme_plans_index.xml":"502cf46c4bc9fb132ffdd2e279179002","view\/adminhtml\/layout\/pagarme_pagarme_recipients_create.xml":"6683790d1695d797a2433c11095368b3","view\/adminhtml\/layout\/pagarme_pagarme_recipients_index.xml":"8d1e30cc2f23d1abd0610a8ecb3df1df","view\/adminhtml\/layout\/pagarme_pagarme_recurrenceproducts_create.xml":"1a7d78ebee01d01277d9a324a83e8508","view\/adminhtml\/layout\/pagarme_pagarme_recurrenceproducts_index.xml":"859b1612c4b9d3bb5ced6419cb5f7ff0","view\/adminhtml\/layout\/pagarme_pagarme_subscriptions_details.xml":"7d60a66fe93c90b7b75f2ed505906550","view\/adminhtml\/layout\/pagarme_pagarme_subscriptions_index.xml":"4f56d86566620045615705e37620fcf5","view\/adminhtml\/layout\/sales_order_create_index.xml":"8c308a488b49b8b42cb92c3e4ddf7343","view\/adminhtml\/layout\/sales_order_create_load_block_billing_method.xml":"10675c985e014d470c4d9bee97bb678f","view\/adminhtml\/layout\/sales_order_view.xml":"d8b8fb1dc4a1b9f7df5de4170744f9a5","view\/adminhtml\/requirejs-config.js":"8d62c7f271d55e92abee355334923bfa","view\/adminhtml\/templates\/customer\/cards.phtml":"83c7d80f3a32d427c3821ed9709bad2e","view\/adminhtml\/templates\/form\/creditcard.phtml":"add5e213e202df2143c432e01c73d9e9","view\/adminhtml\/templates\/info\/billet.phtml":"2f5a004728b0a5f7adb224cd220a1ef9","view\/adminhtml\/templates\/info\/billetCreditCard.phtml":"38bbbc2c467d773ee129abd4a0657088","view\/adminhtml\/templates\/info\/creditCard.phtml":"b7b77923e3d1d42afc826427f3e75b1a","view\/adminhtml\/templates\/info\/pix.phtml":"a637860f6b14a6a79a86b61194e87ae2","view\/adminhtml\/templates\/info\/twoCreditCard.phtml":"0a220c7417af668dbf3ce1102a44b2bc","view\/adminhtml\/templates\/marketplace\/recipients\/create.phtml":"3162115c7038dcd879b1ae5549ffc2ac","view\/adminhtml\/templates\/payment\/info\/billet.phtml":"9e6806b30916bad2cc4bbaf8b6ef0171","view\/adminhtml\/templates\/recurrence\/plans\/create.phtml":"ee52e7b04521fe49151b7b36105be063","view\/adminhtml\/templates\/recurrence\/subscriptions\/create.phtml":"8f31d226eeead0a42f2ad1362e2e1c37","view\/adminhtml\/templates\/recurrence\/subscriptions\/details.phtml":"61f165133a986cdfb27ffc97a71e9b6f","view\/adminhtml\/templates\/tab\/view\/order_charge.phtml":"1cf4224c2ca80096937108aeffa35c04","view\/adminhtml\/ui_component\/pagarme_pagarme_cards_index.xml":"4a8edc3cf66deeda8149bcd86e8925ee","view\/adminhtml\/ui_component\/pagarme_pagarme_charges_index.xml":"7239b9e237b04739c013291385e3e2d7","view\/adminhtml\/ui_component\/pagarme_pagarme_invoices_listing.xml":"5eee50f41de04e97558aa8c538d0ac15","view\/adminhtml\/ui_component\/pagarme_pagarme_plans_listing.xml":"1869cab509e383e05e813fa807505b75","view\/adminhtml\/ui_component\/pagarme_pagarme_recipients_listing.xml":"8fb1424fc5693c491931ee95fe9eb8f6","view\/adminhtml\/ui_component\/pagarme_pagarme_recurrenceproducts_listing.xml":"f5b81b21aa80a9641ca44c5a74379882","view\/adminhtml\/ui_component\/pagarme_pagarme_subscriptions_listing.xml":"579e0e87d3a0d8eaecbe408ac543efcc","view\/adminhtml\/web\/css\/hub_button.css":"8cf3842c374092c978ae0b48f1c1e70f","view\/adminhtml\/web\/css\/jquery-ui.min.css":"8dcebf12fbabea677390cfa6d9ad09fb","view\/adminhtml\/web\/css\/menu.css":"c4c1a300c7033f2b9016435842023a79","view\/adminhtml\/web\/css\/pagarme_style.css":"12ccd7d6cfbd31335381cd6d7acc8c3b","view\/adminhtml\/web\/css\/soft_description.css":"4cbbba7c27174199624af077a88518da","view\/adminhtml\/web\/images\/avatar-pagarme.svg":"9a1d8ceb12b38b90746b2a463a81adc1","view\/base\/requirejs-config.js":"ac29c4308e756cf2fc109e8269370b15","view\/frontend\/layout\/catalog_product_view.xml":"c1ca5e5d535dcd8d684d7ee22bf9ecf3","view\/frontend\/layout\/checkout_index_index.xml":"b3bc872d6ab401c34ed3c498da3a892d","view\/frontend\/layout\/checkout_onepage_success.xml":"9a0dab53097ca65ccd3dd4b1314aeeea","view\/frontend\/layout\/customer_account.xml":"52333fee988b58d8ebed0861d439d1f4","view\/frontend\/layout\/pagarme_customer_cards.xml":"f26316f59633b63b973a58994dc4f7d7","view\/frontend\/layout\/pagarme_customer_invoice.xml":"ce219436de951ad151a517bd06d1a362","view\/frontend\/layout\/pagarme_customer_subscription.xml":"c6d86376a8e4feeac79965a6cfacb1d6","view\/frontend\/layout\/pagarme_pagarme_product_list.xml":"4ffecaf9bf6d1dda37b084c4d33a4276","view\/frontend\/requirejs-config.js":"4ce38a6b3722a3ed0f5443a8efcc5525","view\/frontend\/templates\/customer\/cards.phtml":"e48fcbd25c827a5f001e7d6cd16362e2","view\/frontend\/templates\/customer\/invoice.phtml":"f1fe3a5d5a1c22f7e409eba9822186eb","view\/frontend\/templates\/customer\/subscription.phtml":"83b3b972e741fbde1882b3690e48367f","view\/frontend\/templates\/info\/billet.phtml":"8487719e3f32bc9f8564d1d67bb35c89","view\/frontend\/templates\/info\/billetCreditCard.phtml":"809f7d4a7ea78edb1b6a7c8de9408a5c","view\/frontend\/templates\/info\/creditCard.phtml":"8b047fed16af3f347661a1175d0d5abd","view\/frontend\/templates\/info\/pix.phtml":"7e93afc4237e622446e8ab7463ca24d3","view\/frontend\/templates\/info\/twoCreditCard.phtml":"d02af5c25cee1f4914bf9b5c2febe38b","view\/frontend\/templates\/payment\/billet.phtml":"008e05d15ac3dd7f2d5db882619b3778","view\/frontend\/templates\/payment\/pix.phtml":"db00363b8c8a489ddbca2a7212415303","view\/frontend\/templates\/product\/price\/recurrence.phtml":"e661f83e2e5fc4f72b6ff8818cbf7c9f","view\/frontend\/templates\/product\/priceCycles.phtml":"097d1ec4a945159e5af9ee3c5de2fda0","view\/frontend\/web\/css\/pagarme_style.css":"7755a0d3a04d2ecb788eadf3bb4fb205","view\/frontend\/web\/css\/pagarme_success_page.css":"f2cde8b71395b4933f73d59b1721ef94","view\/frontend\/web\/template\/payment\/boleto-form.html":"a4d7db1d36c9a1e18249d64c5803fcd5","view\/frontend\/web\/template\/payment\/boleto.html":"c52e34221346043ac23221e2182bcece","view\/frontend\/web\/template\/payment\/boletocreditcard.html":"6e257471cb9091c3f0624b80eeba69eb","view\/frontend\/web\/template\/payment\/creditcard-form.html":"53cfca9d53bf33d9434d4ccf8c797e42","view\/frontend\/web\/template\/payment\/creditcard.html":"59a8715f141f5486eaa2969b118f35b5","view\/frontend\/web\/template\/payment\/debit.html":"7ea6e00a8e5fde553ce5ef2bf0fa8ece","view\/frontend\/web\/template\/payment\/default.html":"e0c7376ba24aff6848b432db9b25f0ac","view\/frontend\/web\/template\/payment\/multibuyer-form.html":"ef6faf29c52fffae0914a8974bbe7cf0","view\/frontend\/web\/template\/payment\/pix-form.html":"99b4332117619550d10a7534c5e33466","view\/frontend\/web\/template\/payment\/pix.html":"dc0445c884e16179ff07c18fc6c4cd07","view\/frontend\/web\/template\/payment\/twocreditcards.html":"c788874c3d3c2c69219cc32fc19bc566","view\/frontend\/web\/template\/payment\/voucher.html":"7ea6e00a8e5fde553ce5ef2bf0fa8ece"} \ No newline at end of file diff --git a/Plugin/Princing/Render/FinalPricePlugin.php b/Plugin/Princing/Render/FinalPricePlugin.php deleted file mode 100644 index 041a84a3..00000000 --- a/Plugin/Princing/Render/FinalPricePlugin.php +++ /dev/null @@ -1,132 +0,0 @@ -isEnabled() && - $moduleConfiguration->getRecurrenceConfig()->isEnabled() && - $moduleConfiguration->getRecurrenceConfig()->isShowRecurrenceCurrencyWidget() - ) { - return ['Pagarme_Pagarme::product/priceFinal.phtml']; - } - - return [$template]; - } - - /** - * @return int|null - */ - public static function getMaxInstallments() - { - $list‌cardConfig = MPSetup::getModuleConfiguration()->getCardConfigs(); - - $installment = null; - foreach ($list‌cardConfig as $cardConfig) { - if ( - $cardConfig->getBrand()->getName() != 'noBrand' || - !$cardConfig->isEnabled() - ) { - continue; - } - - $installment = $cardConfig->getMaxInstallment(); - } - - return $installment; - } - - /** - * @param int $productId - * @return false|string|null - */ - public static function getRecurrencePrice($productId) - { - $subscriptionProductService = new ProductSubscriptionService(); - $subscriptionProduct = $subscriptionProductService->findByProductId($productId); - - if (is_null($subscriptionProduct)) { - return null; - } - - $objectManager = ObjectManager::getInstance(); - $product = $objectManager->create(Product::class) - ->load($productId); - - $currency = self::getLowestRecurrencePrice($subscriptionProduct, $product); - $currency['price'] = ProductHelper::applyMoneyFormat($currency['price']); - - return $currency; - } - - /** - * @param ProductSubscription $subscriptionProduct - * @param ProductInterceptor $product - * @return float - */ - private static function getLowestRecurrencePrice( - ProductSubscription $subscriptionProduct, - ProductInterceptor $product - ) { - $prices = []; - foreach ($subscriptionProduct->getRepetitions() as $repetition) { - $recurrencePrice = $repetition->getRecurrencePrice(); - - if ($recurrencePrice == 0) { - $recurrencePrice = ($product->getPrice() * 100); - } - - $price = $recurrencePrice / $repetition->getIntervalCount() / 100; - $discountAmount = ProductHelper::getDiscountAmount($product) / $repetition->getIntervalCount(); - - if ($repetition->getInterval() == Repetition::INTERVAL_YEAR) { - $price = $recurrencePrice / (12 * $repetition->getIntervalCount()); - $discountAmount = ProductHelper::getDiscountAmount($product) / (12 * $repetition->getIntervalCount()); - } - - $price = $price - $discountAmount > 0 ? $price - $discountAmount : $price; - $price = 0; - $prices[$price] = [ - 'price' => $price, - 'interval' => $repetition->getInterval(), - 'intervalCount' => $repetition->getIntervalCount() - ]; - } - ksort($prices); - - return reset($prices); - } -} diff --git a/etc/di.xml b/etc/di.xml index 5342bfe4..c0696c91 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -659,10 +659,6 @@ - - - - diff --git a/view/frontend/templates/product/priceFinal.phtml b/view/frontend/templates/product/priceFinal.phtml deleted file mode 100644 index 553e9bbf..00000000 --- a/view/frontend/templates/product/priceFinal.phtml +++ /dev/null @@ -1,72 +0,0 @@ - -getSaleableItem()->getId(); - -/** ex: \Magento\Catalog\Pricing\Price\RegularPrice */ -/** @var \Magento\Framework\Pricing\Price\PriceInterface $priceModel */ -$priceModel = $block->getPriceType('regular_price'); - -/** ex: \Magento\Catalog\Pricing\Price\FinalPrice */ -/** @var \Magento\Framework\Pricing\Price\PriceInterface $finalPriceModel */ -$finalPriceModel = $block->getPriceType('final_price'); -$idSuffix = $block->getIdSuffix() ? $block->getIdSuffix() : ''; -$schema = ($block->getZone() == 'item_view') ? true : false; -?> - -hasSpecialPrice()) : ?> - - renderAmount($finalPriceModel->getAmount(), [ - 'display_label' => __('Special Price'), - 'price_id' => $block->getPriceId('product-price-' . $idSuffix), - 'price_type' => 'finalPrice', - 'include_container' => true, - 'schema' => $schema - ]); ?> - - - renderAmount($priceModel->getAmount(), [ - 'display_label' => __('Regular Price'), - 'price_id' => $block->getPriceId('old-price-' . $idSuffix), - 'price_type' => 'oldPrice', - 'include_container' => true, - 'skip_adjustments' => true - ]); ?> - - - renderAmount($finalPriceModel->getAmount(), [ - 'price_id' => $block->getPriceId('product-price-' . $idSuffix), - 'price_type' => 'finalPrice', - 'include_container' => true, - 'schema' => $schema - ]); ?> - - -showMinimalPrice()) : ?> - getUseLinkForAsLowAs()):?> - - renderAmountMinimal() ?> - - - - renderAmountMinimal() ?> - - - -
- ". __('Or %1 per', $recurrencePrice['price']) . ' ' . __($recurrencePrice['interval']) . ""; - } - ?> -
From 86f779e6e68feace419250b4cdc435d85956bc31 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 1 Aug 2023 17:43:32 -0300 Subject: [PATCH 25/83] compatibilization with magento 2.4.6 and PHP 8.2 --- Concrete/Magento2DatabaseDecorator.php | 15 +++- Console/Command/MigrateExecute.php | 5 ++ Console/Command/MigrateList.php | 5 ++ Console/MigrateData.php | 27 ++++++- Controller/Adminhtml/Charges/ChargeAction.php | 18 +++-- Controller/Adminhtml/Plans/PlanAction.php | 14 +++- .../Adminhtml/Recipients/RecipientAction.php | 24 +++--- .../Adminhtml/RecurrenceProducts/Delete.php | 34 ++++++--- Helper/CustomerUpdatePagarmeHelper.php | 18 ++++- Helper/Marketplace/WebkulHelper.php | 39 ++++++++-- Helper/ProductSubscriptionHelper.php | 5 ++ Model/Api/HubCommand.php | 5 ++ Model/Api/ProductsSubscription.php | 10 +++ Model/Api/Subscription.php | 10 +++ Model/Cart/CartConflict.php | 8 +- ...InstallmentsByBrandAndAmountManagement.php | 13 +++- Model/InstallmentsByBrandManagement.php | 13 +++- .../GenericInstallmentsConfigProvider.php | 76 +++++++++++-------- Observer/SalesOrderPlaceAfter.php | 43 +++++++---- .../Block/Product/ProductsList.php | 6 ++ 20 files changed, 297 insertions(+), 91 deletions(-) diff --git a/Concrete/Magento2DatabaseDecorator.php b/Concrete/Magento2DatabaseDecorator.php index 47431ed2..94b3a405 100644 --- a/Concrete/Magento2DatabaseDecorator.php +++ b/Concrete/Magento2DatabaseDecorator.php @@ -2,10 +2,21 @@ namespace Pagarme\Pagarme\Concrete; +use Magento\Framework\App\ResourceConnection; use Pagarme\Core\Kernel\Abstractions\AbstractDatabaseDecorator; final class Magento2DatabaseDecorator extends AbstractDatabaseDecorator { + /** + * @var ResourceConnection + */ + protected $db; + + /** + * @var mixed + */ + private $lastInsertId; + protected function setTableArray() { $this->tableArray = [ @@ -87,7 +98,7 @@ protected function doFetch($query) public function getLastId() { - return $this->db->lastInsertId; + return $this->lastInsertId; } protected function setTablePrefix() @@ -98,6 +109,6 @@ protected function setTablePrefix() protected function setLastInsertId($lastInsertId) { - $this->db->lastInsertId = $lastInsertId; + $this->lastInsertId = $lastInsertId; } } diff --git a/Console/Command/MigrateExecute.php b/Console/Command/MigrateExecute.php index d3c8278d..eef87356 100644 --- a/Console/Command/MigrateExecute.php +++ b/Console/Command/MigrateExecute.php @@ -12,6 +12,11 @@ class MigrateExecute extends Command { + /** + * @var MigrateData + */ + private $migrateData; + public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/Command/MigrateList.php b/Console/Command/MigrateList.php index 8af60079..c606fce2 100644 --- a/Console/Command/MigrateList.php +++ b/Console/Command/MigrateList.php @@ -12,6 +12,11 @@ class MigrateList extends Command { + /** + * @var MigrateData + */ + private $migrateData; + public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/MigrateData.php b/Console/MigrateData.php index 051b2e56..70308bdd 100644 --- a/Console/MigrateData.php +++ b/Console/MigrateData.php @@ -6,15 +6,40 @@ use Magento\Framework\App\Helper\Context; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Monolog\Logger; class MigrateData extends AbstractHelper { + /** + * @var Logger + */ protected $logger; + /** + * @var AdapterInterface + */ + protected $connection; + + /** + * @var mixed + */ + protected $start; + + /** + * @var array|null + */ + protected $options; + + /** + * @var array|null + */ + protected $log; + public function __construct(Context $context, ResourceConnection $resourceConnection) { parent::__construct($context); - $this->logger = new \Monolog\Logger('migration'); + $this->logger = new Logger('migration'); $this->logger->pushHandler(new \Monolog\Handler\StreamHandler(BP .'/var/log/pagarme_migration.log')); $this->connection = $resourceConnection->getConnection(); $this->start = microtime(true); diff --git a/Controller/Adminhtml/Charges/ChargeAction.php b/Controller/Adminhtml/Charges/ChargeAction.php index ba440402..1c60e59f 100644 --- a/Controller/Adminhtml/Charges/ChargeAction.php +++ b/Controller/Adminhtml/Charges/ChargeAction.php @@ -16,23 +16,29 @@ class ChargeAction extends \Magento\Backend\App\Action { - protected $resultPageFactory; + /** + * @var JsonFactory + */ + private $resultJsonFactory; + + /** + * @var StoreManagerInterface + */ + private $storeManager; /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory + * @param Context $context + * @param JsonFactory $resultJsonFactory + * @param StoreManagerInterface $storeManager */ public function __construct( Context $context, JsonFactory $resultJsonFactory, - Http $request, StoreManagerInterface $storeManager ) { Magento2CoreSetup::bootstrap(); - - $this->request = $request; $this->resultJsonFactory = $resultJsonFactory; $this->storeManager = $storeManager; parent::__construct($context); diff --git a/Controller/Adminhtml/Plans/PlanAction.php b/Controller/Adminhtml/Plans/PlanAction.php index 9fd99480..a97a49bd 100644 --- a/Controller/Adminhtml/Plans/PlanAction.php +++ b/Controller/Adminhtml/Plans/PlanAction.php @@ -15,29 +15,41 @@ class PlanAction extends Action { - + /** + * @var bool|PageFactory + */ protected $resultPageFactory = false; + /** * @var CollectionFactory */ protected $productCollectionFactory; + /** * @var JsonFactory */ protected $resultJsonFactory; + /** * @var ProductHelper */ protected $productHelper; + /** * @var Registry */ protected $coreRegistry; + /** * @var Factory */ protected $messageFactory; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + /** * Constructor diff --git a/Controller/Adminhtml/Recipients/RecipientAction.php b/Controller/Adminhtml/Recipients/RecipientAction.php index 0ccd6f29..49a1816f 100644 --- a/Controller/Adminhtml/Recipients/RecipientAction.php +++ b/Controller/Adminhtml/Recipients/RecipientAction.php @@ -2,12 +2,13 @@ namespace Pagarme\Pagarme\Controller\Adminhtml\Recipients; +use Exception; use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; -use Webkul\Marketplace\Model\SellerFactory; +use Webkul\Marketplace\Model\SellerFactory; use Magento\Framework\Message\Factory as MagentoMessageFactory; use Magento\Framework\Module\Manager as ModuleManager; @@ -15,10 +16,6 @@ class RecipientAction extends Action { protected $resultPageFactory = false; - /** - * @var WebkulHelper - */ - protected $webkulHelper; /** * @var Registry @@ -29,18 +26,25 @@ class RecipientAction extends Action * @var SellerFactory */ protected $sellerFactory; + /** * @var MagentoMessageFactory */ protected $messageFactory; /** - * Constructor - * + * @var ModuleManager + */ + private $moduleManager; + + /** * @param Context $context + * @param Registry $coreRegistry * @param PageFactory $resultPageFactory + * @param MagentoMessageFactory $messageFactory + * @param ModuleManager $moduleManager + * @throws Exception */ - public function __construct( Context $context, Registry $coreRegistry, @@ -50,11 +54,11 @@ public function __construct( ) { parent::__construct($context); - + $this->resultPageFactory = $resultPageFactory; $this->coreRegistry = $coreRegistry; $this->messageFactory = $messageFactory; - $this->moduleManager = $moduleManager; + $this->moduleManager = $moduleManager; $this->__init(); Magento2CoreSetup::bootstrap(); } diff --git a/Controller/Adminhtml/RecurrenceProducts/Delete.php b/Controller/Adminhtml/RecurrenceProducts/Delete.php index db9dc7b2..eb7e772f 100644 --- a/Controller/Adminhtml/RecurrenceProducts/Delete.php +++ b/Controller/Adminhtml/RecurrenceProducts/Delete.php @@ -4,6 +4,7 @@ use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\Message\Factory; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; @@ -21,18 +22,29 @@ class Delete extends Action */ protected $coreRegistry; + /** + * @var Factory + */ + protected $messageFactory; + + /** + * @var ProductSubscriptionHelper + */ + protected $productSubscriptionHelper; + /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory - * @throws \Exception + * @param Context $context + * @param PageFactory $resultPageFactory + * @param Registry $coreRegistry + * @param Factory $messageFactory */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\View\Result\PageFactory $resultPageFactory, - Registry $coreRegistry, - Factory $messageFactory + Context $context, + PageFactory $resultPageFactory, + Registry $coreRegistry, + Factory $messageFactory ) { $this->resultPageFactory = $resultPageFactory; @@ -48,7 +60,7 @@ public function __construct( /** * Index action * - * @return \Magento\Framework\Controller\ResultInterface + * @return ResponseInterface */ public function execute() { @@ -61,8 +73,7 @@ public function execute() if (!$productData || !$productData->getId()) { $message = $this->messageFactory->create('error', __('Product subscription not exist.')); $this->messageManager->addErrorMessage($message); - $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); - return; + return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); } } @@ -73,7 +84,6 @@ public function execute() $message = $this->messageFactory->create('success', __("Product subscription deleted.")); $this->messageManager->addMessage($message); - $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); - return; + return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); } } diff --git a/Helper/CustomerUpdatePagarmeHelper.php b/Helper/CustomerUpdatePagarmeHelper.php index 696a4eb5..4fc4f4cd 100644 --- a/Helper/CustomerUpdatePagarmeHelper.php +++ b/Helper/CustomerUpdatePagarmeHelper.php @@ -14,15 +14,25 @@ class CustomerUpdatePagarmeHelper { - - protected $updateCustomerRequest; - + /** + * @var Config + */ protected $config; + /** + * @var CustomerRepositoryInterface + */ protected $customerRepositoryInterface; /** - * AdminCustomerSaveAfter constructor. + * @var CustomerService + */ + protected $customerService; + + /** + * @param Config $config + * @param CustomerRepositoryInterface $customerRepositoryInterface + * @param CustomerService $customerService */ public function __construct( Config $config, diff --git a/Helper/Marketplace/WebkulHelper.php b/Helper/Marketplace/WebkulHelper.php index 8f21419f..6bcdc9a5 100644 --- a/Helper/Marketplace/WebkulHelper.php +++ b/Helper/Marketplace/WebkulHelper.php @@ -25,15 +25,42 @@ class WebkulHelper { private const MODULE_MARKETPLACE_NAME = 'Webkul_Marketplace'; + + /** + * @var mixed + */ private $webkulPaymentHelper; + + /** + * @var MagentoObjectManager + */ private $objectManager; + + /** + * @var RecipientService + */ private $recipientService; + /** + * @var bool + */ private $enabled = false; + /** + * @var SplitRemainderHandler + */ private $splitRemainderHandler; + + /** + * @var ExtrasAndDiscountsHandler + */ private $extrasAndDiscountsHandler; + /** + * @var MoneyService + */ + private $moneyService; + public function __construct() { $moduleConfig = Magento2CoreSetup::getModuleConfiguration(); @@ -86,7 +113,7 @@ private function getSellerAndCommissions($itemPrice, $productId) if (empty($sellerId)) { return []; } - + $marketplacePercentageCommission = $sellerDetail['commission'] / 100; $sellerPercentageCommission = 1 - $marketplacePercentageCommission; @@ -179,7 +206,7 @@ private function handleExtrasAndDiscounts($platformOrderDecorator, &$splitData) $totalPaid, $productTotal ); - + if (empty($extraOrDiscountTotal) && $extraOrDiscountTotal != 0) { return $splitData; } @@ -211,7 +238,7 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $itemPrice, $productId ); - + if (empty($sellerAndCommisions)) { $totalPaidProductWithoutSeller += $itemPrice; continue; @@ -221,15 +248,15 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $sellerAndCommisions, $splitData ); - + } - + if (empty($splitData['sellers'])) { return null; } $splitData['marketplace']['totalCommission'] += $totalPaidProductWithoutSeller; - + $splitData = $this->handleExtrasAndDiscounts( $corePlatformOrderDecorator, $splitData diff --git a/Helper/ProductSubscriptionHelper.php b/Helper/ProductSubscriptionHelper.php index fbd489b6..9495a2dd 100644 --- a/Helper/ProductSubscriptionHelper.php +++ b/Helper/ProductSubscriptionHelper.php @@ -26,6 +26,11 @@ class ProductSubscriptionHelper extends AbstractHelper */ protected $objectManager; + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct() { Magento2CoreSetup::bootstrap(); diff --git a/Model/Api/HubCommand.php b/Model/Api/HubCommand.php index 13ed9716..cc4e7028 100644 --- a/Model/Api/HubCommand.php +++ b/Model/Api/HubCommand.php @@ -33,6 +33,11 @@ class HubCommand implements HubCommandInterface */ protected $websiteId; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + public function __construct( Request $request, WriterInterface $configWriter, diff --git a/Model/Api/ProductsSubscription.php b/Model/Api/ProductsSubscription.php index 638e0a83..fcd4631e 100644 --- a/Model/Api/ProductsSubscription.php +++ b/Model/Api/ProductsSubscription.php @@ -31,6 +31,16 @@ class ProductsSubscription implements ProductSubscriptionApiInterface */ protected $productSubscriptionHelper; + /** + * @var LocalizationService + */ + protected $i18n; + + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Api/Subscription.php b/Model/Api/Subscription.php index 1d1451d8..3212193f 100644 --- a/Model/Api/Subscription.php +++ b/Model/Api/Subscription.php @@ -21,6 +21,16 @@ class Subscription implements SubscriptionApiInterface */ protected $subscriptionService; + /** + * @var LocalizationService + */ + protected $i18n; + + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Cart/CartConflict.php b/Model/Cart/CartConflict.php index 43500270..e71d7dbb 100644 --- a/Model/Cart/CartConflict.php +++ b/Model/Cart/CartConflict.php @@ -2,6 +2,7 @@ namespace Pagarme\Pagarme\Model\Cart; +use Exception; use Magento\Checkout\Model\Cart; use Magento\Framework\Exception\LocalizedException; use Pagarme\Core\Kernel\Services\LocalizationService; @@ -58,9 +59,14 @@ class CartConflict */ private $pagarmeConfig; + /** + * @var RulesCartRun + */ + private $rulesCartRun; + /** * CartConflict constructor. - * @throws \Exception + * @throws Exception */ public function __construct() { diff --git a/Model/InstallmentsByBrandAndAmountManagement.php b/Model/InstallmentsByBrandAndAmountManagement.php index 7cac31de..d687f7db 100644 --- a/Model/InstallmentsByBrandAndAmountManagement.php +++ b/Model/InstallmentsByBrandAndAmountManagement.php @@ -26,14 +26,25 @@ class InstallmentsByBrandAndAmountManagement extends AbstractInstallmentManagement implements InstallmentsByBrandAndAmountManagementInterface { + /** + * @var SimpleBuilderInterface + */ protected $builder; + + /** + * @var Session + */ protected $session; - protected $cardBrand; /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; + /** + * @var Config + */ + protected $config; + /** * @param SimpleBuilderInterface $builder */ diff --git a/Model/InstallmentsByBrandManagement.php b/Model/InstallmentsByBrandManagement.php index 48329648..136cf27f 100644 --- a/Model/InstallmentsByBrandManagement.php +++ b/Model/InstallmentsByBrandManagement.php @@ -22,9 +22,20 @@ class InstallmentsByBrandManagement extends AbstractInstallmentManagement implements InstallmentsByBrandManagementInterface { + /** + * @var SimpleBuilderInterface + */ protected $builder; + + /** + * @var Session + */ protected $session; - protected $cardBrand; + + /** + * @var Config + */ + protected $config; /** * @param SimpleBuilderInterface $builder diff --git a/Model/Ui/Base/GenericInstallmentsConfigProvider.php b/Model/Ui/Base/GenericInstallmentsConfigProvider.php index 200b1548..b8a89258 100755 --- a/Model/Ui/Base/GenericInstallmentsConfigProvider.php +++ b/Model/Ui/Base/GenericInstallmentsConfigProvider.php @@ -12,7 +12,7 @@ namespace Pagarme\Pagarme\Model\Ui\Base; -use Pagarme\Core\Kernel\Services\LocalizationService; +use Magento\Framework\View\Asset\Repository; use Pagarme\Pagarme\Model\Installments\Config\ConfigInterface; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\ConfigInterface as BaseConfig; use Magento\Checkout\Model\ConfigProviderInterface; @@ -22,20 +22,38 @@ abstract class GenericInstallmentsConfigProvider implements ConfigProviderInterf { const CODE = null; + /** + * @var array + */ protected $installments = []; - protected $installmentsBuilder; - protected $installmentsConfig; + + /** + * @var ConfigInterface + */ protected $config; - protected $_assetRepo; + + /** + * @var Repository + */ + protected $assetRepo; + + /** + * @var BaseConfig + */ protected $baseConfig; + /** + * @var StoreManagerInterface + */ + protected $storageManager; + public function __construct( - \Magento\Framework\View\Asset\Repository $assetRepo, + Repository $assetRepo, ConfigInterface $config, BaseConfig $baseConfig, StoreManagerInterface $storeManager ) { - $this->_assetRepo = $assetRepo; + $this->assetRepo = $assetRepo; $this->baseConfig = $baseConfig; $this->storageManager = $storeManager; $this->setConfig($config); @@ -43,7 +61,7 @@ public function __construct( public function getConfig() { - $config = [ + return [ 'payment' => [ 'ccform' => [ 'base_url' => $this->storageManager->getStore()->getBaseUrl(), @@ -56,107 +74,107 @@ public function getConfig() 'Visa' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") ], 'Elo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") ], 'Discover' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") ], 'Diners' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") ], 'Credz' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") ], 'Hipercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'HiperCard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'Mastercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") ], 'Sodexo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") ], 'SodexoAlimentacao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") ], 'SodexoCombustivel' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") ], 'SodexoCultura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") ], 'SodexoGift' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") ], 'SodexoPremium' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") ], 'SodexoRefeicao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") ], 'Cabal' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") ], 'Aura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") ], 'Amex' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") ], 'Alelo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") ], 'VR' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") ], 'Banese' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") ], ], ] @@ -164,8 +182,6 @@ public function getConfig() 'is_multi_buyer_enabled' => $this->_getConfig()->getMultiBuyerActive(), 'region_states' => $this->getRegionStates() ]; - - return $config; } diff --git a/Observer/SalesOrderPlaceAfter.php b/Observer/SalesOrderPlaceAfter.php index b7acb24a..3b604766 100644 --- a/Observer/SalesOrderPlaceAfter.php +++ b/Observer/SalesOrderPlaceAfter.php @@ -18,49 +18,60 @@ class SalesOrderPlaceAfter implements ObserverInterface { - /** session factory */ - protected $_session; - - /** @var CustomerFactoryInterface */ + /** + * @var CustomerFactory + */ protected $customerFactory; /** - * @var \Magento\Checkout\Model\Session + * @var Session */ protected $checkoutSession; /** - * \Magento\Sales\Model\Service\OrderService + * @var OrderService */ protected $orderService; /** - * \Magento\Customer\Api\CustomerRepositoryInterface + * @var CustomerRepositoryInterface */ protected $customerRepository; /** - * \Magento\Sales\Model\Service\InvoiceService + * @var InvoiceService */ protected $invoiceService; /** - * \Magento\Framework\DB\Transaction + * @var Transaction */ protected $transaction; /** - * \Magento\Sales\Model\Order\Email\Sender\InvoiceSender + * @var InvoiceSender */ protected $invoiceSender; /** - * \Pagarme\Pagarme\Gateway\Transaction\CreditCard\Config\Config + * @var ConfigCreditCard */ protected $configCreditCard; /** - * @param \Magento\Checkout\Model\Session $checkoutSession - * @param Api $api + * @var SessionFactory + */ + protected $sessionFactory; + + /** + * @param Session $checkoutSession + * @param OrderService $orderService + * @param CustomerFactory $customerFactory + * @param SessionFactory $sessionFactory + * @param CustomerRepositoryInterface $customerRepository + * @param InvoiceService $invoiceService + * @param Transaction $transaction + * @param InvoiceSender $invoiceSender + * @param ConfigCreditCard $configCreditCard */ public function __construct( Session $checkoutSession, @@ -149,7 +160,7 @@ public function createInvoice($order) } /** - * @return \Magento\Checkout\Model\Session + * @return Session */ public function getCheckoutSession() { @@ -157,11 +168,11 @@ public function getCheckoutSession() } /** - * @param \Magento\Checkout\Model\Session $checkoutSession + * @param Session $checkoutSession * * @return self */ - public function setCheckoutSession(\Magento\Checkout\Model\Session $checkoutSession) + public function setCheckoutSession(Session $checkoutSession) { $this->checkoutSession = $checkoutSession; diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index 863b76f0..dac7f29f 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -14,6 +14,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; use Magento\CatalogWidget\Block\Product\ProductsList as BaseProductsList; +use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; @@ -29,6 +30,11 @@ class ProductsList /** @var ProductInterface */ protected $product = null; + /** + * @var bool|BlockInterface + */ + protected $rendererListBlock; + /** * @param LayoutFactory $layoutFactory */ From 97ba9b25346a84f33572b4d92dec4a2f2c189aac Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Tue, 1 Aug 2023 17:46:57 -0300 Subject: [PATCH 26/83] Revert "compatibilization with magento 2.4.6 and PHP 8.2" This reverts commit 86f779e6e68feace419250b4cdc435d85956bc31. --- Concrete/Magento2DatabaseDecorator.php | 15 +--- Console/Command/MigrateExecute.php | 5 -- Console/Command/MigrateList.php | 5 -- Console/MigrateData.php | 27 +------ Controller/Adminhtml/Charges/ChargeAction.php | 18 ++--- Controller/Adminhtml/Plans/PlanAction.php | 14 +--- .../Adminhtml/Recipients/RecipientAction.php | 24 +++--- .../Adminhtml/RecurrenceProducts/Delete.php | 34 +++------ Helper/CustomerUpdatePagarmeHelper.php | 18 +---- Helper/Marketplace/WebkulHelper.php | 39 ++-------- Helper/ProductSubscriptionHelper.php | 5 -- Model/Api/HubCommand.php | 5 -- Model/Api/ProductsSubscription.php | 10 --- Model/Api/Subscription.php | 10 --- Model/Cart/CartConflict.php | 8 +- ...InstallmentsByBrandAndAmountManagement.php | 13 +--- Model/InstallmentsByBrandManagement.php | 13 +--- .../GenericInstallmentsConfigProvider.php | 76 ++++++++----------- Observer/SalesOrderPlaceAfter.php | 43 ++++------- .../Block/Product/ProductsList.php | 6 -- 20 files changed, 91 insertions(+), 297 deletions(-) diff --git a/Concrete/Magento2DatabaseDecorator.php b/Concrete/Magento2DatabaseDecorator.php index 94b3a405..47431ed2 100644 --- a/Concrete/Magento2DatabaseDecorator.php +++ b/Concrete/Magento2DatabaseDecorator.php @@ -2,21 +2,10 @@ namespace Pagarme\Pagarme\Concrete; -use Magento\Framework\App\ResourceConnection; use Pagarme\Core\Kernel\Abstractions\AbstractDatabaseDecorator; final class Magento2DatabaseDecorator extends AbstractDatabaseDecorator { - /** - * @var ResourceConnection - */ - protected $db; - - /** - * @var mixed - */ - private $lastInsertId; - protected function setTableArray() { $this->tableArray = [ @@ -98,7 +87,7 @@ protected function doFetch($query) public function getLastId() { - return $this->lastInsertId; + return $this->db->lastInsertId; } protected function setTablePrefix() @@ -109,6 +98,6 @@ protected function setTablePrefix() protected function setLastInsertId($lastInsertId) { - $this->lastInsertId = $lastInsertId; + $this->db->lastInsertId = $lastInsertId; } } diff --git a/Console/Command/MigrateExecute.php b/Console/Command/MigrateExecute.php index eef87356..d3c8278d 100644 --- a/Console/Command/MigrateExecute.php +++ b/Console/Command/MigrateExecute.php @@ -12,11 +12,6 @@ class MigrateExecute extends Command { - /** - * @var MigrateData - */ - private $migrateData; - public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/Command/MigrateList.php b/Console/Command/MigrateList.php index c606fce2..8af60079 100644 --- a/Console/Command/MigrateList.php +++ b/Console/Command/MigrateList.php @@ -12,11 +12,6 @@ class MigrateList extends Command { - /** - * @var MigrateData - */ - private $migrateData; - public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/MigrateData.php b/Console/MigrateData.php index 70308bdd..051b2e56 100644 --- a/Console/MigrateData.php +++ b/Console/MigrateData.php @@ -6,40 +6,15 @@ use Magento\Framework\App\Helper\Context; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; -use Magento\Framework\DB\Adapter\AdapterInterface; -use Monolog\Logger; class MigrateData extends AbstractHelper { - /** - * @var Logger - */ protected $logger; - /** - * @var AdapterInterface - */ - protected $connection; - - /** - * @var mixed - */ - protected $start; - - /** - * @var array|null - */ - protected $options; - - /** - * @var array|null - */ - protected $log; - public function __construct(Context $context, ResourceConnection $resourceConnection) { parent::__construct($context); - $this->logger = new Logger('migration'); + $this->logger = new \Monolog\Logger('migration'); $this->logger->pushHandler(new \Monolog\Handler\StreamHandler(BP .'/var/log/pagarme_migration.log')); $this->connection = $resourceConnection->getConnection(); $this->start = microtime(true); diff --git a/Controller/Adminhtml/Charges/ChargeAction.php b/Controller/Adminhtml/Charges/ChargeAction.php index 1c60e59f..ba440402 100644 --- a/Controller/Adminhtml/Charges/ChargeAction.php +++ b/Controller/Adminhtml/Charges/ChargeAction.php @@ -16,29 +16,23 @@ class ChargeAction extends \Magento\Backend\App\Action { - /** - * @var JsonFactory - */ - private $resultJsonFactory; - - /** - * @var StoreManagerInterface - */ - private $storeManager; + protected $resultPageFactory; /** * Constructor * - * @param Context $context - * @param JsonFactory $resultJsonFactory - * @param StoreManagerInterface $storeManager + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory */ public function __construct( Context $context, JsonFactory $resultJsonFactory, + Http $request, StoreManagerInterface $storeManager ) { Magento2CoreSetup::bootstrap(); + + $this->request = $request; $this->resultJsonFactory = $resultJsonFactory; $this->storeManager = $storeManager; parent::__construct($context); diff --git a/Controller/Adminhtml/Plans/PlanAction.php b/Controller/Adminhtml/Plans/PlanAction.php index a97a49bd..9fd99480 100644 --- a/Controller/Adminhtml/Plans/PlanAction.php +++ b/Controller/Adminhtml/Plans/PlanAction.php @@ -15,41 +15,29 @@ class PlanAction extends Action { - /** - * @var bool|PageFactory - */ - protected $resultPageFactory = false; + protected $resultPageFactory = false; /** * @var CollectionFactory */ protected $productCollectionFactory; - /** * @var JsonFactory */ protected $resultJsonFactory; - /** * @var ProductHelper */ protected $productHelper; - /** * @var Registry */ protected $coreRegistry; - /** * @var Factory */ protected $messageFactory; - /** - * @var StoreManagerInterface - */ - protected $storeManager; - /** * Constructor diff --git a/Controller/Adminhtml/Recipients/RecipientAction.php b/Controller/Adminhtml/Recipients/RecipientAction.php index 49a1816f..0ccd6f29 100644 --- a/Controller/Adminhtml/Recipients/RecipientAction.php +++ b/Controller/Adminhtml/Recipients/RecipientAction.php @@ -2,13 +2,12 @@ namespace Pagarme\Pagarme\Controller\Adminhtml\Recipients; -use Exception; use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; -use Webkul\Marketplace\Model\SellerFactory; +use Webkul\Marketplace\Model\SellerFactory; use Magento\Framework\Message\Factory as MagentoMessageFactory; use Magento\Framework\Module\Manager as ModuleManager; @@ -16,6 +15,10 @@ class RecipientAction extends Action { protected $resultPageFactory = false; + /** + * @var WebkulHelper + */ + protected $webkulHelper; /** * @var Registry @@ -26,25 +29,18 @@ class RecipientAction extends Action * @var SellerFactory */ protected $sellerFactory; - /** * @var MagentoMessageFactory */ protected $messageFactory; /** - * @var ModuleManager - */ - private $moduleManager; - - /** + * Constructor + * * @param Context $context - * @param Registry $coreRegistry * @param PageFactory $resultPageFactory - * @param MagentoMessageFactory $messageFactory - * @param ModuleManager $moduleManager - * @throws Exception */ + public function __construct( Context $context, Registry $coreRegistry, @@ -54,11 +50,11 @@ public function __construct( ) { parent::__construct($context); - + $this->resultPageFactory = $resultPageFactory; $this->coreRegistry = $coreRegistry; $this->messageFactory = $messageFactory; - $this->moduleManager = $moduleManager; + $this->moduleManager = $moduleManager; $this->__init(); Magento2CoreSetup::bootstrap(); } diff --git a/Controller/Adminhtml/RecurrenceProducts/Delete.php b/Controller/Adminhtml/RecurrenceProducts/Delete.php index eb7e772f..db9dc7b2 100644 --- a/Controller/Adminhtml/RecurrenceProducts/Delete.php +++ b/Controller/Adminhtml/RecurrenceProducts/Delete.php @@ -4,7 +4,6 @@ use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; -use Magento\Framework\App\ResponseInterface; use Magento\Framework\Message\Factory; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; @@ -22,29 +21,18 @@ class Delete extends Action */ protected $coreRegistry; - /** - * @var Factory - */ - protected $messageFactory; - - /** - * @var ProductSubscriptionHelper - */ - protected $productSubscriptionHelper; - /** * Constructor * - * @param Context $context - * @param PageFactory $resultPageFactory - * @param Registry $coreRegistry - * @param Factory $messageFactory + * @param \Magento\Backend\App\Action\Context $context + * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory + * @throws \Exception */ public function __construct( - Context $context, - PageFactory $resultPageFactory, - Registry $coreRegistry, - Factory $messageFactory + \Magento\Backend\App\Action\Context $context, + \Magento\Framework\View\Result\PageFactory $resultPageFactory, + Registry $coreRegistry, + Factory $messageFactory ) { $this->resultPageFactory = $resultPageFactory; @@ -60,7 +48,7 @@ public function __construct( /** * Index action * - * @return ResponseInterface + * @return \Magento\Framework\Controller\ResultInterface */ public function execute() { @@ -73,7 +61,8 @@ public function execute() if (!$productData || !$productData->getId()) { $message = $this->messageFactory->create('error', __('Product subscription not exist.')); $this->messageManager->addErrorMessage($message); - return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); + $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); + return; } } @@ -84,6 +73,7 @@ public function execute() $message = $this->messageFactory->create('success', __("Product subscription deleted.")); $this->messageManager->addMessage($message); - return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); + $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); + return; } } diff --git a/Helper/CustomerUpdatePagarmeHelper.php b/Helper/CustomerUpdatePagarmeHelper.php index 4fc4f4cd..696a4eb5 100644 --- a/Helper/CustomerUpdatePagarmeHelper.php +++ b/Helper/CustomerUpdatePagarmeHelper.php @@ -14,25 +14,15 @@ class CustomerUpdatePagarmeHelper { - /** - * @var Config - */ + + protected $updateCustomerRequest; + protected $config; - /** - * @var CustomerRepositoryInterface - */ protected $customerRepositoryInterface; /** - * @var CustomerService - */ - protected $customerService; - - /** - * @param Config $config - * @param CustomerRepositoryInterface $customerRepositoryInterface - * @param CustomerService $customerService + * AdminCustomerSaveAfter constructor. */ public function __construct( Config $config, diff --git a/Helper/Marketplace/WebkulHelper.php b/Helper/Marketplace/WebkulHelper.php index 6bcdc9a5..8f21419f 100644 --- a/Helper/Marketplace/WebkulHelper.php +++ b/Helper/Marketplace/WebkulHelper.php @@ -25,42 +25,15 @@ class WebkulHelper { private const MODULE_MARKETPLACE_NAME = 'Webkul_Marketplace'; - - /** - * @var mixed - */ private $webkulPaymentHelper; - - /** - * @var MagentoObjectManager - */ private $objectManager; - - /** - * @var RecipientService - */ private $recipientService; - /** - * @var bool - */ private $enabled = false; - /** - * @var SplitRemainderHandler - */ private $splitRemainderHandler; - - /** - * @var ExtrasAndDiscountsHandler - */ private $extrasAndDiscountsHandler; - /** - * @var MoneyService - */ - private $moneyService; - public function __construct() { $moduleConfig = Magento2CoreSetup::getModuleConfiguration(); @@ -113,7 +86,7 @@ private function getSellerAndCommissions($itemPrice, $productId) if (empty($sellerId)) { return []; } - + $marketplacePercentageCommission = $sellerDetail['commission'] / 100; $sellerPercentageCommission = 1 - $marketplacePercentageCommission; @@ -206,7 +179,7 @@ private function handleExtrasAndDiscounts($platformOrderDecorator, &$splitData) $totalPaid, $productTotal ); - + if (empty($extraOrDiscountTotal) && $extraOrDiscountTotal != 0) { return $splitData; } @@ -238,7 +211,7 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $itemPrice, $productId ); - + if (empty($sellerAndCommisions)) { $totalPaidProductWithoutSeller += $itemPrice; continue; @@ -248,15 +221,15 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $sellerAndCommisions, $splitData ); - + } - + if (empty($splitData['sellers'])) { return null; } $splitData['marketplace']['totalCommission'] += $totalPaidProductWithoutSeller; - + $splitData = $this->handleExtrasAndDiscounts( $corePlatformOrderDecorator, $splitData diff --git a/Helper/ProductSubscriptionHelper.php b/Helper/ProductSubscriptionHelper.php index 9495a2dd..fbd489b6 100644 --- a/Helper/ProductSubscriptionHelper.php +++ b/Helper/ProductSubscriptionHelper.php @@ -26,11 +26,6 @@ class ProductSubscriptionHelper extends AbstractHelper */ protected $objectManager; - /** - * @var MoneyService - */ - protected $moneyService; - public function __construct() { Magento2CoreSetup::bootstrap(); diff --git a/Model/Api/HubCommand.php b/Model/Api/HubCommand.php index cc4e7028..13ed9716 100644 --- a/Model/Api/HubCommand.php +++ b/Model/Api/HubCommand.php @@ -33,11 +33,6 @@ class HubCommand implements HubCommandInterface */ protected $websiteId; - /** - * @var StoreManagerInterface - */ - protected $storeManager; - public function __construct( Request $request, WriterInterface $configWriter, diff --git a/Model/Api/ProductsSubscription.php b/Model/Api/ProductsSubscription.php index fcd4631e..638e0a83 100644 --- a/Model/Api/ProductsSubscription.php +++ b/Model/Api/ProductsSubscription.php @@ -31,16 +31,6 @@ class ProductsSubscription implements ProductSubscriptionApiInterface */ protected $productSubscriptionHelper; - /** - * @var LocalizationService - */ - protected $i18n; - - /** - * @var MoneyService - */ - protected $moneyService; - public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Api/Subscription.php b/Model/Api/Subscription.php index 3212193f..1d1451d8 100644 --- a/Model/Api/Subscription.php +++ b/Model/Api/Subscription.php @@ -21,16 +21,6 @@ class Subscription implements SubscriptionApiInterface */ protected $subscriptionService; - /** - * @var LocalizationService - */ - protected $i18n; - - /** - * @var MoneyService - */ - protected $moneyService; - public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Cart/CartConflict.php b/Model/Cart/CartConflict.php index e71d7dbb..43500270 100644 --- a/Model/Cart/CartConflict.php +++ b/Model/Cart/CartConflict.php @@ -2,7 +2,6 @@ namespace Pagarme\Pagarme\Model\Cart; -use Exception; use Magento\Checkout\Model\Cart; use Magento\Framework\Exception\LocalizedException; use Pagarme\Core\Kernel\Services\LocalizationService; @@ -59,14 +58,9 @@ class CartConflict */ private $pagarmeConfig; - /** - * @var RulesCartRun - */ - private $rulesCartRun; - /** * CartConflict constructor. - * @throws Exception + * @throws \Exception */ public function __construct() { diff --git a/Model/InstallmentsByBrandAndAmountManagement.php b/Model/InstallmentsByBrandAndAmountManagement.php index d687f7db..7cac31de 100644 --- a/Model/InstallmentsByBrandAndAmountManagement.php +++ b/Model/InstallmentsByBrandAndAmountManagement.php @@ -26,25 +26,14 @@ class InstallmentsByBrandAndAmountManagement extends AbstractInstallmentManagement implements InstallmentsByBrandAndAmountManagementInterface { - /** - * @var SimpleBuilderInterface - */ protected $builder; - - /** - * @var Session - */ protected $session; + protected $cardBrand; /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; - /** - * @var Config - */ - protected $config; - /** * @param SimpleBuilderInterface $builder */ diff --git a/Model/InstallmentsByBrandManagement.php b/Model/InstallmentsByBrandManagement.php index 136cf27f..48329648 100644 --- a/Model/InstallmentsByBrandManagement.php +++ b/Model/InstallmentsByBrandManagement.php @@ -22,20 +22,9 @@ class InstallmentsByBrandManagement extends AbstractInstallmentManagement implements InstallmentsByBrandManagementInterface { - /** - * @var SimpleBuilderInterface - */ protected $builder; - - /** - * @var Session - */ protected $session; - - /** - * @var Config - */ - protected $config; + protected $cardBrand; /** * @param SimpleBuilderInterface $builder diff --git a/Model/Ui/Base/GenericInstallmentsConfigProvider.php b/Model/Ui/Base/GenericInstallmentsConfigProvider.php index b8a89258..200b1548 100755 --- a/Model/Ui/Base/GenericInstallmentsConfigProvider.php +++ b/Model/Ui/Base/GenericInstallmentsConfigProvider.php @@ -12,7 +12,7 @@ namespace Pagarme\Pagarme\Model\Ui\Base; -use Magento\Framework\View\Asset\Repository; +use Pagarme\Core\Kernel\Services\LocalizationService; use Pagarme\Pagarme\Model\Installments\Config\ConfigInterface; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\ConfigInterface as BaseConfig; use Magento\Checkout\Model\ConfigProviderInterface; @@ -22,38 +22,20 @@ abstract class GenericInstallmentsConfigProvider implements ConfigProviderInterf { const CODE = null; - /** - * @var array - */ protected $installments = []; - - /** - * @var ConfigInterface - */ + protected $installmentsBuilder; + protected $installmentsConfig; protected $config; - - /** - * @var Repository - */ - protected $assetRepo; - - /** - * @var BaseConfig - */ + protected $_assetRepo; protected $baseConfig; - /** - * @var StoreManagerInterface - */ - protected $storageManager; - public function __construct( - Repository $assetRepo, + \Magento\Framework\View\Asset\Repository $assetRepo, ConfigInterface $config, BaseConfig $baseConfig, StoreManagerInterface $storeManager ) { - $this->assetRepo = $assetRepo; + $this->_assetRepo = $assetRepo; $this->baseConfig = $baseConfig; $this->storageManager = $storeManager; $this->setConfig($config); @@ -61,7 +43,7 @@ public function __construct( public function getConfig() { - return [ + $config = [ 'payment' => [ 'ccform' => [ 'base_url' => $this->storageManager->getStore()->getBaseUrl(), @@ -74,107 +56,107 @@ public function getConfig() 'Visa' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") ], 'Elo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") ], 'Discover' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") ], 'Diners' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") ], 'Credz' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") ], 'Hipercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'HiperCard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'Mastercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") ], 'Sodexo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") ], 'SodexoAlimentacao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") ], 'SodexoCombustivel' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") ], 'SodexoCultura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") ], 'SodexoGift' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") ], 'SodexoPremium' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") ], 'SodexoRefeicao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") ], 'Cabal' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") ], 'Aura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") ], 'Amex' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") ], 'Alelo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") ], 'VR' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") ], 'Banese' => [ 'height' => 30, 'width' => 46, - 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") + 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") ], ], ] @@ -182,6 +164,8 @@ public function getConfig() 'is_multi_buyer_enabled' => $this->_getConfig()->getMultiBuyerActive(), 'region_states' => $this->getRegionStates() ]; + + return $config; } diff --git a/Observer/SalesOrderPlaceAfter.php b/Observer/SalesOrderPlaceAfter.php index 3b604766..b7acb24a 100644 --- a/Observer/SalesOrderPlaceAfter.php +++ b/Observer/SalesOrderPlaceAfter.php @@ -18,60 +18,49 @@ class SalesOrderPlaceAfter implements ObserverInterface { - /** - * @var CustomerFactory - */ + /** session factory */ + protected $_session; + + /** @var CustomerFactoryInterface */ protected $customerFactory; /** - * @var Session + * @var \Magento\Checkout\Model\Session */ protected $checkoutSession; /** - * @var OrderService + * \Magento\Sales\Model\Service\OrderService */ protected $orderService; /** - * @var CustomerRepositoryInterface + * \Magento\Customer\Api\CustomerRepositoryInterface */ protected $customerRepository; /** - * @var InvoiceService + * \Magento\Sales\Model\Service\InvoiceService */ protected $invoiceService; /** - * @var Transaction + * \Magento\Framework\DB\Transaction */ protected $transaction; /** - * @var InvoiceSender + * \Magento\Sales\Model\Order\Email\Sender\InvoiceSender */ protected $invoiceSender; /** - * @var ConfigCreditCard + * \Pagarme\Pagarme\Gateway\Transaction\CreditCard\Config\Config */ protected $configCreditCard; /** - * @var SessionFactory - */ - protected $sessionFactory; - - /** - * @param Session $checkoutSession - * @param OrderService $orderService - * @param CustomerFactory $customerFactory - * @param SessionFactory $sessionFactory - * @param CustomerRepositoryInterface $customerRepository - * @param InvoiceService $invoiceService - * @param Transaction $transaction - * @param InvoiceSender $invoiceSender - * @param ConfigCreditCard $configCreditCard + * @param \Magento\Checkout\Model\Session $checkoutSession + * @param Api $api */ public function __construct( Session $checkoutSession, @@ -160,7 +149,7 @@ public function createInvoice($order) } /** - * @return Session + * @return \Magento\Checkout\Model\Session */ public function getCheckoutSession() { @@ -168,11 +157,11 @@ public function getCheckoutSession() } /** - * @param Session $checkoutSession + * @param \Magento\Checkout\Model\Session $checkoutSession * * @return self */ - public function setCheckoutSession(Session $checkoutSession) + public function setCheckoutSession(\Magento\Checkout\Model\Session $checkoutSession) { $this->checkoutSession = $checkoutSession; diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index dac7f29f..863b76f0 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -14,7 +14,6 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; use Magento\CatalogWidget\Block\Product\ProductsList as BaseProductsList; -use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; @@ -30,11 +29,6 @@ class ProductsList /** @var ProductInterface */ protected $product = null; - /** - * @var bool|BlockInterface - */ - protected $rendererListBlock; - /** * @param LayoutFactory $layoutFactory */ From c5b7c7242585a1c2895640b47d1273fc8a63e9e0 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 7 Aug 2023 11:42:49 -0300 Subject: [PATCH 27/83] feat: compatibilization with magento 2.4.6 and PHP 8.2 (#214) --- Block/Payment/Info/TwoCreditCard.php | 5 +- Concrete/Magento2DatabaseDecorator.php | 15 +++- Console/Command/MigrateExecute.php | 5 ++ Console/Command/MigrateList.php | 5 ++ Console/MigrateData.php | 27 ++++++- Controller/Adminhtml/Charges/Cancel.php | 2 +- Controller/Adminhtml/Charges/Capture.php | 2 +- Controller/Adminhtml/Charges/ChargeAction.php | 18 +++-- Controller/Adminhtml/Plans/PlanAction.php | 14 +++- .../Adminhtml/Recipients/RecipientAction.php | 24 +++--- .../Adminhtml/RecurrenceProducts/Delete.php | 30 +++++--- Helper/CustomerUpdatePagarmeHelper.php | 18 ++++- Helper/Marketplace/WebkulHelper.php | 39 ++++++++-- Helper/ProductSubscriptionHelper.php | 5 ++ Model/Api/HubCommand.php | 5 ++ Model/Api/ProductsSubscription.php | 10 +++ Model/Api/Subscription.php | 10 +++ Model/Cart/CartConflict.php | 8 +- ...InstallmentsByBrandAndAmountManagement.php | 13 +++- Model/InstallmentsByBrandManagement.php | 13 +++- .../GenericInstallmentsConfigProvider.php | 76 +++++++++++-------- Observer/SalesOrderPlaceAfter.php | 43 +++++++---- .../Block/Product/ProductsList.php | 6 ++ 23 files changed, 300 insertions(+), 93 deletions(-) diff --git a/Block/Payment/Info/TwoCreditCard.php b/Block/Payment/Info/TwoCreditCard.php index 49af1cc0..5474f959 100644 --- a/Block/Payment/Info/TwoCreditCard.php +++ b/Block/Payment/Info/TwoCreditCard.php @@ -153,8 +153,9 @@ public function getTransactionInfo() return []; } - $chargeOne = current($orderObject->getCharges()); - $chargeTwo = next($chargeOne); + $charges = $orderObject->getCharges(); + $chargeOne = current($charges); + $chargeTwo = next($charges); return [ 'card1' => array_merge( diff --git a/Concrete/Magento2DatabaseDecorator.php b/Concrete/Magento2DatabaseDecorator.php index 47431ed2..94b3a405 100644 --- a/Concrete/Magento2DatabaseDecorator.php +++ b/Concrete/Magento2DatabaseDecorator.php @@ -2,10 +2,21 @@ namespace Pagarme\Pagarme\Concrete; +use Magento\Framework\App\ResourceConnection; use Pagarme\Core\Kernel\Abstractions\AbstractDatabaseDecorator; final class Magento2DatabaseDecorator extends AbstractDatabaseDecorator { + /** + * @var ResourceConnection + */ + protected $db; + + /** + * @var mixed + */ + private $lastInsertId; + protected function setTableArray() { $this->tableArray = [ @@ -87,7 +98,7 @@ protected function doFetch($query) public function getLastId() { - return $this->db->lastInsertId; + return $this->lastInsertId; } protected function setTablePrefix() @@ -98,6 +109,6 @@ protected function setTablePrefix() protected function setLastInsertId($lastInsertId) { - $this->db->lastInsertId = $lastInsertId; + $this->lastInsertId = $lastInsertId; } } diff --git a/Console/Command/MigrateExecute.php b/Console/Command/MigrateExecute.php index d3c8278d..eef87356 100644 --- a/Console/Command/MigrateExecute.php +++ b/Console/Command/MigrateExecute.php @@ -12,6 +12,11 @@ class MigrateExecute extends Command { + /** + * @var MigrateData + */ + private $migrateData; + public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/Command/MigrateList.php b/Console/Command/MigrateList.php index 8af60079..c606fce2 100644 --- a/Console/Command/MigrateList.php +++ b/Console/Command/MigrateList.php @@ -12,6 +12,11 @@ class MigrateList extends Command { + /** + * @var MigrateData + */ + private $migrateData; + public function __construct(MigrateData $migrateData) { $this->migrateData = $migrateData; diff --git a/Console/MigrateData.php b/Console/MigrateData.php index 051b2e56..70308bdd 100644 --- a/Console/MigrateData.php +++ b/Console/MigrateData.php @@ -6,15 +6,40 @@ use Magento\Framework\App\Helper\Context; use Magento\Framework\App\ResourceConnection; use Magento\Framework\App\ObjectManager; +use Magento\Framework\DB\Adapter\AdapterInterface; +use Monolog\Logger; class MigrateData extends AbstractHelper { + /** + * @var Logger + */ protected $logger; + /** + * @var AdapterInterface + */ + protected $connection; + + /** + * @var mixed + */ + protected $start; + + /** + * @var array|null + */ + protected $options; + + /** + * @var array|null + */ + protected $log; + public function __construct(Context $context, ResourceConnection $resourceConnection) { parent::__construct($context); - $this->logger = new \Monolog\Logger('migration'); + $this->logger = new Logger('migration'); $this->logger->pushHandler(new \Monolog\Handler\StreamHandler(BP .'/var/log/pagarme_migration.log')); $this->connection = $resourceConnection->getConnection(); $this->start = microtime(true); diff --git a/Controller/Adminhtml/Charges/Cancel.php b/Controller/Adminhtml/Charges/Cancel.php index 09512b53..dd4142b7 100644 --- a/Controller/Adminhtml/Charges/Cancel.php +++ b/Controller/Adminhtml/Charges/Cancel.php @@ -17,7 +17,7 @@ class Cancel extends ChargeAction public function execute() { parent::execute(); - $params = $this->request->getParams(); + $params = $this->getRequest()->getParams(); $logService = new LogService( 'ChargeService', true diff --git a/Controller/Adminhtml/Charges/Capture.php b/Controller/Adminhtml/Charges/Capture.php index e07c3f0b..18af8a6a 100644 --- a/Controller/Adminhtml/Charges/Capture.php +++ b/Controller/Adminhtml/Charges/Capture.php @@ -15,7 +15,7 @@ class Capture extends ChargeAction public function execute() { parent::execute(); - $params = $this->request->getParams(); + $params = $this->getRequest()->getParams(); $logService = new LogService( 'Capture on module', diff --git a/Controller/Adminhtml/Charges/ChargeAction.php b/Controller/Adminhtml/Charges/ChargeAction.php index ba440402..1c60e59f 100644 --- a/Controller/Adminhtml/Charges/ChargeAction.php +++ b/Controller/Adminhtml/Charges/ChargeAction.php @@ -16,23 +16,29 @@ class ChargeAction extends \Magento\Backend\App\Action { - protected $resultPageFactory; + /** + * @var JsonFactory + */ + private $resultJsonFactory; + + /** + * @var StoreManagerInterface + */ + private $storeManager; /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory + * @param Context $context + * @param JsonFactory $resultJsonFactory + * @param StoreManagerInterface $storeManager */ public function __construct( Context $context, JsonFactory $resultJsonFactory, - Http $request, StoreManagerInterface $storeManager ) { Magento2CoreSetup::bootstrap(); - - $this->request = $request; $this->resultJsonFactory = $resultJsonFactory; $this->storeManager = $storeManager; parent::__construct($context); diff --git a/Controller/Adminhtml/Plans/PlanAction.php b/Controller/Adminhtml/Plans/PlanAction.php index 9fd99480..a97a49bd 100644 --- a/Controller/Adminhtml/Plans/PlanAction.php +++ b/Controller/Adminhtml/Plans/PlanAction.php @@ -15,29 +15,41 @@ class PlanAction extends Action { - + /** + * @var bool|PageFactory + */ protected $resultPageFactory = false; + /** * @var CollectionFactory */ protected $productCollectionFactory; + /** * @var JsonFactory */ protected $resultJsonFactory; + /** * @var ProductHelper */ protected $productHelper; + /** * @var Registry */ protected $coreRegistry; + /** * @var Factory */ protected $messageFactory; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + /** * Constructor diff --git a/Controller/Adminhtml/Recipients/RecipientAction.php b/Controller/Adminhtml/Recipients/RecipientAction.php index 0ccd6f29..49a1816f 100644 --- a/Controller/Adminhtml/Recipients/RecipientAction.php +++ b/Controller/Adminhtml/Recipients/RecipientAction.php @@ -2,12 +2,13 @@ namespace Pagarme\Pagarme\Controller\Adminhtml\Recipients; +use Exception; use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; -use Webkul\Marketplace\Model\SellerFactory; +use Webkul\Marketplace\Model\SellerFactory; use Magento\Framework\Message\Factory as MagentoMessageFactory; use Magento\Framework\Module\Manager as ModuleManager; @@ -15,10 +16,6 @@ class RecipientAction extends Action { protected $resultPageFactory = false; - /** - * @var WebkulHelper - */ - protected $webkulHelper; /** * @var Registry @@ -29,18 +26,25 @@ class RecipientAction extends Action * @var SellerFactory */ protected $sellerFactory; + /** * @var MagentoMessageFactory */ protected $messageFactory; /** - * Constructor - * + * @var ModuleManager + */ + private $moduleManager; + + /** * @param Context $context + * @param Registry $coreRegistry * @param PageFactory $resultPageFactory + * @param MagentoMessageFactory $messageFactory + * @param ModuleManager $moduleManager + * @throws Exception */ - public function __construct( Context $context, Registry $coreRegistry, @@ -50,11 +54,11 @@ public function __construct( ) { parent::__construct($context); - + $this->resultPageFactory = $resultPageFactory; $this->coreRegistry = $coreRegistry; $this->messageFactory = $messageFactory; - $this->moduleManager = $moduleManager; + $this->moduleManager = $moduleManager; $this->__init(); Magento2CoreSetup::bootstrap(); } diff --git a/Controller/Adminhtml/RecurrenceProducts/Delete.php b/Controller/Adminhtml/RecurrenceProducts/Delete.php index db9dc7b2..47b3ebf1 100644 --- a/Controller/Adminhtml/RecurrenceProducts/Delete.php +++ b/Controller/Adminhtml/RecurrenceProducts/Delete.php @@ -4,6 +4,7 @@ use Magento\Backend\App\Action; use Magento\Backend\App\Action\Context; +use Magento\Framework\App\ResponseInterface; use Magento\Framework\Message\Factory; use Magento\Framework\Registry; use Magento\Framework\View\Result\PageFactory; @@ -21,16 +22,27 @@ class Delete extends Action */ protected $coreRegistry; + /** + * @var Factory + */ + protected $messageFactory; + + /** + * @var ProductSubscriptionHelper + */ + protected $productSubscriptionHelper; + /** * Constructor * - * @param \Magento\Backend\App\Action\Context $context - * @param \Magento\Framework\View\Result\PageFactory $resultPageFactory - * @throws \Exception + * @param Context $context + * @param PageFactory $resultPageFactory + * @param Registry $coreRegistry + * @param Factory $messageFactory */ public function __construct( - \Magento\Backend\App\Action\Context $context, - \Magento\Framework\View\Result\PageFactory $resultPageFactory, + Context $context, + PageFactory $resultPageFactory, Registry $coreRegistry, Factory $messageFactory ) @@ -48,7 +60,7 @@ public function __construct( /** * Index action * - * @return \Magento\Framework\Controller\ResultInterface + * @return ResponseInterface */ public function execute() { @@ -61,8 +73,7 @@ public function execute() if (!$productData || !$productData->getId()) { $message = $this->messageFactory->create('error', __('Product subscription not exist.')); $this->messageManager->addErrorMessage($message); - $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); - return; + return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); } } @@ -73,7 +84,6 @@ public function execute() $message = $this->messageFactory->create('success', __("Product subscription deleted.")); $this->messageManager->addMessage($message); - $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); - return; + return $this->_redirect('pagarme_pagarme/recurrenceproducts/index'); } } diff --git a/Helper/CustomerUpdatePagarmeHelper.php b/Helper/CustomerUpdatePagarmeHelper.php index 696a4eb5..4fc4f4cd 100644 --- a/Helper/CustomerUpdatePagarmeHelper.php +++ b/Helper/CustomerUpdatePagarmeHelper.php @@ -14,15 +14,25 @@ class CustomerUpdatePagarmeHelper { - - protected $updateCustomerRequest; - + /** + * @var Config + */ protected $config; + /** + * @var CustomerRepositoryInterface + */ protected $customerRepositoryInterface; /** - * AdminCustomerSaveAfter constructor. + * @var CustomerService + */ + protected $customerService; + + /** + * @param Config $config + * @param CustomerRepositoryInterface $customerRepositoryInterface + * @param CustomerService $customerService */ public function __construct( Config $config, diff --git a/Helper/Marketplace/WebkulHelper.php b/Helper/Marketplace/WebkulHelper.php index 8f21419f..6bcdc9a5 100644 --- a/Helper/Marketplace/WebkulHelper.php +++ b/Helper/Marketplace/WebkulHelper.php @@ -25,15 +25,42 @@ class WebkulHelper { private const MODULE_MARKETPLACE_NAME = 'Webkul_Marketplace'; + + /** + * @var mixed + */ private $webkulPaymentHelper; + + /** + * @var MagentoObjectManager + */ private $objectManager; + + /** + * @var RecipientService + */ private $recipientService; + /** + * @var bool + */ private $enabled = false; + /** + * @var SplitRemainderHandler + */ private $splitRemainderHandler; + + /** + * @var ExtrasAndDiscountsHandler + */ private $extrasAndDiscountsHandler; + /** + * @var MoneyService + */ + private $moneyService; + public function __construct() { $moduleConfig = Magento2CoreSetup::getModuleConfiguration(); @@ -86,7 +113,7 @@ private function getSellerAndCommissions($itemPrice, $productId) if (empty($sellerId)) { return []; } - + $marketplacePercentageCommission = $sellerDetail['commission'] / 100; $sellerPercentageCommission = 1 - $marketplacePercentageCommission; @@ -179,7 +206,7 @@ private function handleExtrasAndDiscounts($platformOrderDecorator, &$splitData) $totalPaid, $productTotal ); - + if (empty($extraOrDiscountTotal) && $extraOrDiscountTotal != 0) { return $splitData; } @@ -211,7 +238,7 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $itemPrice, $productId ); - + if (empty($sellerAndCommisions)) { $totalPaidProductWithoutSeller += $itemPrice; continue; @@ -221,15 +248,15 @@ public function getSplitDataFromOrder($corePlatformOrderDecorator) $sellerAndCommisions, $splitData ); - + } - + if (empty($splitData['sellers'])) { return null; } $splitData['marketplace']['totalCommission'] += $totalPaidProductWithoutSeller; - + $splitData = $this->handleExtrasAndDiscounts( $corePlatformOrderDecorator, $splitData diff --git a/Helper/ProductSubscriptionHelper.php b/Helper/ProductSubscriptionHelper.php index fbd489b6..9495a2dd 100644 --- a/Helper/ProductSubscriptionHelper.php +++ b/Helper/ProductSubscriptionHelper.php @@ -26,6 +26,11 @@ class ProductSubscriptionHelper extends AbstractHelper */ protected $objectManager; + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct() { Magento2CoreSetup::bootstrap(); diff --git a/Model/Api/HubCommand.php b/Model/Api/HubCommand.php index 13ed9716..cc4e7028 100644 --- a/Model/Api/HubCommand.php +++ b/Model/Api/HubCommand.php @@ -33,6 +33,11 @@ class HubCommand implements HubCommandInterface */ protected $websiteId; + /** + * @var StoreManagerInterface + */ + protected $storeManager; + public function __construct( Request $request, WriterInterface $configWriter, diff --git a/Model/Api/ProductsSubscription.php b/Model/Api/ProductsSubscription.php index 638e0a83..fcd4631e 100644 --- a/Model/Api/ProductsSubscription.php +++ b/Model/Api/ProductsSubscription.php @@ -31,6 +31,16 @@ class ProductsSubscription implements ProductSubscriptionApiInterface */ protected $productSubscriptionHelper; + /** + * @var LocalizationService + */ + protected $i18n; + + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Api/Subscription.php b/Model/Api/Subscription.php index 1d1451d8..3212193f 100644 --- a/Model/Api/Subscription.php +++ b/Model/Api/Subscription.php @@ -21,6 +21,16 @@ class Subscription implements SubscriptionApiInterface */ protected $subscriptionService; + /** + * @var LocalizationService + */ + protected $i18n; + + /** + * @var MoneyService + */ + protected $moneyService; + public function __construct(Request $request) { $this->request = $request; diff --git a/Model/Cart/CartConflict.php b/Model/Cart/CartConflict.php index 43500270..e71d7dbb 100644 --- a/Model/Cart/CartConflict.php +++ b/Model/Cart/CartConflict.php @@ -2,6 +2,7 @@ namespace Pagarme\Pagarme\Model\Cart; +use Exception; use Magento\Checkout\Model\Cart; use Magento\Framework\Exception\LocalizedException; use Pagarme\Core\Kernel\Services\LocalizationService; @@ -58,9 +59,14 @@ class CartConflict */ private $pagarmeConfig; + /** + * @var RulesCartRun + */ + private $rulesCartRun; + /** * CartConflict constructor. - * @throws \Exception + * @throws Exception */ public function __construct() { diff --git a/Model/InstallmentsByBrandAndAmountManagement.php b/Model/InstallmentsByBrandAndAmountManagement.php index 7cac31de..d687f7db 100644 --- a/Model/InstallmentsByBrandAndAmountManagement.php +++ b/Model/InstallmentsByBrandAndAmountManagement.php @@ -26,14 +26,25 @@ class InstallmentsByBrandAndAmountManagement extends AbstractInstallmentManagement implements InstallmentsByBrandAndAmountManagementInterface { + /** + * @var SimpleBuilderInterface + */ protected $builder; + + /** + * @var Session + */ protected $session; - protected $cardBrand; /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; + /** + * @var Config + */ + protected $config; + /** * @param SimpleBuilderInterface $builder */ diff --git a/Model/InstallmentsByBrandManagement.php b/Model/InstallmentsByBrandManagement.php index 48329648..136cf27f 100644 --- a/Model/InstallmentsByBrandManagement.php +++ b/Model/InstallmentsByBrandManagement.php @@ -22,9 +22,20 @@ class InstallmentsByBrandManagement extends AbstractInstallmentManagement implements InstallmentsByBrandManagementInterface { + /** + * @var SimpleBuilderInterface + */ protected $builder; + + /** + * @var Session + */ protected $session; - protected $cardBrand; + + /** + * @var Config + */ + protected $config; /** * @param SimpleBuilderInterface $builder diff --git a/Model/Ui/Base/GenericInstallmentsConfigProvider.php b/Model/Ui/Base/GenericInstallmentsConfigProvider.php index 200b1548..b8a89258 100755 --- a/Model/Ui/Base/GenericInstallmentsConfigProvider.php +++ b/Model/Ui/Base/GenericInstallmentsConfigProvider.php @@ -12,7 +12,7 @@ namespace Pagarme\Pagarme\Model\Ui\Base; -use Pagarme\Core\Kernel\Services\LocalizationService; +use Magento\Framework\View\Asset\Repository; use Pagarme\Pagarme\Model\Installments\Config\ConfigInterface; use Pagarme\Pagarme\Gateway\Transaction\Base\Config\ConfigInterface as BaseConfig; use Magento\Checkout\Model\ConfigProviderInterface; @@ -22,20 +22,38 @@ abstract class GenericInstallmentsConfigProvider implements ConfigProviderInterf { const CODE = null; + /** + * @var array + */ protected $installments = []; - protected $installmentsBuilder; - protected $installmentsConfig; + + /** + * @var ConfigInterface + */ protected $config; - protected $_assetRepo; + + /** + * @var Repository + */ + protected $assetRepo; + + /** + * @var BaseConfig + */ protected $baseConfig; + /** + * @var StoreManagerInterface + */ + protected $storageManager; + public function __construct( - \Magento\Framework\View\Asset\Repository $assetRepo, + Repository $assetRepo, ConfigInterface $config, BaseConfig $baseConfig, StoreManagerInterface $storeManager ) { - $this->_assetRepo = $assetRepo; + $this->assetRepo = $assetRepo; $this->baseConfig = $baseConfig; $this->storageManager = $storeManager; $this->setConfig($config); @@ -43,7 +61,7 @@ public function __construct( public function getConfig() { - $config = [ + return [ 'payment' => [ 'ccform' => [ 'base_url' => $this->storageManager->getStore()->getBaseUrl(), @@ -56,107 +74,107 @@ public function getConfig() 'Visa' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Visa.png") ], 'Elo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Elo.png") ], 'Discover' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Discover.png") ], 'Diners' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Diners.png") ], 'Credz' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Credz.png") ], 'Hipercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'HiperCard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Hipercard.png") ], 'Mastercard' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Mastercard.png") ], 'Sodexo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Sodexo.png") ], 'SodexoAlimentacao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoAlimentacao.png") ], 'SodexoCombustivel' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCombustivel.png") ], 'SodexoCultura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoCultura.png") ], 'SodexoGift' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoGift.png") ], 'SodexoPremium' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoPremium.png") ], 'SodexoRefeicao' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/SodexoRefeicao.png") ], 'Cabal' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Cabal.png") ], 'Aura' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Aura.png") ], 'Amex' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Amex.png") ], 'Alelo' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Alelo.png") ], 'VR' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/VR.png") ], 'Banese' => [ 'height' => 30, 'width' => 46, - 'url' => $this->_assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") + 'url' => $this->assetRepo->getUrl("Pagarme_Pagarme::images/cc/Banese.png") ], ], ] @@ -164,8 +182,6 @@ public function getConfig() 'is_multi_buyer_enabled' => $this->_getConfig()->getMultiBuyerActive(), 'region_states' => $this->getRegionStates() ]; - - return $config; } diff --git a/Observer/SalesOrderPlaceAfter.php b/Observer/SalesOrderPlaceAfter.php index b7acb24a..3b604766 100644 --- a/Observer/SalesOrderPlaceAfter.php +++ b/Observer/SalesOrderPlaceAfter.php @@ -18,49 +18,60 @@ class SalesOrderPlaceAfter implements ObserverInterface { - /** session factory */ - protected $_session; - - /** @var CustomerFactoryInterface */ + /** + * @var CustomerFactory + */ protected $customerFactory; /** - * @var \Magento\Checkout\Model\Session + * @var Session */ protected $checkoutSession; /** - * \Magento\Sales\Model\Service\OrderService + * @var OrderService */ protected $orderService; /** - * \Magento\Customer\Api\CustomerRepositoryInterface + * @var CustomerRepositoryInterface */ protected $customerRepository; /** - * \Magento\Sales\Model\Service\InvoiceService + * @var InvoiceService */ protected $invoiceService; /** - * \Magento\Framework\DB\Transaction + * @var Transaction */ protected $transaction; /** - * \Magento\Sales\Model\Order\Email\Sender\InvoiceSender + * @var InvoiceSender */ protected $invoiceSender; /** - * \Pagarme\Pagarme\Gateway\Transaction\CreditCard\Config\Config + * @var ConfigCreditCard */ protected $configCreditCard; /** - * @param \Magento\Checkout\Model\Session $checkoutSession - * @param Api $api + * @var SessionFactory + */ + protected $sessionFactory; + + /** + * @param Session $checkoutSession + * @param OrderService $orderService + * @param CustomerFactory $customerFactory + * @param SessionFactory $sessionFactory + * @param CustomerRepositoryInterface $customerRepository + * @param InvoiceService $invoiceService + * @param Transaction $transaction + * @param InvoiceSender $invoiceSender + * @param ConfigCreditCard $configCreditCard */ public function __construct( Session $checkoutSession, @@ -149,7 +160,7 @@ public function createInvoice($order) } /** - * @return \Magento\Checkout\Model\Session + * @return Session */ public function getCheckoutSession() { @@ -157,11 +168,11 @@ public function getCheckoutSession() } /** - * @param \Magento\Checkout\Model\Session $checkoutSession + * @param Session $checkoutSession * * @return self */ - public function setCheckoutSession(\Magento\Checkout\Model\Session $checkoutSession) + public function setCheckoutSession(Session $checkoutSession) { $this->checkoutSession = $checkoutSession; diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index 863b76f0..dac7f29f 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -14,6 +14,7 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; use Magento\CatalogWidget\Block\Product\ProductsList as BaseProductsList; +use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; @@ -29,6 +30,11 @@ class ProductsList /** @var ProductInterface */ protected $product = null; + /** + * @var bool|BlockInterface + */ + protected $rendererListBlock; + /** * @param LayoutFactory $layoutFactory */ From 1fff239f27cee92fc4032c69bb737db47a9be3af Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 8 Aug 2023 11:23:39 -0300 Subject: [PATCH 28/83] refactor: showing cycle option value in cart (#213) --- .../Catalog/Helper/Product/Configuration.php | 78 ++++++++++ .../Render/ProductPriceCyclesPlugin.php | 40 ------ etc/di.xml | 4 - etc/frontend/di.xml | 7 + .../templates/product/priceCycles.phtml | 135 ------------------ 5 files changed, 85 insertions(+), 179 deletions(-) create mode 100644 Plugin/Catalog/Helper/Product/Configuration.php delete mode 100644 Plugin/Princing/Render/ProductPriceCyclesPlugin.php delete mode 100644 view/frontend/templates/product/priceCycles.phtml diff --git a/Plugin/Catalog/Helper/Product/Configuration.php b/Plugin/Catalog/Helper/Product/Configuration.php new file mode 100644 index 00000000..d63b6b45 --- /dev/null +++ b/Plugin/Catalog/Helper/Product/Configuration.php @@ -0,0 +1,78 @@ +pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->recurrenceService = $recurrenceService; + } + + /** + * @param ConfigurationOriginal $subject + * @param callable $proceed + * @param ItemInterface $item + * @return array + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function aroundGetCustomOptions( + ConfigurationOriginal $subject, + callable $proceed, + ItemInterface $item + ) { + $result = $proceed($item); + + $product = $item->getProduct(); + $hasNoRecurrence = !$this->pagarmeConfig->isEnabled() || + !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() || + empty($this->recurrenceService->getRecurrenceProductByProductId($product->getId())); + if ($hasNoRecurrence) { + return $result; + } + + $updateCycleValueCallback = function ($item) use ($product) { + if (ucfirst(RecurrenceSubscriptionRepetitionsInterface::CYCLES) !== $item['label']) { + return $item; + } + + $item['value'] = ProductHelper::applyDiscount($item['value'], $product); + return $item; + }; + + return array_map($updateCycleValueCallback, $result); + } +} diff --git a/Plugin/Princing/Render/ProductPriceCyclesPlugin.php b/Plugin/Princing/Render/ProductPriceCyclesPlugin.php deleted file mode 100644 index e3ecc232..00000000 --- a/Plugin/Princing/Render/ProductPriceCyclesPlugin.php +++ /dev/null @@ -1,40 +0,0 @@ -productHelper = $productHelper; - } - - public function beforeSetTemplate() - { - return ['Pagarme_Pagarme::product/priceCycles.phtml']; - } - - /** - * @param string $title - * @param Product $product - * @return string - */ - public static function applyDiscount($title, $product) - { - return ProductHelper::applyDiscount($title, $product); - } -} diff --git a/etc/di.xml b/etc/di.xml index c0696c91..6a70e44c 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -659,10 +659,6 @@ - - - - diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index eed647e8..21b3a5c5 100755 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -76,4 +76,11 @@ + + + + diff --git a/view/frontend/templates/product/priceCycles.phtml b/view/frontend/templates/product/priceCycles.phtml deleted file mode 100644 index 8d0d122e..00000000 --- a/view/frontend/templates/product/priceCycles.phtml +++ /dev/null @@ -1,135 +0,0 @@ -getItem(); -$product = $_item->getProduct(); -$isVisibleProduct = $product->isVisibleInSiteVisibility(); -/** @var \Magento\Msrp\Helper\Data $helper */ -$helper = $this->helper(Magento\Msrp\Helper\Data::class); -$canApplyMsrp = $helper->isShowBeforeOrderConfirm($product) && $helper->isMinimalPriceLessMsrp($product); -?> - - - - hasProductUrl()) :?> - - - - - getImage($block->getProductForThumbnail(), 'cart_page_product_thumbnail')->toHtml() ?> - hasProductUrl()) :?> - - - - -
- - hasProductUrl()) :?> - escapeHtml($block->getProductName()) ?> - - escapeHtml($block->getProductName()) ?> - - - getOptionList()) :?> -
- - - getFormatedOptionValue($_option) ?> -
escapeHtml($_option['label']) ?>
-
- - escapeHtml($_formatedOptionValue['full_view']) ?> - - escapeHtml($_formatedOptionValue['value'], ['span', 'a']) ?> - -
- -
- - getMessages()) :?> - -
-
escapeHtml($message['text']) ?>
-
- - - getProductAdditionalInformationBlock(); ?> - - setItem($_item)->toHtml() ?> - -
- - - - - - escapeHtml(__('See price before order confirmation.')) ?> - getId(); ?> - - escapeHtml(__("What's this?")) ?> - - - - - - getUnitPriceHtml($_item) ?> - - - -
-
- -
-
- - - - - -- - - getRowTotalHtml($_item) ?> - - - - - -
- getActions($_item) ?> -
- - - From 8d6dfc5c8fed4495213ff9d541dd56c17958029a Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Tue, 8 Aug 2023 11:59:21 -0300 Subject: [PATCH 29/83] Feat: Clear checkout error messages on field change (#216) * Feat: Clear checkout error messages on field change * Changed var to const * Defined constants instead of duplicating literals --- .../core/checkout/PaymentMethodController.js | 111 ++++++++++++++++++ .../js/core/checkout/PlatformFormHandler.js | 16 ++- 2 files changed, 121 insertions(+), 6 deletions(-) diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index bcf1c350..de75cb2d 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -181,6 +181,7 @@ PaymentMethodController.prototype.pixInit = function () { if (this.platformConfig.isMultibuyerEnabled) { this.fillMultibuyerStateSelect(this.formObject); this.addShowMultibuyerListener(this.formObject); + this.addValidatorListener(this.formObject); } }; @@ -202,6 +203,7 @@ PaymentMethodController.prototype.boletoInit = function () { if (this.platformConfig.isMultibuyerEnabled) { this.fillMultibuyerStateSelect(this.formObject); this.addShowMultibuyerListener(this.formObject); + this.addValidatorListener(this.formObject); } }; @@ -263,6 +265,7 @@ PaymentMethodController.prototype.addCreditCardListeners = function (formObject) return; } + this.addValidatorListener(formObject); this.addCreditCardNumberListener(formObject); this.addCreditCardInstallmentsListener(formObject); this.addCreditCardHolderNameListener(formObject); @@ -372,6 +375,33 @@ PaymentMethodController.prototype.addCreditCardHolderNameListener = function(for }); } +PaymentMethodController.prototype.addValidatorListener = function(formObject) { + const paymentMethodController = this; + + jQuery(formObject.containerSelector).on('change', function (event) { + const element = jQuery(event.target); + if ( + element.attr('name').startsWith('payment[cc_type]') + && element.val() !== 'default' + ) { + paymentMethodController.validateBrandField(formObject); + return; + } + if (element.attr('name').startsWith('payment[cc_number]')) { + paymentMethodController.validateCcNumberField(element, formObject); + return; + } + if ( + element.attr('name').startsWith('payment[cc_exp_month]') + || element.attr('name').startsWith('payment[cc_exp_year]') + ) { + paymentMethodController.validateCcExpDateField(formObject); + return; + } + paymentMethodController.validateDefaultField(element); + }); +}; + PaymentMethodController.prototype.addCreditCardNumberListener = function(formObject) { var paymentMethodController = this; @@ -685,6 +715,87 @@ PaymentMethodController.prototype.fillCardAmount = function (formObject, count, formObject.inputAmount.val(amount); }; +PaymentMethodController.prototype.validateCcNumberField = function (element, formObject) { + if (element.val() === '') { + formObject.creditCardBrand.val(''); + + formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.switchBrand(''); + } + this.validateDefaultField(element); + this.validateBrandField(formObject); +}; + +const fieldError = '.field-error'; +const errorClass = '_error'; + +PaymentMethodController.prototype.validateCcExpDateField = function (formObject) { + const cardExpirationMonth = formObject.creditCardExpMonth; + const cardExpirationYear = formObject.creditCardExpYear; + + const cardDate = new Date (cardExpirationYear.val(), cardExpirationMonth.val() -1); + const dateNow = new Date(); + + const monthParentsElements = cardExpirationMonth.parent().parent(); + const yearParentsElements = cardExpirationYear.parent().parent(); + const parentsElements = yearParentsElements.parents('.field'); + const parentsElementsError = parentsElements.find(fieldError); + + if (cardDate < dateNow) { + monthParentsElements.addClass(errorClass); + yearParentsElements.addClass(errorClass); + parentsElementsError.show(); + return true; + } + + monthParentsElements.removeClass(errorClass); + yearParentsElements.removeClass(errorClass); + parentsElementsError.hide(); + return false; +}; + +PaymentMethodController.prototype.validateDefaultField = function (element) { + const requiredElement = element.parent().parent(); + const requiredElementError = requiredElement.children(fieldError); + + if (element.val() === '') { + requiredElement.addClass(errorClass); + requiredElementError.show(); + return true; + } + + requiredElement.removeClass(errorClass); + requiredElementError.hide(); + return false; +}; + +PaymentMethodController.prototype.validateBrandField = function (formObject) { + const element = formObject.creditCardBrand; + const requiredElement = element.parent().parent(); + const requiredElementError = requiredElement.find(fieldError); + + const brands = []; + PlatformConfig.PlatformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { + brands.push(item.title.toUpperCase()); + }); + + if ( + !brands.includes(element.val().toUpperCase()) + || element.val === '' + ) { + requiredElement.addClass(errorClass); + requiredElementError.show(); + requiredElement.find('.nobrand').hide(); + return true; + } + + requiredElement.removeClass(errorClass); + requiredElementError.hide(); + + return false; +}; + PaymentMethodController.prototype.setBin = function (binObj, creditCardNumberElement, formObject) { var bin = binObj; diff --git a/view/frontend/web/js/core/checkout/PlatformFormHandler.js b/view/frontend/web/js/core/checkout/PlatformFormHandler.js index 5d453a5d..620216ed 100644 --- a/view/frontend/web/js/core/checkout/PlatformFormHandler.js +++ b/view/frontend/web/js/core/checkout/PlatformFormHandler.js @@ -7,23 +7,27 @@ FormHandler.prototype.init = function (formObject) { }; FormHandler.prototype.switchBrand = function (brand) { - var brandsSelector = this.formObject.containerSelector + ' .brands'; + const brandsSelector = this.formObject.containerSelector + ' .brands'; + const brandElement = this.formObject.creditCardBrand; - jQuery(brandsSelector).css('filter', 'grayscale(100%)'); + jQuery(brandsSelector).css('filter', 'grayscale(100%) opacity(60%)'); if(typeof brand != 'undefined' && brand.length > 0){ - var brandSelector = + const brandSelector = this.formObject.containerSelector + ' .' + brand.toLowerCase(); jQuery(brandSelector).css('filter', 'none'); - this.formObject.creditCardBrand.val(brand); + brandElement.val(brand); + + if (brandElement.val() !== 'default' && brandElement.val() !== '') { + brandElement.change(); + } return; } - this.formObject.creditCardBrand.val(''); - this.formObject.creditCardNumber.change(); + brandElement.val(''); }; FormHandler.prototype.updateInstallmentSelect = function (installmentsObj, element, installmentSelected = null) { From b449d910bbe439f3f8028f3bb4db85a1719d765e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 11 Aug 2023 09:41:55 -0300 Subject: [PATCH 30/83] :arrow_up: Bump word-wrap from 1.2.3 to 1.2.5 in /e2e (#218) --- e2e/package-lock.json | 4956 ++++++++++++++++++++--------------------- 1 file changed, 2478 insertions(+), 2478 deletions(-) diff --git a/e2e/package-lock.json b/e2e/package-lock.json index 6c5791fd..f0dc89c3 100644 --- a/e2e/package-lock.json +++ b/e2e/package-lock.json @@ -1,2485 +1,2485 @@ { - "name": "playwright-magento2-e2e", - "version": "1.0.0", - "lockfileVersion": 2, - "requires": true, - "packages": { - "": { - "name": "playwright-magento2-e2e", - "version": "1.0.0", - "license": "MIT", - "devDependencies": { - "@faker-js/faker": "7.6.0", - "@playwright/test": "1.29.2", - "allure-commandline": "2.20.1", - "allure-playwright": "2.0.0-beta.24", - "eslint": "8.32.0", - "eslint-plugin-playwright": "0.12.0", - "expect-playwright": "0.8.0", - "playwright": "1.29.2", - "wait-on": "7.0.1" - } - }, - "node_modules/@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", - "dev": true, - "dependencies": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/@faker-js/faker": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", - "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", - "dev": true, - "engines": { - "node": ">=14.0.0", - "npm": ">=6.0.0" - } - }, - "node_modules/@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "dev": true - }, - "node_modules/@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dev": true, - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, - "dependencies": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - }, - "engines": { - "node": ">=10.10.0" - } - }, - "node_modules/@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true, - "engines": { - "node": ">=12.22" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/nzakas" - } - }, - "node_modules/@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "node_modules/@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "dependencies": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "dependencies": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/@playwright/test": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz", - "integrity": "sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==", - "dev": true, - "dependencies": { - "@types/node": "*", - "playwright-core": "1.29.2" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", - "dev": true, - "dependencies": { - "@hapi/hoek": "^9.0.0" - } - }, - "node_modules/@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "dev": true - }, - "node_modules/@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "dev": true - }, - "node_modules/@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", - "dev": true - }, - "node_modules/acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true, - "bin": { - "acorn": "bin/acorn" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "peerDependencies": { - "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" - } - }, - "node_modules/allure-commandline": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.20.1.tgz", - "integrity": "sha512-QKdPUgnS4q6V0MWsZl6miveuoIo84sR4+Olh0N2JY+UWawpxnXHqWcHUtHedOJx9vCewTi3nSkBUiuOuUmn6Dw==", - "dev": true, - "bin": { - "allure": "bin/allure" - } - }, - "node_modules/allure-js-commons": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-2.0.0-beta.24.tgz", - "integrity": "sha512-RrW4cBtNJY9Sr5jBNf5C+sIrEu66L6TFOf+r7pP0uJDftXPtQAJYRYAigSoHl+a2SI1xXAX6J7Pcy5dAFpQsqw==", - "dev": true, - "dependencies": { - "properties": "^1.2.1", - "uuid": "^8.3.0" - } - }, - "node_modules/allure-playwright": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-2.0.0-beta.24.tgz", - "integrity": "sha512-piuek2KDooHxNJm3VNSPK8ulTD5n57/5Gj8ahMQw41YF7XM9XZaAQly9m3rTlfLZ5xn59eZxBeEybL9bZX2DgQ==", - "dev": true, - "dependencies": { - "allure-js-commons": "2.0.0-beta.24" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "node_modules/axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "dependencies": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "node_modules/callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" - } - }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/eslint": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", - "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", - "dev": true, - "dependencies": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - }, - "bin": { - "eslint": "bin/eslint.js" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/eslint-plugin-playwright": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", - "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", - "dev": true, - "peerDependencies": { - "eslint": ">=7", - "eslint-plugin-jest": ">=24" - }, - "peerDependenciesMeta": { - "eslint-plugin-jest": { - "optional": true - } - } - }, - "node_modules/eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "dependencies": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "dependencies": { - "eslint-visitor-keys": "^2.0.0" - }, - "engines": { - "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - }, - "peerDependencies": { - "eslint": ">=5" - } - }, - "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - } - }, - "node_modules/espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", - "dev": true, - "dependencies": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - }, - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" - }, - "funding": { - "url": "https://opencollective.com/eslint" - } - }, - "node_modules/esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "dependencies": { - "estraverse": "^5.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "dependencies": { - "estraverse": "^5.2.0" - }, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true, - "engines": { - "node": ">=4.0" - } - }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/expect-playwright": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/expect-playwright/-/expect-playwright-0.8.0.tgz", - "integrity": "sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==", - "dev": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "node_modules/fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "node_modules/fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "dependencies": { - "reusify": "^1.0.4" - } - }, - "node_modules/file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "dependencies": { - "flat-cache": "^3.0.4" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "dependencies": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - }, - "engines": { - "node": "^10.12.0 || >=12.0.0" - } - }, - "node_modules/flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "node_modules/follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } - }, - "node_modules/form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "node_modules/glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "dependencies": { - "is-glob": "^4.0.3" - }, - "engines": { - "node": ">=10.13.0" - } - }, - "node_modules/globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "dependencies": { - "type-fest": "^0.20.2" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "dependencies": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true, - "engines": { - "node": ">=0.8.19" - } - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "node_modules/joi": { - "version": "17.7.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", - "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", - "dev": true, - "dependencies": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", - "@sideway/formula": "^3.0.0", - "@sideway/pinpoint": "^2.0.0" - } - }, - "node_modules/js-sdsl": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/js-sdsl" - } - }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "node_modules/json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "node_modules/levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "dependencies": { - "mime-db": "1.52.0" - }, - "engines": { - "node": ">= 0.6" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, - "engines": { - "node": "*" - } - }, - "node_modules/minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "dependencies": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "dependencies": { - "callsites": "^3.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/playwright": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.29.2.tgz", - "integrity": "sha512-hKBYJUtdmYzcjdhYDkP9WGtORwwZBBKAW8+Lz7sr0ZMxtJr04ASXVzH5eBWtDkdb0c3LLFsehfPBTRfvlfKJOA==", - "dev": true, - "hasInstallScript": true, - "dependencies": { - "playwright-core": "1.29.2" - }, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/playwright-core": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.29.2.tgz", - "integrity": "sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==", - "dev": true, - "bin": { - "playwright": "cli.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", - "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", - "dev": true, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, - "engines": { - "iojs": ">=1.0.0", - "node": ">=0.10.0" - } - }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "dependencies": { - "glob": "^7.1.3" - }, - "bin": { - "rimraf": "bin.js" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "queue-microtask": "^1.2.2" - } - }, - "node_modules/rxjs": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", - "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", - "dev": true, - "dependencies": { - "tslib": "^2.1.0" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "node_modules/tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", - "dev": true - }, - "node_modules/type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "dependencies": { - "prelude-ls": "^1.2.1" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "dependencies": { - "punycode": "^2.1.0" - } - }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true, - "bin": { - "uuid": "dist/bin/uuid" - } - }, - "node_modules/wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", - "dev": true, - "dependencies": { - "axios": "^0.27.2", - "joi": "^17.7.0", - "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" - }, - "bin": { - "wait-on": "bin/wait-on" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "name": "playwright-magento2-e2e", + "version": "1.0.0", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "name": "playwright-magento2-e2e", + "version": "1.0.0", + "license": "MIT", + "devDependencies": { + "@faker-js/faker": "7.6.0", + "@playwright/test": "1.29.2", + "allure-commandline": "2.20.1", + "allure-playwright": "2.0.0-beta.24", + "eslint": "8.32.0", + "eslint-plugin-playwright": "0.12.0", + "expect-playwright": "0.8.0", + "playwright": "1.29.2", + "wait-on": "7.0.1" + } + }, + "node_modules/@eslint/eslintrc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "dev": true, + "dependencies": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/@faker-js/faker": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", + "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", + "dev": true, + "engines": { + "node": ">=14.0.0", + "npm": ">=6.0.0" + } + }, + "node_modules/@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "dev": true + }, + "node_modules/@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dev": true, + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "dependencies": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true, + "engines": { + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "dependencies": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "dependencies": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/@playwright/test": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz", + "integrity": "sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==", + "dev": true, + "dependencies": { + "@types/node": "*", + "playwright-core": "1.29.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "dev": true, + "dependencies": { + "@hapi/hoek": "^9.0.0" + } + }, + "node_modules/@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", + "dev": true + }, + "node_modules/@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "dev": true + }, + "node_modules/@types/node": { + "version": "18.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", + "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", + "dev": true + }, + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true, + "bin": { + "acorn": "bin/acorn" + }, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/allure-commandline": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.20.1.tgz", + "integrity": "sha512-QKdPUgnS4q6V0MWsZl6miveuoIo84sR4+Olh0N2JY+UWawpxnXHqWcHUtHedOJx9vCewTi3nSkBUiuOuUmn6Dw==", + "dev": true, + "bin": { + "allure": "bin/allure" + } + }, + "node_modules/allure-js-commons": { + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-2.0.0-beta.24.tgz", + "integrity": "sha512-RrW4cBtNJY9Sr5jBNf5C+sIrEu66L6TFOf+r7pP0uJDftXPtQAJYRYAigSoHl+a2SI1xXAX6J7Pcy5dAFpQsqw==", + "dev": true, + "dependencies": { + "properties": "^1.2.1", + "uuid": "^8.3.0" + } + }, + "node_modules/allure-playwright": { + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-2.0.0-beta.24.tgz", + "integrity": "sha512-piuek2KDooHxNJm3VNSPK8ulTD5n57/5Gj8ahMQw41YF7XM9XZaAQly9m3rTlfLZ5xn59eZxBeEybL9bZX2DgQ==", + "dev": true, + "dependencies": { + "allure-js-commons": "2.0.0-beta.24" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "node_modules/axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "dependencies": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "node_modules/cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" + }, + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/eslint": { + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "dev": true, + "dependencies": { + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/eslint-plugin-playwright": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", + "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", + "dev": true, + "peerDependencies": { + "eslint": ">=7", + "eslint-plugin-jest": ">=24" + }, + "peerDependenciesMeta": { + "eslint-plugin-jest": { + "optional": true + } + } + }, + "node_modules/eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, + "engines": { + "node": ">=10" + } + }, + "node_modules/eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "dependencies": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" + } + }, + "node_modules/esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "dependencies": { + "estraverse": "^5.1.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/expect-playwright": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/expect-playwright/-/expect-playwright-0.8.0.tgz", + "integrity": "sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==", + "dev": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "dependencies": { + "reusify": "^1.0.4" + } + }, + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "dependencies": { + "flat-cache": "^3.0.4" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "dependencies": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "dependencies": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" + } + }, + "node_modules/flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "node_modules/follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "dependencies": { + "is-glob": "^4.0.3" + }, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "dependencies": { + "type-fest": "^0.20.2" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "node_modules/joi": { + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", + "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", + "dev": true, + "dependencies": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "dependencies": { + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/playwright": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.29.2.tgz", + "integrity": "sha512-hKBYJUtdmYzcjdhYDkP9WGtORwwZBBKAW8+Lz7sr0ZMxtJr04ASXVzH5eBWtDkdb0c3LLFsehfPBTRfvlfKJOA==", + "dev": true, + "hasInstallScript": true, + "dependencies": { + "playwright-core": "1.29.2" + }, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/playwright-core": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.29.2.tgz", + "integrity": "sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==", + "dev": true, + "bin": { + "playwright": "cli.js" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", + "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", + "dev": true, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" } + ], + "dependencies": { + "queue-microtask": "^1.2.2" + } + }, + "node_modules/rxjs": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", + "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", + "dev": true, + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "node_modules/tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/wait-on": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", + "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "dev": true, + "dependencies": { + "axios": "^0.27.2", + "joi": "^17.7.0", + "lodash": "^4.17.21", + "minimist": "^1.2.7", + "rxjs": "^7.8.0" + }, + "bin": { + "wait-on": "bin/wait-on" + }, + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } }, - "dependencies": { - "@eslint/eslintrc": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", - "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", - "dev": true, - "requires": { - "ajv": "^6.12.4", - "debug": "^4.3.2", - "espree": "^9.4.0", - "globals": "^13.19.0", - "ignore": "^5.2.0", - "import-fresh": "^3.2.1", - "js-yaml": "^4.1.0", - "minimatch": "^3.1.2", - "strip-json-comments": "^3.1.1" - } - }, - "@faker-js/faker": { - "version": "7.6.0", - "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", - "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", - "dev": true - }, - "@hapi/hoek": { - "version": "9.3.0", - "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", - "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", - "dev": true - }, - "@hapi/topo": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", - "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.0.0" - } - }, - "@humanwhocodes/config-array": { - "version": "0.11.8", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", - "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", - "dev": true, - "requires": { - "@humanwhocodes/object-schema": "^1.2.1", - "debug": "^4.1.1", - "minimatch": "^3.0.5" - } - }, - "@humanwhocodes/module-importer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", - "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", - "dev": true - }, - "@humanwhocodes/object-schema": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", - "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", - "dev": true - }, - "@nodelib/fs.scandir": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", - "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, - "requires": { - "@nodelib/fs.stat": "2.0.5", - "run-parallel": "^1.1.9" - } - }, - "@nodelib/fs.stat": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", - "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true - }, - "@nodelib/fs.walk": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", - "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, - "requires": { - "@nodelib/fs.scandir": "2.1.5", - "fastq": "^1.6.0" - } - }, - "@playwright/test": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz", - "integrity": "sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==", - "dev": true, - "requires": { - "@types/node": "*", - "playwright-core": "1.29.2" - } - }, - "@sideway/address": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", - "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.0.0" - } - }, - "@sideway/formula": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", - "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", - "dev": true - }, - "@sideway/pinpoint": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", - "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", - "dev": true - }, - "@types/node": { - "version": "18.13.0", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", - "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", - "dev": true - }, - "acorn": { - "version": "8.8.2", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", - "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", - "dev": true - }, - "acorn-jsx": { - "version": "5.3.2", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", - "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", - "dev": true, - "requires": {} - }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "dev": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" - } - }, - "allure-commandline": { - "version": "2.20.1", - "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.20.1.tgz", - "integrity": "sha512-QKdPUgnS4q6V0MWsZl6miveuoIo84sR4+Olh0N2JY+UWawpxnXHqWcHUtHedOJx9vCewTi3nSkBUiuOuUmn6Dw==", - "dev": true - }, - "allure-js-commons": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-2.0.0-beta.24.tgz", - "integrity": "sha512-RrW4cBtNJY9Sr5jBNf5C+sIrEu66L6TFOf+r7pP0uJDftXPtQAJYRYAigSoHl+a2SI1xXAX6J7Pcy5dAFpQsqw==", - "dev": true, - "requires": { - "properties": "^1.2.1", - "uuid": "^8.3.0" - } - }, - "allure-playwright": { - "version": "2.0.0-beta.24", - "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-2.0.0-beta.24.tgz", - "integrity": "sha512-piuek2KDooHxNJm3VNSPK8ulTD5n57/5Gj8ahMQw41YF7XM9XZaAQly9m3rTlfLZ5xn59eZxBeEybL9bZX2DgQ==", - "dev": true, - "requires": { - "allure-js-commons": "2.0.0-beta.24" - } - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, - "requires": { - "color-convert": "^2.0.1" - } - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", - "dev": true - }, - "axios": { - "version": "0.27.2", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", - "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", - "dev": true, - "requires": { - "follow-redirects": "^1.14.9", - "form-data": "^4.0.0" - } - }, - "balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", - "dev": true - }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" - } - }, - "callsites": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", - "dev": true - }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - } - }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, - "requires": { - "color-name": "~1.1.4" - } - }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true - }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "deep-is": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "eslint": { - "version": "8.32.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", - "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", - "dev": true, - "requires": { - "@eslint/eslintrc": "^1.4.1", - "@humanwhocodes/config-array": "^0.11.8", - "@humanwhocodes/module-importer": "^1.0.1", - "@nodelib/fs.walk": "^1.2.8", - "ajv": "^6.10.0", - "chalk": "^4.0.0", - "cross-spawn": "^7.0.2", - "debug": "^4.3.2", - "doctrine": "^3.0.0", - "escape-string-regexp": "^4.0.0", - "eslint-scope": "^7.1.1", - "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.3.0", - "espree": "^9.4.0", - "esquery": "^1.4.0", - "esutils": "^2.0.2", - "fast-deep-equal": "^3.1.3", - "file-entry-cache": "^6.0.1", - "find-up": "^5.0.0", - "glob-parent": "^6.0.2", - "globals": "^13.19.0", - "grapheme-splitter": "^1.0.4", - "ignore": "^5.2.0", - "import-fresh": "^3.0.0", - "imurmurhash": "^0.1.4", - "is-glob": "^4.0.0", - "is-path-inside": "^3.0.3", - "js-sdsl": "^4.1.4", - "js-yaml": "^4.1.0", - "json-stable-stringify-without-jsonify": "^1.0.1", - "levn": "^0.4.1", - "lodash.merge": "^4.6.2", - "minimatch": "^3.1.2", - "natural-compare": "^1.4.0", - "optionator": "^0.9.1", - "regexpp": "^3.2.0", - "strip-ansi": "^6.0.1", - "strip-json-comments": "^3.1.0", - "text-table": "^0.2.0" - } - }, - "eslint-plugin-playwright": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", - "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", - "dev": true, - "requires": {} - }, - "eslint-scope": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", - "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", - "dev": true, - "requires": { - "esrecurse": "^4.3.0", - "estraverse": "^5.2.0" - } - }, - "eslint-utils": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", - "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", - "dev": true, - "requires": { - "eslint-visitor-keys": "^2.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", - "dev": true - } - } - }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "node_modules/yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + } + }, + "dependencies": { + "@eslint/eslintrc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.4.1.tgz", + "integrity": "sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.4.0", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" + } + }, + "@faker-js/faker": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@faker-js/faker/-/faker-7.6.0.tgz", + "integrity": "sha512-XK6BTq1NDMo9Xqw/YkYyGjSsg44fbNwYRx7QK2CuoQgyy+f1rrTDHoExVM5PsyXCtfl2vs2vVJ0MN0yN6LppRw==", + "dev": true + }, + "@hapi/hoek": { + "version": "9.3.0", + "resolved": "https://registry.npmjs.org/@hapi/hoek/-/hoek-9.3.0.tgz", + "integrity": "sha512-/c6rf4UJlmHlC9b5BaNvzAcFv7HZ2QHaV0D4/HNlBdvFnvQq8RI4kYdhyPCl7Xj+oWvTWQ8ujhqS53LIgAe6KQ==", + "dev": true + }, + "@hapi/topo": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/@hapi/topo/-/topo-5.1.0.tgz", + "integrity": "sha512-foQZKJig7Ob0BMAYBfcJk8d77QtOe7Wo4ox7ff1lQYoNNAb6jwcY1ncdoy2e9wQZzvNy7ODZCYJkK8kzmcAnAg==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", + "dev": true, + "requires": { + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" + } + }, + "@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", + "dev": true + }, + "@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" + } + }, + "@playwright/test": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.29.2.tgz", + "integrity": "sha512-+3/GPwOgcoF0xLz/opTnahel1/y42PdcgZ4hs+BZGIUjtmEFSXGg+nFoaH3NSmuc7a6GSFwXDJ5L7VXpqzigNg==", + "dev": true, + "requires": { + "@types/node": "*", + "playwright-core": "1.29.2" + } + }, + "@sideway/address": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/@sideway/address/-/address-4.1.4.tgz", + "integrity": "sha512-7vwq+rOHVWjyXxVlR76Agnvhy8I9rpzjosTESvmhNeXOXdZZB15Fl+TI9x1SiHZH5Jv2wTGduSxFDIaq0m3DUw==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0" + } + }, + "@sideway/formula": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/@sideway/formula/-/formula-3.0.1.tgz", + "integrity": "sha512-/poHZJJVjx3L+zVD6g9KgHfYnb443oi7wLu/XKojDviHy6HOEOA6z1Trk5aR1dGcmPenJEgb2sK2I80LeS3MIg==", + "dev": true + }, + "@sideway/pinpoint": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sideway/pinpoint/-/pinpoint-2.0.0.tgz", + "integrity": "sha512-RNiOoTPkptFtSVzQevY/yWtZwf/RxyVnPy/OcA9HBM3MlGDnBEYL5B41H0MTn0Uec8Hi+2qUtTfG2WWZBmMejQ==", + "dev": true + }, + "@types/node": { + "version": "18.13.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.13.0.tgz", + "integrity": "sha512-gC3TazRzGoOnoKAhUx+Q0t8S9Tzs74z7m0ipwGpSqQrleP14hKxP4/JUeEQcD3W1/aIpnWl8pHowI7WokuZpXg==", + "dev": true + }, + "acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", + "dev": true + }, + "acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "requires": {} + }, + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "dev": true, + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "allure-commandline": { + "version": "2.20.1", + "resolved": "https://registry.npmjs.org/allure-commandline/-/allure-commandline-2.20.1.tgz", + "integrity": "sha512-QKdPUgnS4q6V0MWsZl6miveuoIo84sR4+Olh0N2JY+UWawpxnXHqWcHUtHedOJx9vCewTi3nSkBUiuOuUmn6Dw==", + "dev": true + }, + "allure-js-commons": { + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/allure-js-commons/-/allure-js-commons-2.0.0-beta.24.tgz", + "integrity": "sha512-RrW4cBtNJY9Sr5jBNf5C+sIrEu66L6TFOf+r7pP0uJDftXPtQAJYRYAigSoHl+a2SI1xXAX6J7Pcy5dAFpQsqw==", + "dev": true, + "requires": { + "properties": "^1.2.1", + "uuid": "^8.3.0" + } + }, + "allure-playwright": { + "version": "2.0.0-beta.24", + "resolved": "https://registry.npmjs.org/allure-playwright/-/allure-playwright-2.0.0-beta.24.tgz", + "integrity": "sha512-piuek2KDooHxNJm3VNSPK8ulTD5n57/5Gj8ahMQw41YF7XM9XZaAQly9m3rTlfLZ5xn59eZxBeEybL9bZX2DgQ==", + "dev": true, + "requires": { + "allure-js-commons": "2.0.0-beta.24" + } + }, + "ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true + }, + "axios": { + "version": "0.27.2", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz", + "integrity": "sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==", + "dev": true, + "requires": { + "follow-redirects": "^1.14.9", + "form-data": "^4.0.0" + } + }, + "balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "dev": true, + "requires": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + }, + "chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "dev": true + }, + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", + "dev": true + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true + }, + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "^2.0.2" + } + }, + "escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true + }, + "eslint": { + "version": "8.32.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.32.0.tgz", + "integrity": "sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ==", + "dev": true, + "requires": { + "@eslint/eslintrc": "^1.4.1", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.1.1", + "eslint-utils": "^3.0.0", + "eslint-visitor-keys": "^3.3.0", + "espree": "^9.4.0", + "esquery": "^1.4.0", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "regexpp": "^3.2.0", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + } + }, + "eslint-plugin-playwright": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-0.12.0.tgz", + "integrity": "sha512-KXuzQjVzca5irMT/7rvzJKsVDGbQr43oQPc8i+SLEBqmfrTxlwMwRqfv9vtZqh4hpU0jmrnA/EOfwtls+5QC1w==", + "dev": true, + "requires": {} + }, + "eslint-scope": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.1.tgz", + "integrity": "sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw==", + "dev": true, + "requires": { + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + } + }, + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { "eslint-visitor-keys": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", - "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", - "dev": true - }, - "espree": { - "version": "9.4.1", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", - "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", - "dev": true, - "requires": { - "acorn": "^8.8.0", - "acorn-jsx": "^5.3.2", - "eslint-visitor-keys": "^3.3.0" - } - }, - "esquery": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", - "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", - "dev": true, - "requires": { - "estraverse": "^5.1.0" - } - }, - "esrecurse": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", - "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", - "dev": true, - "requires": { - "estraverse": "^5.2.0" - } - }, - "estraverse": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", - "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "expect-playwright": { - "version": "0.8.0", - "resolved": "https://registry.npmjs.org/expect-playwright/-/expect-playwright-0.8.0.tgz", - "integrity": "sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==", - "dev": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "dev": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "dev": true - }, - "fast-levenshtein": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true - }, - "fastq": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", - "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, - "requires": { - "reusify": "^1.0.4" - } - }, - "file-entry-cache": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", - "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", - "dev": true, - "requires": { - "flat-cache": "^3.0.4" - } - }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - } - }, - "flat-cache": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", - "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", - "dev": true, - "requires": { - "flatted": "^3.1.0", - "rimraf": "^3.0.2" - } - }, - "flatted": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", - "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", - "dev": true - }, - "follow-redirects": { - "version": "1.15.2", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", - "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", - "dev": true - }, - "form-data": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", - "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.8", - "mime-types": "^2.1.12" - } - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", - "dev": true - }, - "glob": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", - "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.1.1", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "glob-parent": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", - "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", - "dev": true, - "requires": { - "is-glob": "^4.0.3" - } - }, - "globals": { - "version": "13.20.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", - "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", - "dev": true, - "requires": { - "type-fest": "^0.20.2" - } - }, - "grapheme-splitter": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", - "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", - "dev": true - }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true - }, - "ignore": { - "version": "5.2.4", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", - "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", - "dev": true - }, - "import-fresh": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", - "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", - "dev": true, - "requires": { - "parent-module": "^1.0.0", - "resolve-from": "^4.0.0" - } - }, - "imurmurhash": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "dev": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", - "dev": true - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "dev": true - }, - "is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dev": true, - "requires": { - "is-extglob": "^2.1.1" - } - }, - "is-path-inside": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", - "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", - "dev": true - }, - "joi": { - "version": "17.7.0", - "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", - "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", - "dev": true, - "requires": { - "@hapi/hoek": "^9.0.0", - "@hapi/topo": "^5.0.0", - "@sideway/address": "^4.1.3", - "@sideway/formula": "^3.0.0", - "@sideway/pinpoint": "^2.0.0" - } - }, - "js-sdsl": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", - "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", - "dev": true - }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dev": true, - "requires": { - "argparse": "^2.0.1" - } - }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "dev": true - }, - "json-stable-stringify-without-jsonify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", - "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", - "dev": true - }, - "levn": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1", - "type-check": "~0.4.0" - } - }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dev": true, - "requires": { - "p-locate": "^5.0.0" - } - }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.merge": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", - "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", - "dev": true - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", - "dev": true - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "dev": true, - "requires": { - "mime-db": "1.52.0" - } - }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - }, - "minimist": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", - "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", - "dev": true - }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "natural-compare": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", - "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", - "dev": true - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dev": true, - "requires": { - "wrappy": "1" - } - }, - "optionator": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", - "dev": true, - "requires": { - "deep-is": "^0.1.3", - "fast-levenshtein": "^2.0.6", - "levn": "^0.4.1", - "prelude-ls": "^1.2.1", - "type-check": "^0.4.0", - "word-wrap": "^1.2.3" - } - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, - "requires": { - "yocto-queue": "^0.1.0" - } - }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dev": true, - "requires": { - "p-limit": "^3.0.2" - } - }, - "parent-module": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", - "dev": true, - "requires": { - "callsites": "^3.0.0" - } - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", - "dev": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "playwright": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.29.2.tgz", - "integrity": "sha512-hKBYJUtdmYzcjdhYDkP9WGtORwwZBBKAW8+Lz7sr0ZMxtJr04ASXVzH5eBWtDkdb0c3LLFsehfPBTRfvlfKJOA==", - "dev": true, - "requires": { - "playwright-core": "1.29.2" - } - }, - "playwright-core": { - "version": "1.29.2", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.29.2.tgz", - "integrity": "sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==", - "dev": true - }, - "prelude-ls": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", - "dev": true - }, - "properties": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", - "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", - "dev": true - }, - "punycode": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", - "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", - "dev": true - }, - "queue-microtask": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", - "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true - }, - "regexpp": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", - "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", - "dev": true - }, - "resolve-from": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", - "dev": true - }, - "reusify": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", - "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "dev": true, - "requires": { - "glob": "^7.1.3" - } - }, - "run-parallel": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", - "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, - "requires": { - "queue-microtask": "^1.2.2" - } - }, - "rxjs": { - "version": "7.8.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", - "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", - "dev": true, - "requires": { - "tslib": "^2.1.0" - } - }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dev": true, - "requires": { - "shebang-regex": "^3.0.0" - } - }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true - }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "text-table": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", - "dev": true - }, - "tslib": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", - "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", - "dev": true - }, - "type-check": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", - "dev": true, - "requires": { - "prelude-ls": "^1.2.1" - } - }, - "type-fest": { - "version": "0.20.2", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", - "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "dev": true, - "requires": { - "punycode": "^2.1.0" - } - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "dev": true - }, - "wait-on": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", - "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", - "dev": true, - "requires": { - "axios": "^0.27.2", - "joi": "^17.7.0", - "lodash": "^4.17.21", - "minimist": "^1.2.7", - "rxjs": "^7.8.0" - } - }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - }, - "word-wrap": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", - "dev": true - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true } + } + }, + "eslint-visitor-keys": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz", + "integrity": "sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA==", + "dev": true + }, + "espree": { + "version": "9.4.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.4.1.tgz", + "integrity": "sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg==", + "dev": true, + "requires": { + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.3.0" + } + }, + "esquery": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.4.0.tgz", + "integrity": "sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w==", + "dev": true, + "requires": { + "estraverse": "^5.1.0" + } + }, + "esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "requires": { + "estraverse": "^5.2.0" + } + }, + "estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true + }, + "esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "dev": true + }, + "expect-playwright": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/expect-playwright/-/expect-playwright-0.8.0.tgz", + "integrity": "sha512-+kn8561vHAY+dt+0gMqqj1oY+g5xWrsuGMk4QGxotT2WS545nVqqjs37z6hrYfIuucwqthzwJfCJUEYqixyljg==", + "dev": true + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true + }, + "fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", + "dev": true, + "requires": { + "reusify": "^1.0.4" + } + }, + "file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", + "dev": true, + "requires": { + "flat-cache": "^3.0.4" + } + }, + "find-up": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", + "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "dev": true, + "requires": { + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" + } + }, + "flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", + "dev": true, + "requires": { + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + } + }, + "flatted": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", + "dev": true + }, + "follow-redirects": { + "version": "1.15.2", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.2.tgz", + "integrity": "sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==", + "dev": true + }, + "form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + } + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true + }, + "glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, + "requires": { + "is-glob": "^4.0.3" + } + }, + "globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", + "dev": true, + "requires": { + "type-fest": "^0.20.2" + } + }, + "grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true + }, + "import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "dev": true, + "requires": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "dev": true + }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "dev": true + }, + "is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true + }, + "joi": { + "version": "17.7.0", + "resolved": "https://registry.npmjs.org/joi/-/joi-17.7.0.tgz", + "integrity": "sha512-1/ugc8djfn93rTE3WRKdCzGGt/EtiYKxITMO4Wiv6q5JL1gl9ePt4kBsl1S499nbosspfctIQTpYIhSmHA3WAg==", + "dev": true, + "requires": { + "@hapi/hoek": "^9.0.0", + "@hapi/topo": "^5.0.0", + "@sideway/address": "^4.1.3", + "@sideway/formula": "^3.0.0", + "@sideway/pinpoint": "^2.0.0" + } + }, + "js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "dev": true + }, + "js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "dev": true, + "requires": { + "argparse": "^2.0.1" + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" + } + }, + "locate-path": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", + "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "dev": true, + "requires": { + "p-locate": "^5.0.0" + } + }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true + }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true + }, + "mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "requires": { + "mime-db": "1.52.0" + } + }, + "minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "dev": true, + "requires": { + "brace-expansion": "^1.1.7" + } + }, + "minimist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.7.tgz", + "integrity": "sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", + "dev": true + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "requires": { + "wrappy": "1" + } + }, + "optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "requires": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + } + }, + "p-limit": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", + "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "dev": true, + "requires": { + "yocto-queue": "^0.1.0" + } + }, + "p-locate": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", + "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "dev": true, + "requires": { + "p-limit": "^3.0.2" + } + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + } + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true + }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true + }, + "playwright": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.29.2.tgz", + "integrity": "sha512-hKBYJUtdmYzcjdhYDkP9WGtORwwZBBKAW8+Lz7sr0ZMxtJr04ASXVzH5eBWtDkdb0c3LLFsehfPBTRfvlfKJOA==", + "dev": true, + "requires": { + "playwright-core": "1.29.2" + } + }, + "playwright-core": { + "version": "1.29.2", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.29.2.tgz", + "integrity": "sha512-94QXm4PMgFoHAhlCuoWyaBYKb92yOcGVHdQLoxQ7Wjlc7Flg4aC/jbFW7xMR52OfXMVkWicue4WXE7QEegbIRA==", + "dev": true + }, + "prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", + "dev": true + }, + "properties": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/properties/-/properties-1.2.1.tgz", + "integrity": "sha512-qYNxyMj1JeW54i/EWEFsM1cVwxJbtgPp8+0Wg9XjNaK6VE/c4oRi6PNu5p7w1mNXEIQIjV5Wwn8v8Gz82/QzdQ==", + "dev": true + }, + "punycode": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.0.tgz", + "integrity": "sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA==", + "dev": true + }, + "queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true + }, + "regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true + }, + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, + "rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "dev": true, + "requires": { + "glob": "^7.1.3" + } + }, + "run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", + "dev": true, + "requires": { + "queue-microtask": "^1.2.2" + } + }, + "rxjs": { + "version": "7.8.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.0.tgz", + "integrity": "sha512-F2+gxDshqmIub1KdvZkaEfGDwLNpPvk9Fs6LD/MyQxNgMds/WH9OdDDXOmxUZpME+iSK3rQCctkL0DYyytUqMg==", + "dev": true, + "requires": { + "tslib": "^2.1.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.1" + } + }, + "strip-json-comments": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true + }, + "tslib": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.5.0.tgz", + "integrity": "sha512-336iVw3rtn2BUK7ORdIAHTyxHGRIHVReokCR3XjbckJMK7ms8FysBfhLR8IXnAgy7T0PTPNBWKiH514FOW/WSg==", + "dev": true + }, + "type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "requires": { + "prelude-ls": "^1.2.1" + } + }, + "type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", + "dev": true + }, + "uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true + }, + "wait-on": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/wait-on/-/wait-on-7.0.1.tgz", + "integrity": "sha512-9AnJE9qTjRQOlTZIldAaf/da2eW0eSRSgcqq85mXQja/DW3MriHxkpODDSUEg+Gri/rKEcXUZHe+cevvYItaog==", + "dev": true, + "requires": { + "axios": "^0.27.2", + "joi": "^17.7.0", + "lodash": "^4.17.21", + "minimist": "^1.2.7", + "rxjs": "^7.8.0" + } + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + }, + "word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "dev": true + }, + "wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true + }, + "yocto-queue": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", + "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", + "dev": true } + } } From a1200bf22e2270c9564d46a87d806455c2f2a0bb Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Fri, 11 Aug 2023 10:44:24 -0300 Subject: [PATCH 31/83] feat: compatibilization with bundle js (#217) --- view/frontend/web/js/core/checkout/Bin.js | 113 +- .../web/js/core/checkout/CreditCardToken.js | 68 +- .../web/js/core/checkout/FormObject.js | 448 +++++ .../web/js/core/checkout/Installments.js | 18 - .../core/checkout/PaymentMethodController.js | 1442 ++++++++--------- .../core/checkout/PaymentModuleBootstrap.js | 104 +- .../web/js/core/checkout/PlatformConfig.js | 163 ++ .../js/core/checkout/PlatformFormBiding.js | 597 ------- .../js/core/checkout/PlatformFormHandler.js | 399 +++-- .../js/core/checkout/PlatformPlaceOrder.js | 27 +- .../js/core/models/BoletoCreditcardModel.js | 375 ++--- .../web/js/core/models/BoletoModel.js | 120 +- .../web/js/core/models/CreditCardModel.js | 235 ++- .../frontend/web/js/core/models/DebitModel.js | 235 ++- view/frontend/web/js/core/models/PixModel.js | 118 +- .../web/js/core/models/TwoCreditcardsModel.js | 406 ++--- .../web/js/core/models/VoucherModel.js | 278 ++-- .../js/core/validators/CreditCardValidator.js | 279 ++-- .../js/core/validators/CustomerValidator.js | 52 +- .../js/core/validators/MultibuyerValidator.js | 123 +- .../core/validators/VoucherCardValidator.js | 109 +- view/frontend/web/js/view/payment/boleto.js | 5 +- .../web/js/view/payment/boletocreditcard.js | 2 +- .../web/js/view/payment/creditcard.js | 2 +- view/frontend/web/js/view/payment/debit.js | 2 +- view/frontend/web/js/view/payment/default.js | 21 +- view/frontend/web/js/view/payment/pix.js | 5 +- .../web/js/view/payment/twocreditcards.js | 5 +- view/frontend/web/js/view/payment/voucher.js | 2 +- 29 files changed, 2870 insertions(+), 2883 deletions(-) create mode 100644 view/frontend/web/js/core/checkout/FormObject.js delete mode 100644 view/frontend/web/js/core/checkout/Installments.js create mode 100644 view/frontend/web/js/core/checkout/PlatformConfig.js delete mode 100644 view/frontend/web/js/core/checkout/PlatformFormBiding.js diff --git a/view/frontend/web/js/core/checkout/Bin.js b/view/frontend/web/js/core/checkout/Bin.js index 5a36f257..65925f5b 100644 --- a/view/frontend/web/js/core/checkout/Bin.js +++ b/view/frontend/web/js/core/checkout/Bin.js @@ -1,65 +1,64 @@ -var Bin = function () { - binValue = '', - brand = '', - checkedBins = [0] - selectedBrand = '' -}; +define(['jquery'], ($) => { + return class Bin { + constructor() { + this.binValue = ''; + this.brand = ''; + this.checkedBins = [0]; + this.selectedBrand = ''; + } + init(newValue) { -Bin.prototype.init = function (newValue) { + const formattedNewValue = this.formatNumber(newValue); - var newValue = this.formatNumber(newValue); + if ( + typeof this.checkedBins != 'undefined' && + typeof this.checkedBins[formattedNewValue] != 'undefined' + ){ + this.binValue = formattedNewValue; + this.selectedBrand = this.checkedBins[formattedNewValue]; + return; + } - if ( - typeof this.checkedBins != 'undefined' && - typeof this.checkedBins[newValue] != 'undefined' - ){ - this.binValue = newValue; - this.selectedBrand = this.checkedBins[newValue]; - return; - } + if (this.validate(formattedNewValue)) { + this.binValue = formattedNewValue; + this.getBrand().done(function (data) { + this.saveBinInformation(data); + }.bind(this)); - if (this.validate(newValue)) { - this.binValue = newValue; - this.getBrand().done(function (data) { - this.saveBinInformation(data); - }.bind(this)); + return; + } - return; - } + this.selectedBrand = ''; + } + formatNumber(number) { + const newValue = String(number); + return newValue.slice(0, 6); + } + validate(newValue) { + if (newValue.length == 6 && this.binValue != newValue) { + return true; + } - this.selectedBrand = ''; -}; + return false; + } + getBrand() { + const bin = this.binValue.slice(0, 6); -Bin.prototype.formatNumber = function (number) { - var newValue = String(number); - return newValue.slice(0, 6); -}; + return $.ajax({ + type: 'GET', + dataType: 'json', + url: 'https://api.mundipagg.com/bin/v1/' + bin, + async: false, + cache: true, + }); + } + saveBinInformation(data) { + if (typeof this.checkedBins == 'undefined') { + this.checkedBins = []; + } -Bin.prototype.validate = function (newValue) { - if (newValue.length == 6 && this.binValue != newValue) { - return true; - } - - return false; -}; - -Bin.prototype.getBrand = function () { - var bin = this.binValue.slice(0, 6); - - return jQuery.ajax({ - type: 'GET', - dataType: 'json', - url: 'https://api.mundipagg.com/bin/v1/' + bin, - async: false, - cache: true, - }); -}; - -Bin.prototype.saveBinInformation = function (data) { - if (typeof this.checkedBins == 'undefined') { - this.checkedBins = []; - } - - this.checkedBins[this.binValue] = data.brand; - this.selectedBrand = data.brand; -}; \ No newline at end of file + this.checkedBins[this.binValue] = data.brand; + this.selectedBrand = data.brand; + } + }; +}); diff --git a/view/frontend/web/js/core/checkout/CreditCardToken.js b/view/frontend/web/js/core/checkout/CreditCardToken.js index fa6faed7..9169724b 100644 --- a/view/frontend/web/js/core/checkout/CreditCardToken.js +++ b/view/frontend/web/js/core/checkout/CreditCardToken.js @@ -1,36 +1,38 @@ -var CreditCardToken = function (formObject, documentNumber = null) { - this.documentNumber = documentNumber; - if (documentNumber != null) { - this.documentNumber = documentNumber.replace(/(\.|\/|\-)/g,""); - } - this.formObject = formObject; -}; - -CreditCardToken.prototype.getDataToGenerateToken = function () { - return { - type: "card", - card : { - holder_name: this.formObject.creditCardHolderName.val(), - number: this.formObject.creditCardNumber.val(), - exp_month: this.formObject.creditCardExpMonth.val(), - exp_year: this.formObject.creditCardExpYear.val(), - cvv: this.formObject.creditCardCvv.val(), - holder_document: this.documentNumber +define([], () => { + return class CreditCardToken { + constructor(formObject, documentNumber = null) { + this.documentNumber = documentNumber; + if (documentNumber != null) { + this.documentNumber = documentNumber.replace(/(\.|\/|\-)/g,""); + } + this.formObject = formObject; } - }; -} - -CreditCardToken.prototype.getToken = function (pkKey) { - var data = this.getDataToGenerateToken(); + getDataToGenerateToken() { + return { + type: "card", + card : { + holder_name: this.formObject.creditCardHolderName.val(), + number: this.formObject.creditCardNumber.val(), + exp_month: this.formObject.creditCardExpMonth.val(), + exp_year: this.formObject.creditCardExpYear.val(), + cvv: this.formObject.creditCardCvv.val(), + holder_document: this.documentNumber + } + }; + } + getToken(pkKey) { + const data = this.getDataToGenerateToken(); - const url = 'https://api.mundipagg.com/core/v1/tokens?appId='; + const url = 'https://api.mundipagg.com/core/v1/tokens?appId='; - return jQuery.ajax({ - type: 'POST', - dataType: 'json', - url: url + pkKey, - async: false, - cache: true, - data - }); -} + return jQuery.ajax({ + type: 'POST', + dataType: 'json', + url: url + pkKey, + async: false, + cache: true, + data + }); + } + } +}); diff --git a/view/frontend/web/js/core/checkout/FormObject.js b/view/frontend/web/js/core/checkout/FormObject.js new file mode 100644 index 00000000..4666a514 --- /dev/null +++ b/view/frontend/web/js/core/checkout/FormObject.js @@ -0,0 +1,448 @@ +define(['jquery'], ($) => { + const FormObject = { + FormObject: {} + }; + + FormObject.creditCardInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = '#pagarme_creditcard-form'; + + if (typeof $(containerSelector).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const creditCardForm = { + 'containerSelector' : containerSelector, + "creditCardNumber" : $(containerSelector + " .cc_number"), + "creditCardHolderName" : $(containerSelector + " .cc_owner"), + "creditCardExpMonth" : $(containerSelector + " .cc_exp_month"), + "creditCardExpYear" : $(containerSelector + " .cc_exp_year"), + "creditCardCvv" : $(containerSelector + " .cc_cid"), + "creditCardInstallments" : $(containerSelector + " .cc_installments"), + "creditCardBrand" : $(containerSelector + " .cc_type"), + "creditCardToken" : $(containerSelector + " .cc_token"), + "inputAmount" : $(containerSelector + " .cc_amount"), + "inputAmountContainer" : $(containerSelector + " .amount-container"), + "savedCreditCardSelect" : $(containerSelector + " .cc_saved_creditcards"), + "saveThisCard" : $(containerSelector + " .save_this_card") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = { + "showMultibuyer" : $(containerSelector + " .show_multibuyer"), + "firstname" : $(containerSelector + " .multibuyer_firstname"), + "lastname" : $(containerSelector + " .multibuyer_lastname"), + "email" : $(containerSelector + " .multibuyer_email"), + "zipcode" : $(containerSelector + " .multibuyer_zipcode"), + "document" : $(containerSelector + " .multibuyer_document"), + "street" : $(containerSelector + " .multibuyer_street"), + "number" : $(containerSelector + " .multibuyer_number"), + "complement" : $(containerSelector + " .multibuyer_complement"), + "neighborhood" : $(containerSelector + " .multibuyer_neighborhood"), + "city" : $(containerSelector + " .multibuyer_city"), + "state" : $(containerSelector + " .multibuyer_state"), + "homePhone" : $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone" : $(containerSelector + " .multibuyer_mobile_phone") + } + } + + FormObject.FormObject = creditCardForm; + FormObject.FormObject.numberOfPaymentForms = 1; + FormObject.FormObject.multibuyer = multibuyerForm; + FormObject.FormObject.savedCardSelectUsed = 'pagarme_creditcard'; + + return FormObject.FormObject; + }; + + FormObject.voucherInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = '#pagarme_voucher-form'; + + if (typeof $(containerSelector).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const voucherForm = { + 'containerSelector' : containerSelector, + "creditCardNumber" : $(containerSelector + " .cc_number"), + "creditCardHolderName" : $(containerSelector + " .cc_owner"), + "creditCardExpMonth" : $(containerSelector + " .cc_exp_month"), + "creditCardExpYear" : $(containerSelector + " .cc_exp_year"), + "creditCardCvv" : $(containerSelector + " .cc_cid"), + "creditCardInstallments" : $(containerSelector + " .cc_installments"), + "creditCardBrand" : $(containerSelector + " .cc_type"), + "creditCardToken" : $(containerSelector + " .cc_token"), + "inputAmount" : $(containerSelector + " .cc_amount"), + "savedCreditCardSelect" : $(containerSelector + " .cc_saved_creditcards"), + "saveThisCard" : $(containerSelector + " .save_this_card") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = { + "showMultibuyer" : $(containerSelector + " .show_multibuyer"), + "firstname" : $(containerSelector + " .multibuyer_firstname"), + "lastname" : $(containerSelector + " .multibuyer_lastname"), + "email" : $(containerSelector + " .multibuyer_email"), + "zipcode" : $(containerSelector + " .multibuyer_zipcode"), + "document" : $(containerSelector + " .multibuyer_document"), + "street" : $(containerSelector + " .multibuyer_street"), + "number" : $(containerSelector + " .multibuyer_number"), + "complement" : $(containerSelector + " .multibuyer_complement"), + "neighborhood" : $(containerSelector + " .multibuyer_neighborhood"), + "city" : $(containerSelector + " .multibuyer_city"), + "state" : $(containerSelector + " .multibuyer_state"), + "homePhone" : $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone" : $(containerSelector + " .multibuyer_mobile_phone") + } + } + + FormObject.FormObject = voucherForm; + FormObject.FormObject.numberOfPaymentForms = 1; + FormObject.FormObject.multibuyer = multibuyerForm; + FormObject.FormObject.savedCardSelectUsed = 'pagarme_voucher'; + + return FormObject.FormObject; + }; + + FormObject.getMultibuyerForm = (containerSelector) => { + return { + "showMultibuyer" : $(containerSelector + " .show_multibuyer"), + "firstname" : $(containerSelector + " .multibuyer_firstname"), + "lastname" : $(containerSelector + " .multibuyer_lastname"), + "email" : $(containerSelector + " .multibuyer_email"), + "zipcode" : $(containerSelector + " .multibuyer_zipcode"), + "document" : $(containerSelector + " .multibuyer_document"), + "street" : $(containerSelector + " .multibuyer_street"), + "number" : $(containerSelector + " .multibuyer_number"), + "complement" : $(containerSelector + " .multibuyer_complement"), + "neighborhood" : $(containerSelector + " .multibuyer_neighborhood"), + "city" : $(containerSelector + " .multibuyer_city"), + "state" : $(containerSelector + " .multibuyer_state"), + "homePhone" : $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone" : $(containerSelector + " .multibuyer_mobile_phone") + } + }; + + FormObject.debitInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = '#pagarme_debit-form'; + + if (typeof $(containerSelector).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const debitForm = { + 'containerSelector' : containerSelector, + "creditCardNumber" : $(containerSelector + " .cc_number"), + "creditCardHolderName" : $(containerSelector + " .cc_owner"), + "creditCardExpMonth" : $(containerSelector + " .cc_exp_month"), + "creditCardExpYear" : $(containerSelector + " .cc_exp_year"), + "creditCardCvv" : $(containerSelector + " .cc_cid"), + "creditCardInstallments" : $(containerSelector + " .cc_installments"), + "creditCardBrand" : $(containerSelector + " .cc_type"), + "creditCardToken" : $(containerSelector + " .cc_token"), + "inputAmount" : $(containerSelector + " .cc_amount"), + "savedCreditCardSelect" : $(containerSelector + " .cc_saved_creditcards"), + "saveThisCard" : $(containerSelector + " .save_this_card") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = FormObject.getMultibuyerForm(containerSelector) + } + + FormObject.FormObject = debitForm; + FormObject.FormObject.numberOfPaymentForms = 1; + FormObject.FormObject.multibuyer = multibuyerForm; + FormObject.FormObject.savedCardSelectUsed = 'pagarme_debit'; + + return FormObject.FormObject; + }; + + FormObject.renameTwoCreditCardsElements = (elements, elementId) => { + const twoCreditCardForm = {}; + + for (let key in elements) { + + const name = elements[key].attr('name'); + + if (name === undefined) { + continue; + } + + let newName = name + '[' + elementId + ']'; + + if (name.match(/\[\d\]/g)) { + newName = name; + } + + elements[key].attr('name', newName); + let elementType = 'input'; + + if (elements[key].is('select')) { + elementType = 'select'; + } + + twoCreditCardForm[key] = $( + elementType + + "[name='" + + newName + + "']" + ); + } + + return twoCreditCardForm; + }; + + FormObject.fillTwoCreditCardsElements = (containerSelector, elementId, isMultibuyerEnabled) => { + + if ($(containerSelector).children().length == 0) { + return; + } + + const elements = { + "creditCardNumber" : $(containerSelector + " .cc_number"), + "creditCardHolderName" : $(containerSelector + " .cc_owner"), + "creditCardExpMonth" : $(containerSelector + " .cc_exp_month"), + "creditCardExpYear" : $(containerSelector + " .cc_exp_year"), + "creditCardCvv" : $(containerSelector + " .cc_cid"), + "creditCardInstallments" : $(containerSelector + " .cc_installments"), + "creditCardBrand" : $(containerSelector + " .cc_type"), + "creditCardToken" : $(containerSelector + " .cc_token"), + "inputAmount" : $(containerSelector + " .cc_amount"), + "inputAmountContainer" : $(containerSelector + " .amount-container"), + "savedCreditCardSelect" : $(containerSelector + " .cc_saved_creditcards"), + "saveThisCard" : $(containerSelector + " .save_this_card") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = { + "showMultibuyer" : $(containerSelector + " .show_multibuyer"), + "firstname" : $(containerSelector + " .multibuyer_firstname"), + "lastname" : $(containerSelector + " .multibuyer_lastname"), + "email" : $(containerSelector + " .multibuyer_email"), + "zipcode" : $(containerSelector + " .multibuyer_zipcode"), + "document" : $(containerSelector + " .multibuyer_document"), + "street" : $(containerSelector + " .multibuyer_street"), + "number" : $(containerSelector + " .multibuyer_number"), + "complement" : $(containerSelector + " .multibuyer_complement"), + "neighborhood" : $(containerSelector + " .multibuyer_neighborhood"), + "city" : $(containerSelector + " .multibuyer_city"), + "state" : $(containerSelector + " .multibuyer_state"), + "homePhone" : $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone" : $(containerSelector + " .multibuyer_mobile_phone") + } + } + + FormObject.FormObject[elementId] = + FormObject.renameTwoCreditCardsElements( + elements, + elementId + ); + + FormObject.FormObject[elementId].multibuyer = + FormObject.renameTwoCreditCardsElements( + multibuyerForm, + elementId + ); + + FormObject.FormObject[elementId].containerSelector = containerSelector; + FormObject.FormObject[elementId].savedCardSelectUsed = 'pagarme_two_creditcard'; + + return FormObject.FormObject; + }; + + FormObject.twoCreditCardsInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = []; + containerSelector.push("#pagarme_two_creditcard-form #two-credit-cards-form-0"); + containerSelector.push("#pagarme_two_creditcard-form #two-credit-cards-form-1"); + + + if (typeof $(containerSelector[0]).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + //Using for for IE compatibility + for (let i = 0, len = containerSelector.length; i < len; i++) { + FormObject.fillTwoCreditCardsElements(containerSelector[i], i, isMultibuyerEnabled); + } + + FormObject.FormObject.numberOfPaymentForms = 2; + + return FormObject.FormObject; + }; + + FormObject.pixInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = '#pagarme_pix-form'; + + if (typeof $(containerSelector).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const pixElements = { + 'containerSelector' : containerSelector, + "inputAmount" : $(containerSelector + " .cc_amount"), + "inputAmountContainer" : $(containerSelector + " .amount-container") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = { + "showMultibuyer": $(containerSelector + " .show_multibuyer"), + "firstname": $(containerSelector + " .multibuyer_firstname"), + "lastname": $(containerSelector + " .multibuyer_lastname"), + "email": $(containerSelector + " .multibuyer_email"), + "zipcode": $(containerSelector + " .multibuyer_zipcode"), + "document": $(containerSelector + " .multibuyer_document"), + "street": $(containerSelector + " .multibuyer_street"), + "number": $(containerSelector + " .multibuyer_number"), + "complement": $(containerSelector + " .multibuyer_complement"), + "neighborhood": $(containerSelector + " .multibuyer_neighborhood"), + "city": $(containerSelector + " .multibuyer_city"), + "state": $(containerSelector + " .multibuyer_state"), + "homePhone": $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone": $(containerSelector + " .multibuyer_mobile_phone") + } + } + + FormObject.FormObject = pixElements; + FormObject.FormObject.numberOfPaymentForms = 1; + FormObject.FormObject.multibuyer = multibuyerForm; + return FormObject.FormObject; + }; + + FormObject.boletoInit = (isMultibuyerEnabled) => { + + FormObject.FormObject = {}; + + const containerSelector = '#pagarme_billet-form'; + + if (typeof $(containerSelector).html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const boletoElements = { + 'containerSelector' : containerSelector, + "inputAmount" : $(containerSelector + " .cc_amount"), + "inputAmountContainer" : $(containerSelector + " .amount-container") + }; + + let multibuyerForm = undefined; + if (isMultibuyerEnabled) { + multibuyerForm = { + "showMultibuyer": $(containerSelector + " .show_multibuyer"), + "firstname": $(containerSelector + " .multibuyer_firstname"), + "lastname": $(containerSelector + " .multibuyer_lastname"), + "email": $(containerSelector + " .multibuyer_email"), + "zipcode": $(containerSelector + " .multibuyer_zipcode"), + "document": $(containerSelector + " .multibuyer_document"), + "street": $(containerSelector + " .multibuyer_street"), + "number": $(containerSelector + " .multibuyer_number"), + "complement": $(containerSelector + " .multibuyer_complement"), + "neighborhood": $(containerSelector + " .multibuyer_neighborhood"), + "city": $(containerSelector + " .multibuyer_city"), + "state": $(containerSelector + " .multibuyer_state"), + "homePhone": $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone": $(containerSelector + " .multibuyer_mobile_phone") + } + } + + FormObject.FormObject = boletoElements; + FormObject.FormObject.numberOfPaymentForms = 1; + FormObject.FormObject.multibuyer = multibuyerForm; + return FormObject.FormObject; + }; + + FormObject.fillBoletoCreditCardElements = (containerSelector, elementId, isMultibuyerEnabled) => { + if (isMultibuyerEnabled) { + const multibuyerForm = { + "showMultibuyer" : $(containerSelector + " .show_multibuyer"), + "firstname" : $(containerSelector + " .multibuyer_firstname"), + "lastname" : $(containerSelector + " .multibuyer_lastname"), + "email" : $(containerSelector + " .multibuyer_email"), + "zipcode" : $(containerSelector + " .multibuyer_zipcode"), + "document" : $(containerSelector + " .multibuyer_document"), + "street" : $(containerSelector + " .multibuyer_street"), + "number" : $(containerSelector + " .multibuyer_number"), + "complement" : $(containerSelector + " .multibuyer_complement"), + "neighborhood" : $(containerSelector + " .multibuyer_neighborhood"), + "city" : $(containerSelector + " .multibuyer_city"), + "state" : $(containerSelector + " .multibuyer_state"), + "homePhone" : $(containerSelector + " .multibuyer_home_phone"), + "mobilePhone" : $(containerSelector + " .multibuyer_mobile_phone") + } + + FormObject.FormObject[elementId].multibuyer = multibuyerForm; + } + return FormObject.FormObject; + } + + FormObject.boletoCreditCardInit = (isMultibuyerEnabled) => { + const containerBoletoSelector = "#pagarme_billet_creditcard-form #billet-form"; + const containerCreditCardSelector = "#pagarme_billet_creditcard-form #credit-card-form"; + + FormObject.FormObject = {}; + + if (typeof $(containerCreditCardSelector + " .cc_installments").html() == 'undefined') { + FormObject.FormObject = null; + return; + } + + const boletoElements = { + 'containerSelector' : containerBoletoSelector, + "inputAmount" : $(containerBoletoSelector + " .cc_amount"), + "inputAmountContainer" : $(containerBoletoSelector + " .amount-container"), + }; + + const cardsElements = { + 'containerSelector' : containerCreditCardSelector, + "creditCardNumber" : $(containerCreditCardSelector + " .cc_number"), + "creditCardHolderName" : $(containerCreditCardSelector + " .cc_owner"), + "creditCardExpMonth" : $(containerCreditCardSelector + " .cc_exp_month"), + "creditCardExpYear" : $(containerCreditCardSelector + " .cc_exp_year"), + "creditCardCvv" : $(containerCreditCardSelector + " .cc_cid"), + "creditCardInstallments" : $(containerCreditCardSelector + " .cc_installments"), + "creditCardBrand" : $(containerCreditCardSelector + " .cc_type"), + "creditCardToken" : $(containerCreditCardSelector + " .cc_token"), + "inputAmount" : $(containerCreditCardSelector + " .cc_amount"), + "inputAmountContainer" : $(containerCreditCardSelector + " .amount-container"), + "savedCreditCardSelect" : $(containerCreditCardSelector + " .cc_saved_creditcards"), + "saveThisCard" : $(containerCreditCardSelector + " .save_this_card") + }; + + FormObject.FormObject[0] = boletoElements; + FormObject.FormObject[1] = cardsElements; + + for (let i = 0, len = 2; i < len; i++) { + FormObject.fillBoletoCreditCardElements(FormObject.FormObject[i].containerSelector, i, isMultibuyerEnabled); + } + + FormObject.FormObject.numberOfPaymentForms = 2; + FormObject.FormObject[1].savedCardSelectUsed = 'pagarme_billet_creditcard'; + + return FormObject.FormObject; + }; + + return FormObject; +}) diff --git a/view/frontend/web/js/core/checkout/Installments.js b/view/frontend/web/js/core/checkout/Installments.js deleted file mode 100644 index 4743945d..00000000 --- a/view/frontend/web/js/core/checkout/Installments.js +++ /dev/null @@ -1,18 +0,0 @@ -var Installments = function () { -} - -Installments.prototype.init = function () { -}; - -Installments.prototype.addOptions = function (element, installments) { - - if (installments != undefined) { - jQuery(element).find('option').remove(); - - installments.forEach(function (value) { - opt = new Option(value.label, value.id); - jQuery(opt).attr("interest", value.interest); - jQuery(element).append(opt); - }); - } -} diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index de75cb2d..1b302c7d 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -1,928 +1,920 @@ -var PaymentMethodController = function (methodCode, platformConfig) { - this.methodCode = methodCode; - this.platformConfig = platformConfig; -}; - -PaymentMethodController.prototype.init = function () { - var paymentMethodInit = this.methodCode + 'Init'; - this[paymentMethodInit](); -}; - -PaymentMethodController.prototype.formObject = function (formObject) { - this.formObject = formObject -}; - -PaymentMethodController.prototype.formValidation = function () { - formValidation = this.methodCode + 'Validation'; - - return this[formValidation](); -}; - -PaymentMethodController.prototype.creditcardInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.creditCardInit(this.platformConfig.isMultibuyerEnabled); - - if (!this.formObject) { - return; - } - - this.model = new CreditCardModel( - this.formObject, - this.platformConfig.publicKey - ); - - this.fillCardAmount(this.formObject, 1); - this.hideCardAmount(this.formObject); - this.fillFormText(this.formObject, 'pagarme_creditcard'); - this.fillSavedCreditCardsSelect(this.formObject); - this.fillBrandList(this.formObject, 'pagarme_creditcard'); - this.fillInstallments(this.formObject); +define([ + 'jquery', + 'Pagarme_Pagarme/js/core/checkout/PlatformConfig', + 'Pagarme_Pagarme/js/core/checkout/FormObject', + 'Pagarme_Pagarme/js/core/checkout/PlatformFormHandler', + 'Pagarme_Pagarme/js/core/checkout/Bin', + 'Pagarme_Pagarme/js/core/models/CreditCardModel', + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', + 'Pagarme_Pagarme/js/core/models/VoucherModel', + 'Pagarme_Pagarme/js/core/models/DebitModel', + 'Pagarme_Pagarme/js/core/models/TwoCreditcardsModel', + 'Pagarme_Pagarme/js/core/models/PixModel', + 'Pagarme_Pagarme/js/core/models/BoletoModel', + 'Pagarme_Pagarme/js/core/models/BoletoCreditcardModel', + 'Pagarme_Pagarme/js/core/validators/CustomerValidator', +], ( + $, + PlatformConfig, + FormObject, + FormHandler, + Bin, + CreditCardModel, + CreditCardToken, + VoucherModel, + DebitModel, + TwoCreditcardsModel, + PixModel, + BoletoModel, + BoletoCreditcardModel, + CustomerValidator, +) => { + + const fieldError = '.field-error'; + const errorClass = '_error'; + return class PaymentMethodController { + constructor(methodCode, platformConfig) { + this.methodCode = methodCode; + this.platformConfig = platformConfig; + } - if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject); - } + init() { + const paymentMethodInit = this.methodCode + 'Init'; + this[paymentMethodInit](); + } - if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject); - this.addShowMultibuyerListener(this.formObject); - } + formObject(formObject) { + this.formObject = formObject + } - this.addCreditCardListeners(this.formObject); - this.modelToken = new CreditCardToken(this.formObject); -}; + formValidation() { + const formValidation = this.methodCode + 'Validation'; -PaymentMethodController.prototype.voucherInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.voucherInit(this.platformConfig.isMultibuyerEnabled); + return this[formValidation](); + } - if (!this.formObject) { - return; - } + creditcardInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.creditCardInit(this.platformConfig.isMultibuyerEnabled); - this.model = new VoucherModel( - this.formObject, - this.platformConfig.publicKey - ); - - this.fillCardAmount(this.formObject, 1); - this.hideCardAmount(this.formObject); - this.fillFormText(this.formObject, 'pagarme_voucher'); - this.fillBrandList(this.formObject, "pagarme_voucher"); - this.removeInstallmentsSelect(this.formObject); - this.fillSavedCreditCardsSelect(this.formObject); - this.showCvvCard(this.formObject); - - if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject); - } + if (!this.formObject) { + return; + } - if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject); - this.addShowMultibuyerListener(this.formObject); - } + this.model = new CreditCardModel( + this.formObject, + this.platformConfig.publicKey + ); - this.addCreditCardListeners(this.formObject); - this.modelToken = new CreditCardToken(this.formObject); -}; + this.fillCardAmount(this.formObject, 1); + this.hideCardAmount(this.formObject); + this.fillFormText(this.formObject, 'pagarme_creditcard'); + this.fillSavedCreditCardsSelect(this.formObject); + this.fillBrandList(this.formObject, 'pagarme_creditcard'); + this.fillInstallments(this.formObject); -PaymentMethodController.prototype.debitInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.debitInit(this.platformConfig.isMultibuyerEnabled); + if (!this.platformConfig.isMultibuyerEnabled) { + this.removeMultibuyerForm(this.formObject); + } - if (!this.formObject) { - return; - } + if (this.platformConfig.isMultibuyerEnabled) { + this.fillMultibuyerStateSelect(this.formObject); + this.addShowMultibuyerListener(this.formObject); + } - this.model = new DebitModel( - this.formObject, - this.platformConfig.publicKey - ); + this.addCreditCardListeners(this.formObject); + this.modelToken = new CreditCardToken(this.formObject); + } - this.fillCardAmount(this.formObject, 1); - this.hideCardAmount(this.formObject); - this.fillFormText(this.formObject, 'pagarme_debit'); - this.fillBrandList(this.formObject, "pagarme_debit"); - this.removeInstallmentsSelect(this.formObject); - this.fillSavedCreditCardsSelect(this.formObject); + voucherInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.voucherInit(this.platformConfig.isMultibuyerEnabled); - if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject); - } + if (!this.formObject) { + return; + } - if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject); - this.addShowMultibuyerListener(this.formObject); - } + this.model = new VoucherModel( + this.formObject, + this.platformConfig.publicKey + ); - this.addCreditCardListeners(this.formObject); - this.modelToken = new CreditCardToken(this.formObject); -} + this.fillCardAmount(this.formObject, 1); + this.hideCardAmount(this.formObject); + this.fillFormText(this.formObject, 'pagarme_voucher'); + this.fillBrandList(this.formObject, "pagarme_voucher"); + this.removeInstallmentsSelect(this.formObject); + this.fillSavedCreditCardsSelect(this.formObject); + this.showCvvCard(this.formObject); -PaymentMethodController.prototype.twocreditcardsInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.twoCreditCardsInit(this.platformConfig.isMultibuyerEnabled); + if (!this.platformConfig.isMultibuyerEnabled) { + this.removeMultibuyerForm(this.formObject); + } - if (!this.formObject) { - return; - } - this.model = new TwoCreditcardsModel( - this.formObject, - this.platformConfig.publicKey - ); + if (this.platformConfig.isMultibuyerEnabled) { + this.fillMultibuyerStateSelect(this.formObject); + this.addShowMultibuyerListener(this.formObject); + } - var isTotalOnAmountInputs = this.isTotalOnAmountInputs(this.formObject, this.platformConfig); + this.addCreditCardListeners(this.formObject); + this.modelToken = new CreditCardToken(this.formObject); + } - if (typeof this.formObject[1] !== "undefined") { - for (var i = 0, len = this.formObject.numberOfPaymentForms; i < len; i++) { - this.fillFormText(this.formObject[i], 'pagarme_two_creditcard'); + debitInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.debitInit(this.platformConfig.isMultibuyerEnabled); - if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) { - this.fillCardAmount(this.formObject[i], 2, i); + if (!this.formObject) { + return; } - this.fillBrandList(this.formObject[i], 'pagarme_two_creditcard'); - this.fillSavedCreditCardsSelect(this.formObject[i]); - this.fillInstallments(this.formObject[i]); + this.model = new DebitModel( + this.formObject, + this.platformConfig.publicKey + ); + + this.fillCardAmount(this.formObject, 1); + this.hideCardAmount(this.formObject); + this.fillFormText(this.formObject, 'pagarme_debit'); + this.fillBrandList(this.formObject, "pagarme_debit"); + this.removeInstallmentsSelect(this.formObject); + this.fillSavedCreditCardsSelect(this.formObject); if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject[i]); + this.removeMultibuyerForm(this.formObject); } if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject[i]); - this.addShowMultibuyerListener(this.formObject[i]); + this.fillMultibuyerStateSelect(this.formObject); + this.addShowMultibuyerListener(this.formObject); } - this.addCreditCardListeners(this.formObject[i]); - this.addInputAmountBalanceListener(this.formObject[i], i); - + this.addCreditCardListeners(this.formObject); + this.modelToken = new CreditCardToken(this.formObject); } - } - this.modelToken = new CreditCardToken(this.formObject); -}; + twocreditcardsInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.twoCreditCardsInit(this.platformConfig.isMultibuyerEnabled); + if (!this.formObject) { + return; + } + this.model = new TwoCreditcardsModel( + this.formObject, + this.platformConfig.publicKey + ); -PaymentMethodController.prototype.pixInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.pixInit(this.platformConfig.isMultibuyerEnabled); - - if (!this.formObject) { - return; - } - - this.model = new PixModel(this.formObject); - this.hideCardAmount(this.formObject); + const isTotalOnAmountInputs = this.isTotalOnAmountInputs(this.formObject, this.platformConfig); - if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject); - } + if (typeof this.formObject[1] !== "undefined") { + for (let i = 0, len = this.formObject.numberOfPaymentForms; i < len; i++) { + this.fillFormText(this.formObject[i], 'pagarme_two_creditcard'); - if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject); - this.addShowMultibuyerListener(this.formObject); - this.addValidatorListener(this.formObject); - } -}; + if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) { + this.fillCardAmount(this.formObject[i], 2, i); + } -PaymentMethodController.prototype.boletoInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.boletoInit(this.platformConfig.isMultibuyerEnabled); + this.fillBrandList(this.formObject[i], 'pagarme_two_creditcard'); + this.fillSavedCreditCardsSelect(this.formObject[i]); + this.fillInstallments(this.formObject[i]); - if (!this.formObject) { - return; - } + if (!this.platformConfig.isMultibuyerEnabled) { + this.removeMultibuyerForm(this.formObject[i]); + } - this.model = new BoletoModel(this.formObject); - this.hideCardAmount(this.formObject); + if (this.platformConfig.isMultibuyerEnabled) { + this.fillMultibuyerStateSelect(this.formObject[i]); + this.addShowMultibuyerListener(this.formObject[i]); + } - if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject); - } + this.addCreditCardListeners(this.formObject[i]); + this.addInputAmountBalanceListener(this.formObject[i], i); - if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject); - this.addShowMultibuyerListener(this.formObject); - this.addValidatorListener(this.formObject); - } -}; + } + } -PaymentMethodController.prototype.removeSavedCardsSelect = function (formObject) { - var formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.removeSavedCardsSelect(formObject); -} + this.modelToken = new CreditCardToken(this.formObject); + } + pixInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.pixInit(this.platformConfig.isMultibuyerEnabled); -PaymentMethodController.prototype.boletoCreditcardInit = function () { - this.platformConfig = PlatformConfig.bind(this.platformConfig); - this.formObject = FormObject.boletoCreditCardInit(this.platformConfig.isMultibuyerEnabled); + if (!this.formObject) { + return; + } - if (!this.formObject) { - return; - } + this.model = new PixModel(this.formObject); + this.hideCardAmount(this.formObject); - var isTotalOnAmountInputs = this.isTotalOnAmountInputs(this.formObject, this.platformConfig); + if (!this.platformConfig.isMultibuyerEnabled) { + this.removeMultibuyerForm(this.formObject); + } - if (typeof this.formObject[1] !== "undefined") { + if (this.platformConfig.isMultibuyerEnabled) { + this.fillMultibuyerStateSelect(this.formObject); + this.addShowMultibuyerListener(this.formObject); + this.addValidatorListener(this.formObject); + } + } - for (var i = 0, len = this.formObject.numberOfPaymentForms; i < len; i++) { + boletoInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.boletoInit(this.platformConfig.isMultibuyerEnabled); - if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) { - this.fillCardAmount(this.formObject[i], 2, i); + if (!this.formObject) { + return; } + this.model = new BoletoModel(this.formObject); + this.hideCardAmount(this.formObject); + if (!this.platformConfig.isMultibuyerEnabled) { - this.removeMultibuyerForm(this.formObject[i]); + this.removeMultibuyerForm(this.formObject); } if (this.platformConfig.isMultibuyerEnabled) { - this.fillMultibuyerStateSelect(this.formObject[i]); - this.addShowMultibuyerListener(this.formObject[i]); + this.fillMultibuyerStateSelect(this.formObject); + this.addShowMultibuyerListener(this.formObject); + this.addValidatorListener(this.formObject); } - - this.formObject[i].inputAmountContainer.show(); - this.addInputAmountBalanceListener(this.formObject[i], i); } - this.fillBrandList(this.formObject[1], 'pagarme_billet_creditcard'); - this.fillFormText(this.formObject[1], 'pagarme_billet_creditcard'); - this.fillSavedCreditCardsSelect(this.formObject[1]); - this.fillInstallments(this.formObject[1]); - this.addCreditCardListeners(this.formObject[1]); - this.modelToken = new CreditCardToken(this.formObject[1]); - } + removeSavedCardsSelect(formObject) { + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.removeSavedCardsSelect(formObject); + } - this.model = new BoletoCreditcardModel( - this.formObject, - this.platformConfig.publicKey - ); -} + boletoCreditcardInit() { + this.platformConfig = PlatformConfig.bind(this.platformConfig); + this.formObject = FormObject.boletoCreditCardInit(this.platformConfig.isMultibuyerEnabled); -var timesRunObserver = 1; -PaymentMethodController.prototype.addCreditCardListeners = function (formObject) { - if (!formObject) { - return; - } + if (!this.formObject) { + return; + } - this.addValidatorListener(formObject); - this.addCreditCardNumberListener(formObject); - this.addCreditCardInstallmentsListener(formObject); - this.addCreditCardHolderNameListener(formObject); - this.addSavedCreditCardsListener(formObject); - this.removeSavedCards(formObject); + const isTotalOnAmountInputs = this.isTotalOnAmountInputs(this.formObject, this.platformConfig); - if (timesRunObserver <= 1) { - timesRunObserver++; - this.addListenerUpdateAmount(); - } -}; + if (typeof this.formObject[1] !== "undefined") { -PaymentMethodController.prototype.removeSavedCards = function (formObject) { - if (checkoutConfig.payment[formObject.savedCardSelectUsed].enabled_saved_cards) { - return; - } + for (let i = 0, len = this.formObject.numberOfPaymentForms; i < len; i++) { - var selectCard = document.querySelector(formObject.containerSelector) - .querySelector('.saved-card'); + if (this.formObject[i].inputAmount.val() === "" || !isTotalOnAmountInputs) { + this.fillCardAmount(this.formObject[i], 2, i); + } - if (selectCard == null) { - return; - } + if (!this.platformConfig.isMultibuyerEnabled) { + this.removeMultibuyerForm(this.formObject[i]); + } - selectCard.remove(); -}; + if (this.platformConfig.isMultibuyerEnabled) { + this.fillMultibuyerStateSelect(this.formObject[i]); + this.addShowMultibuyerListener(this.formObject[i]); + } -PaymentMethodController.prototype.addListenerUpdateAmount = function () { - var observerMutation = new MutationObserver(function (mutationsList, observer) { + this.formObject[i].inputAmountContainer.show(); + this.addInputAmountBalanceListener(this.formObject[i], i); + } - var paymentMethodName = ['twocreditcards', 'boletoCreditcard', 'voucher']; - setTimeout(function () { - for (var i = 0; i < paymentMethodName.length; i++) { - var initPaymentMethod = new PaymentMethodController(paymentMethodName[i], platFormConfig); - initPaymentMethod.init(); + this.fillBrandList(this.formObject[1], 'pagarme_billet_creditcard'); + this.fillFormText(this.formObject[1], 'pagarme_billet_creditcard'); + this.fillSavedCreditCardsSelect(this.formObject[1]); + this.fillInstallments(this.formObject[1]); + this.addCreditCardListeners(this.formObject[1]); + this.modelToken = new CreditCardToken(this.formObject[1]); } - }, 800); - var initCreditCard = new PaymentMethodController('creditcard', platFormConfig); - initCreditCard.init(); - }); + this.model = new BoletoCreditcardModel( + this.formObject, + this.platformConfig.publicKey + ); + } + + addCreditCardListeners(formObject) { + if (!formObject) { + return; + } - observerMutation.observe( - document.getElementById('opc-sidebar'), - { - attributes: false, - childList: true, - subtree: true + this.addValidatorListener(formObject); + this.addCreditCardNumberListener(formObject); + this.addCreditCardInstallmentsListener(formObject); + this.addCreditCardHolderNameListener(formObject); + this.addSavedCreditCardsListener(formObject); + this.removeSavedCards(formObject); } - ); -} -PaymentMethodController.prototype.addInputAmountBalanceListener = function(formObject, id) { - var paymentMethodController = this; - var id = id; + removeSavedCards(formObject) { + if (checkoutConfig.payment[formObject.savedCardSelectUsed].enabled_saved_cards) { + return; + } - formObject.inputAmount.on('change', function () { - paymentMethodController.fillInstallments(formObject); - var formId = paymentMethodController.model.getFormIdInverted(id); - var form = paymentMethodController.formObject[formId]; - paymentMethodController.fillInstallments(form); + const selectCard = document.querySelector(formObject.containerSelector) + .querySelector('.saved-card'); - setTimeout(function () { - paymentMethodController.updateTotalByPaymentMethod(paymentMethodController, form.creditCardInstallments); - }, 3000); + if (selectCard == null) { + return; + } - }); + selectCard.remove(); + } - formObject.inputAmount.on('keyup', function(){ - element = jQuery(this); + addInputAmountBalanceListener(formObject, id) { + const paymentMethodController = this; - var orginalValue = platFormConfig.updateTotals.getTotals()().grand_total - var orderAmount = (orginalValue).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); - orderAmount = orderAmount.replace(/[^0-9]/g, ''); - orderAmount = Number(orderAmount); + formObject.inputAmount.on('change', function () { + paymentMethodController.fillInstallments(formObject); + const formId = paymentMethodController.model.getFormIdInverted(id); + const form = paymentMethodController.formObject[formId]; + paymentMethodController.fillInstallments(form); - var value = element.val(); - value = value.replace(/[^0-9]/g, ''); - value = Number(value); + setTimeout(function () { + paymentMethodController.updateTotalByPaymentMethod(paymentMethodController, form.creditCardInstallments); + }, 3000); - if (value >= orderAmount) { - value = orderAmount - 1; - } + }); - if (isNaN(value) || value == 0) { - value = 1; - } + formObject.inputAmount.on('keyup', function(){ + const element = $(this); - var remaining = orderAmount - value; + const originalValue = paymentMethodController.platformConfig.updateTotals.getTotals()().grand_total + let orderAmount = (originalValue).toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,'); + orderAmount = orderAmount.replace(/[^0-9]/g, ''); + orderAmount = Number(orderAmount); - remaining = (remaining / 100).toFixed(2); - value = (value / 100).toFixed(2); + let value = element.val(); + value = value.replace(/[^0-9]/g, ''); + value = Number(value); - var formId = paymentMethodController.model.getFormIdInverted(id); - var form = paymentMethodController.formObject[formId]; + if (value >= orderAmount) { + value = orderAmount - 1; + } - form.inputAmount.val(remaining.toString().replace('.', paymentMethodController.platformConfig.currency.decimalSeparator)); - element.val(value.toString().replace('.', paymentMethodController.platformConfig.currency.decimalSeparator)); - }); -} + if (isNaN(value) || value == 0) { + value = 1; + } -PaymentMethodController.prototype.addCreditCardHolderNameListener = function(formObject) { - var paymentMethodController = this; - formObject.creditCardHolderName.on('keyup', function () { - var element = jQuery(this); - paymentMethodController.clearNumbers(element); - }); -} + let remaining = orderAmount - value; -PaymentMethodController.prototype.addValidatorListener = function(formObject) { - const paymentMethodController = this; + remaining = (remaining / 100).toFixed(2); + value = (value / 100).toFixed(2); - jQuery(formObject.containerSelector).on('change', function (event) { - const element = jQuery(event.target); - if ( - element.attr('name').startsWith('payment[cc_type]') - && element.val() !== 'default' - ) { - paymentMethodController.validateBrandField(formObject); - return; - } - if (element.attr('name').startsWith('payment[cc_number]')) { - paymentMethodController.validateCcNumberField(element, formObject); - return; + const formId = paymentMethodController.model.getFormIdInverted(id); + const form = paymentMethodController.formObject[formId]; + + form.inputAmount.val(remaining.toString().replace('.', paymentMethodController.platformConfig.currency.decimalSeparator)); + element.val(value.toString().replace('.', paymentMethodController.platformConfig.currency.decimalSeparator)); + }); } - if ( - element.attr('name').startsWith('payment[cc_exp_month]') - || element.attr('name').startsWith('payment[cc_exp_year]') - ) { - paymentMethodController.validateCcExpDateField(formObject); - return; + + addCreditCardHolderNameListener(formObject) { + const paymentMethodController = this; + formObject.creditCardHolderName.on('keyup', function () { + const element = $(this); + paymentMethodController.clearNumbers(element); + }); } - paymentMethodController.validateDefaultField(element); - }); -}; -PaymentMethodController.prototype.addCreditCardNumberListener = function(formObject) { + addValidatorListener(formObject) { + const paymentMethodController = this; + + $(formObject.containerSelector).on('change', function (event) { + const element = $(event.target); + if ( + element.attr('name').startsWith('payment[cc_type]') + && element.val() !== 'default' + ) { + paymentMethodController.validateBrandField(formObject); + return; + } + if (element.attr('name').startsWith('payment[cc_number]')) { + paymentMethodController.validateCcNumberField(element, formObject); + return; + } + if ( + element.attr('name').startsWith('payment[cc_exp_month]') + || element.attr('name').startsWith('payment[cc_exp_year]') + ) { + paymentMethodController.validateCcExpDateField(formObject); + return; + } + paymentMethodController.validateDefaultField(element); + }); + } + addCreditCardNumberListener(formObject) { - var paymentMethodController = this; + const paymentMethodController = this; - formObject.creditCardNumber.unbind(); - formObject.creditCardNumber.on('keydown', function () { - element = jQuery(this); - paymentMethodController.limitCharacters(element, 19); - }); + formObject.creditCardNumber.unbind(); + formObject.creditCardNumber.on('keydown', function () { + const element = $(this); + paymentMethodController.limitCharacters(element, 19); + }); - var binObj = new Bin(); + const binObj = new Bin(); - formObject.creditCardNumber.on('keyup', function () { - var element = jQuery(this); - paymentMethodController.clearLetters(element); - }); + formObject.creditCardNumber.on('keyup', function () { + const element = $(this); + paymentMethodController.clearLetters(element); + }); - formObject.creditCardNumber.on('change', function () { - var element = jQuery(this); + formObject.creditCardNumber.on('change', function () { + const element = $(this); - setTimeout(function() { - paymentMethodController.setBin(binObj, element, formObject); - }, 300); - }); -}; + setTimeout(function() { + paymentMethodController.setBin(binObj, element, formObject); + }, 300); + }); + } -PaymentMethodController.prototype.twoCardsTotal = function (paymentMethod) { - var card1 = paymentMethod.formObject[0].creditCardInstallments; - var card2 = paymentMethod.formObject[1].creditCardInstallments; + twoCardsTotal(paymentMethod) { + const card1 = paymentMethod.formObject[0].creditCardInstallments; + const card2 = paymentMethod.formObject[1].creditCardInstallments; - var totalCard1 = paymentMethod.formObject[0].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); - var totalCard2 = paymentMethod.formObject[1].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); + const totalCard1 = paymentMethod.formObject[0].inputAmount.val().replace(this.platformConfig.currency.decimalSeparator, "."); + const totalCard2 = paymentMethod.formObject[1].inputAmount.val().replace(this.platformConfig.currency.decimalSeparator, "."); - var interestTotalCard1 = jQuery(card1).find(":selected").attr("interest"); - var interestTotalCard2 = jQuery(card2).find(":selected").attr("interest"); + const interestTotalCard1 = $(card1).find(":selected").attr("interest"); + const interestTotalCard2 = $(card2).find(":selected").attr("interest"); - var sumTotal = (parseFloat(totalCard1) + parseFloat(totalCard2)); - var sumInterestTotal = (parseFloat(interestTotalCard1) + parseFloat(interestTotalCard2)); + let sumTotal = (parseFloat(totalCard1) + parseFloat(totalCard2)); + let sumInterestTotal = (parseFloat(interestTotalCard1) + parseFloat(interestTotalCard2)); - sumTotal = (sumTotal + sumInterestTotal).toString(); - sumInterestTotal = sumInterestTotal.toString(); + sumTotal = (sumTotal + sumInterestTotal).toString(); + sumInterestTotal = sumInterestTotal.toString(); - return { sumTotal, sumInterestTotal }; -} + return { sumTotal, sumInterestTotal }; + } -PaymentMethodController.prototype.boletoCreditCardTotal = function (paymentMethod) { - var cardElement = paymentMethod.formObject[1].creditCardInstallments; + boletoCreditCardTotal(paymentMethod) { + const cardElement = paymentMethod.formObject[1].creditCardInstallments; - var sumInterestTotal = jQuery(cardElement).find(":selected").attr("interest"); + let sumInterestTotal = $(cardElement).find(":selected").attr("interest"); - var valueCard = paymentMethod.formObject[1].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); - var valueBoleto = paymentMethod.formObject[0].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); + const valueCard = paymentMethod.formObject[1].inputAmount.val().replace(this.platformConfig.currency.decimalSeparator, "."); + const valueBoleto = paymentMethod.formObject[0].inputAmount.val().replace(this.platformConfig.currency.decimalSeparator, "."); - var sumTotal = (parseFloat(valueCard) + parseFloat(valueBoleto)); + let sumTotal = (parseFloat(valueCard) + parseFloat(valueBoleto)); - sumTotal = (sumTotal + parseFloat(sumInterestTotal)).toString(); - sumInterestTotal = sumInterestTotal.toString(); + sumTotal = (sumTotal + parseFloat(sumInterestTotal)).toString(); + sumInterestTotal = sumInterestTotal.toString(); - return { sumTotal, sumInterestTotal }; -} + return { sumTotal, sumInterestTotal }; + } -PaymentMethodController.prototype.updateTotalByPaymentMethod = function (paymentMethod, event) { - var interest = jQuery(event).find(':selected').attr("interest"); - var grandTotal = jQuery(event).find(':selected').attr("total_with_tax"); + updateTotalByPaymentMethod(paymentMethod, event) { + let interest = $(event).find(':selected').attr("interest"); + let grandTotal = $(event).find(':selected').attr("total_with_tax"); - if (paymentMethod.methodCode === "twocreditcards") { - var twoCardsTotalObject = paymentMethod.twoCardsTotal(paymentMethod); + if (paymentMethod.methodCode === "twocreditcards") { + const twoCardsTotalObject = paymentMethod.twoCardsTotal(paymentMethod); - grandTotal = twoCardsTotalObject.sumTotal; - interest = twoCardsTotalObject.sumInterestTotal; - } + grandTotal = twoCardsTotalObject.sumTotal; + interest = twoCardsTotalObject.sumInterestTotal; + } - if (paymentMethod.methodCode === "boletoCreditcard") { - var boletoCreditCardTotalObject = paymentMethod.boletoCreditCardTotal(paymentMethod); + if (paymentMethod.methodCode === "boletoCreditcard") { + const boletoCreditCardTotalObject = paymentMethod.boletoCreditCardTotal(paymentMethod); - grandTotal = boletoCreditCardTotalObject.sumTotal; - interest = boletoCreditCardTotalObject.sumInterestTotal; - } + grandTotal = boletoCreditCardTotalObject.sumTotal; + interest = boletoCreditCardTotalObject.sumInterestTotal; + } - paymentMethod.updateTotal( - interest, - grandTotal, - jQuery(event).attr('name') - ); -} + paymentMethod.updateTotal( + interest, + grandTotal, + $(event).attr('name') + ); + } -PaymentMethodController.prototype.addCreditCardInstallmentsListener = function (formObject) { - var paymentMethodController = this; + addCreditCardInstallmentsListener(formObject) { + const paymentMethodController = this; - formObject.creditCardInstallments.on('change', function () { - var value = jQuery(this).val(); + formObject.creditCardInstallments.on('change', function () { + const value = $(this).val(); - if (value != "" && value != 'undefined') { - paymentMethodController.updateTotalByPaymentMethod(paymentMethodController, this); + if (value != "" && value != 'undefined') { + paymentMethodController.updateTotalByPaymentMethod(paymentMethodController, this); + } + }); } - }); -}; -PaymentMethodController.prototype.addSavedCreditCardsListener = function(formObject) { + addSavedCreditCardsListener(formObject) { - var paymentMethodController = this; - var brand = jQuery('option:selected').attr('brand'); + const paymentMethodController = this; + let brand = $('option:selected').attr('brand'); - if (brand == undefined) { - brand = formObject.creditCardBrand.val(); - } + if (brand == undefined) { + brand = formObject.creditCardBrand.val(); + } - var formObject = formObject; - formObject.creditCardBrand.val(brand); - formObject.savedCreditCardSelect.on('change', function() { - var value = jQuery(this).val(); - var brand = jQuery('option:selected').attr('brand'); + formObject.creditCardBrand.val(brand); - formObject.creditCardBrand.val(brand); - if (value === 'new') { - jQuery(formObject.containerSelector + ' .new').show(); + formObject.savedCreditCardSelect.on('change', function() { + const value = $(this).val(); + const brand = $('option:selected').attr('brand'); - if ( - typeof formObject.multibuyer != 'undefined' && - typeof formObject.multibuyer.showMultibuyer != 'undefined' - ) { - formObject.multibuyer.showMultibuyer.parent().show(); - } - return; - } + formObject.creditCardBrand.val(brand); + if (value === 'new') { + $(formObject.containerSelector + ' .new').show(); - paymentMethodController.fillInstallments(formObject); - jQuery(formObject.containerSelector + ' .new').hide(); + if ( + typeof formObject.multibuyer != 'undefined' && + typeof formObject.multibuyer.showMultibuyer != 'undefined' + ) { + formObject.multibuyer.showMultibuyer.parent().show(); + } + return; + } - if ( - typeof formObject.multibuyer != 'undefined' && - typeof formObject.multibuyer.showMultibuyer != 'undefined' - ) { - formObject.multibuyer.showMultibuyer.parent().hide(); - } + paymentMethodController.fillInstallments(formObject); + $(formObject.containerSelector + ' .new').hide(); - if (formObject.containerSelector == "#pagarme_voucher-form") { - paymentMethodController.showCvvCard(formObject); + if ( + typeof formObject.multibuyer != 'undefined' && + typeof formObject.multibuyer.showMultibuyer != 'undefined' + ) { + formObject.multibuyer.showMultibuyer.parent().hide(); + } + + if (formObject.containerSelector == "#pagarme_voucher-form") { + paymentMethodController.showCvvCard(formObject); + } + }); } - }); -}; -PaymentMethodController.prototype.placeOrder = function (placeOrderObject) { - var customerValidator = new CustomerValidator( - this.platformConfig.addresses.billingAddress - ); - customerValidator.validate(); - var errors = customerValidator.getErrors(); + placeOrder(placeOrderObject) { + const customerValidator = new CustomerValidator( + this.platformConfig.addresses.billingAddress + ); + customerValidator.validate(); + const errors = customerValidator.getErrors(); + + if (errors.length > 0) { + for (let id in errors) { + this.model.addErrors(errors[id]); + } + return; + } - if (errors.length > 0) { - for (id in errors) { - this.model.addErrors(errors[id]); - } - return; - } + const isPublicKeyValid = this.validatePublicKey( + this.platformConfig.publicKey + ); - var isPublickKeyValid = this.validatePublicKey( - this.platformConfig.publicKey - ); + if (!isPublicKeyValid) { + return; + } - if (!isPublickKeyValid) { - return; - } + this.model.placeOrder(placeOrderObject); + } - this.model.placeOrder(placeOrderObject); -}; + updateTotal(interest, grandTotal, selectName) { + const paymentMethodController = this; -PaymentMethodController.prototype.updateTotal = function(interest, grandTotal, selectName) { - var paymentMethodController = this; + /**@fixme Move gettotals() to PlatformFormBiding */ + const total = paymentMethodController.platformConfig.updateTotals.getTotals()(); + interest = (parseInt((interest * 100).toFixed(2))) / 100; - /**@fixme Move gettotals() to PlatformFormBiding */ - var total = paymentMethodController.platformConfig.updateTotals.getTotals()(); - interest = (parseInt((interest * 100).toFixed(2))) / 100; + if (interest < 0) { + interest = 0; + } - if (interest < 0) { - interest = 0; - } + total.tax_amount = interest; + total.base_tax_amount = interest; - total.tax_amount = interest; - total.base_tax_amount = interest; + for (let i = 0, len = total.total_segments.length; i < len; i++) { + if (total.total_segments[i].code === "grand_total") { + grandTotal = parseInt((grandTotal * 100).toFixed(2)); + total.total_segments[i].value = grandTotal / 100; + continue; + } + if (total.total_segments[i].code === "tax") { - for (var i = 0, len = total.total_segments.length; i < len; i++) { - if (total.total_segments[i].code === "grand_total") { - grandTotal = parseInt((grandTotal * 100).toFixed(2)); - total.total_segments[i].value = grandTotal / 100; - continue; - } - if (total.total_segments[i].code === "tax") { + total.total_segments[i].value = interest; + } + } - total.total_segments[i].value = interest; + paymentMethodController.platformConfig.updateTotals.setTotals(total); } - } - paymentMethodController.platformConfig.updateTotals.setTotals(total); -}; + sumInterests(interest, selectName) { + const paymentMethodController = this; + + const formObject = paymentMethodController.formObject; -PaymentMethodController.prototype.sumInterests = function(interest, selectName) { - var interest = interest; - var paymentMethodController = this; + for (let id in formObject) { - var formObject = paymentMethodController.formObject; + if (id.length > 1 || formObject[id].creditCardInstallments == undefined) { + continue; + } - for (id in formObject) { + const name = formObject[id].creditCardInstallments.attr('name'); + if (name == selectName) { + continue; + } + + const otherInterest = formObject[id].creditCardInstallments.find(':selected').attr('interest'); + if (isNaN(otherInterest)) { + continue; + } + + interest = parseFloat(otherInterest) + parseFloat(interest); + } - if (id.length > 1 || formObject[id].creditCardInstallments == undefined) { - continue; + return interest; } - var name = formObject[id].creditCardInstallments.attr('name'); - if (name == selectName) { - continue; + removeInstallmentsSelect(formObject) { + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.removeInstallmentsSelect(formObject); } - var otherInterest = formObject[id].creditCardInstallments.find(':selected').attr('interest'); - if (isNaN(otherInterest)) { - continue; + showCvvCard(formObject) { + const cvvElement = document.querySelector(formObject.containerSelector + " .cvv"); + + if (cvvElement != undefined) { + cvvElement.style.display = ""; + } } - interest = parseFloat(otherInterest) + parseFloat(interest); - } + fillInstallments(form) { + const _self = this; - return interest; -} + if (form.creditCardBrand == undefined) { + return; + } -PaymentMethodController.prototype.removeInstallmentsSelect = function (formObject) { - var formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.removeInstallmentsSelect(formObject); -} + const installmentSelected = form.creditCardInstallments.val(); -PaymentMethodController.prototype.showCvvCard = function (formObject) { - var cvvElement = document.querySelector(formObject.containerSelector + " .cvv"); + let formHandler = new FormHandler(); - if (cvvElement != undefined) { - cvvElement.style.display = ""; - } -} + let selectedBrand = form.creditCardBrand.val(); -PaymentMethodController.prototype.fillInstallments = function (form) { - var _self = this; + let amount = form.inputAmount.val(); + if (typeof selectedBrand == "undefined") { + selectedBrand = 'default'; + } - if (form.creditCardBrand == undefined) { - return; - } + if (typeof amount == "undefined") { + amount = 0; + } - var installmentSelected = form.creditCardInstallments.val(); + const installmentsUrl = + this.platformConfig.urls.installments + '/' + + selectedBrand + '/' + + amount; - formHandler = new FormHandler(); + $.ajax({ + url: installmentsUrl, + method: 'GET', + cache: true, + }).done(function(data) { + formHandler = new FormHandler(); - var selectedBrand = form.creditCardBrand.val(); + if (!data.length) return; - var amount = form.inputAmount.val(); - if (typeof selectedBrand == "undefined") { - selectedBrand = 'default'; - } + form.creditCardInstallments.prop('disabled', true); + formHandler.updateInstallmentSelect(data, form.creditCardInstallments, installmentSelected); + form.creditCardInstallments.prop('disabled', false); - if (typeof amount == "undefined") { - amount = 0; - } + formHandler.init(form); + formHandler.switchBrand(selectedBrand); + }); + } + fillBrandList(formObject, method) { + if (method == undefined) { + method = 'pagarme_creditcard'; + } + const formHandler = new FormHandler(); + formHandler.fillBrandList( + this.platformConfig.avaliableBrands[method], + formObject + ); + } - var installmentsUrl = - this.platformConfig.urls.installments + '/' + - selectedBrand + '/' + - amount; + fillCardAmount(formObject, count, card = null) { + const orderAmount = this.platformConfig.updateTotals.getTotals()().grand_total / count; - jQuery.ajax({ - url: installmentsUrl, - method: 'GET', - cache: true, - }).done(function(data) { - formHandler = new FormHandler(); + let amount = orderAmount.toFixed(this.platformConfig.currency.precision); + const separator = "."; - if (!data.length) return; + amount = amount.replace(separator, this.platformConfig.currency.decimalSeparator); - form.creditCardInstallments.prop('disabled', true); - formHandler.updateInstallmentSelect(data, form.creditCardInstallments, installmentSelected); - form.creditCardInstallments.prop('disabled', false); + if (card === 1) { + const orderAmountOriginal = amount.replace(this.platformConfig.currency.decimalSeparator, "."); + const amountBalance = (this.platformConfig.updateTotals.getTotals()().grand_total - orderAmountOriginal).toFixed(2); + formObject.inputAmount.val(amountBalance.replace(".", this.platformConfig.currency.decimalSeparator)); + return; + } - formHandler.init(form); - formHandler.switchBrand(selectedBrand); - }); -}; + formObject.inputAmount.val(amount); + } + validateCcNumberField(element, formObject) { + if (element.val() === '') { + formObject.creditCardBrand.val(''); -PaymentMethodController.prototype.fillBrandList = function (formObject, method) { - if (method == undefined) { - method = 'pagarme_creditcard'; - } - var formHandler = new FormHandler(); - formHandler.fillBrandList( - this.platformConfig.avaliableBrands[method], - formObject - ); -}; - -PaymentMethodController.prototype.fillCardAmount = function (formObject, count, card = null) { - var orderAmount = platFormConfig.updateTotals.getTotals()().grand_total / count; - - var amount = orderAmount.toFixed(this.platformConfig.currency.precision); - var separator = "."; - - amount = amount.replace(separator, this.platformConfig.currency.decimalSeparator); - - if (card === 1) { - var orderAmountOriginal = amount.replace(this.platformConfig.currency.decimalSeparator, "."); - var amountBalance = (platFormConfig.updateTotals.getTotals()().grand_total - orderAmountOriginal).toFixed(2); - formObject.inputAmount.val(amountBalance.replace(".", this.platformConfig.currency.decimalSeparator)); - return; - } + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.switchBrand(''); + } + this.validateDefaultField(element); + this.validateBrandField(formObject); + } + validateCcExpDateField(formObject) { + const cardExpirationMonth = formObject.creditCardExpMonth; + const cardExpirationYear = formObject.creditCardExpYear; + + const cardDate = new Date(cardExpirationYear.val(), cardExpirationMonth.val() -1); + const dateNow = new Date(); + + const monthParentsElements = cardExpirationMonth.parent().parent(); + const yearParentsElements = cardExpirationYear.parent().parent(); + const parentsElements = yearParentsElements.parents('.field'); + const parentsElementsError = parentsElements.find(fieldError); + + if (cardDate < dateNow) { + monthParentsElements.addClass(errorClass); + yearParentsElements.addClass(errorClass); + parentsElementsError.show(); + return true; + } - formObject.inputAmount.val(amount); -}; + monthParentsElements.removeClass(errorClass); + yearParentsElements.removeClass(errorClass); + parentsElementsError.hide(); + return false; + } + validateDefaultField(element) { + const requiredElement = element.parent().parent(); + const requiredElementError = requiredElement.children(fieldError); + + if (element.val() === '') { + requiredElement.addClass(errorClass); + requiredElementError.show(); + return true; + } -PaymentMethodController.prototype.validateCcNumberField = function (element, formObject) { - if (element.val() === '') { - formObject.creditCardBrand.val(''); + requiredElement.removeClass(errorClass); + requiredElementError.hide(); + return false; + } + validateBrandField(formObject) { + const element = formObject.creditCardBrand; + const requiredElement = element.parent().parent(); + const requiredElementError = requiredElement.find(fieldError); - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.switchBrand(''); - } - this.validateDefaultField(element); - this.validateBrandField(formObject); -}; - -const fieldError = '.field-error'; -const errorClass = '_error'; - -PaymentMethodController.prototype.validateCcExpDateField = function (formObject) { - const cardExpirationMonth = formObject.creditCardExpMonth; - const cardExpirationYear = formObject.creditCardExpYear; - - const cardDate = new Date (cardExpirationYear.val(), cardExpirationMonth.val() -1); - const dateNow = new Date(); - - const monthParentsElements = cardExpirationMonth.parent().parent(); - const yearParentsElements = cardExpirationYear.parent().parent(); - const parentsElements = yearParentsElements.parents('.field'); - const parentsElementsError = parentsElements.find(fieldError); - - if (cardDate < dateNow) { - monthParentsElements.addClass(errorClass); - yearParentsElements.addClass(errorClass); - parentsElementsError.show(); - return true; - } + const brands = []; + PlatformConfig.PlatformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { + brands.push(item.title.toUpperCase()); + }); - monthParentsElements.removeClass(errorClass); - yearParentsElements.removeClass(errorClass); - parentsElementsError.hide(); - return false; -}; + if ( + !brands.includes(element.val().toUpperCase()) + || element.val === '' + ) { + requiredElement.addClass(errorClass); + requiredElementError.show(); + requiredElement.find('.nobrand').hide(); + return true; + } -PaymentMethodController.prototype.validateDefaultField = function (element) { - const requiredElement = element.parent().parent(); - const requiredElementError = requiredElement.children(fieldError); + requiredElement.removeClass(errorClass); + requiredElementError.hide(); - if (element.val() === '') { - requiredElement.addClass(errorClass); - requiredElementError.show(); - return true; - } + return false; + } + setBin(binObj, creditCardNumberElement, formObject) { - requiredElement.removeClass(errorClass); - requiredElementError.hide(); - return false; -}; - -PaymentMethodController.prototype.validateBrandField = function (formObject) { - const element = formObject.creditCardBrand; - const requiredElement = element.parent().parent(); - const requiredElementError = requiredElement.find(fieldError); - - const brands = []; - PlatformConfig.PlatformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { - brands.push(item.title.toUpperCase()); - }); - - if ( - !brands.includes(element.val().toUpperCase()) - || element.val === '' - ) { - requiredElement.addClass(errorClass); - requiredElementError.show(); - requiredElement.find('.nobrand').hide(); - return true; - } + const bin = binObj; + const cardNumber = bin.formatNumber(creditCardNumberElement.val()); - requiredElement.removeClass(errorClass); - requiredElementError.hide(); + if (cardNumber.length < 4) { + return; + } - return false; -}; + const isNewBrand = bin.validate(cardNumber); -PaymentMethodController.prototype.setBin = function (binObj, creditCardNumberElement, formObject) { + bin.init(cardNumber); - var bin = binObj; - var cardNumber = bin.formatNumber(creditCardNumberElement.val()); + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.switchBrand(bin.selectedBrand); + if (isNewBrand) { + this.fillInstallments(formObject); + } - if (cardNumber.length < 4) { - return; - } + return; + } - var isNewBrand = bin.validate(cardNumber); + limitCharacters(element, limit) { + const val = element.val(); - bin.init(cardNumber); + if(val != "" && val.length > limit) { + element.val(val.substring(0, limit)); + } + } - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.switchBrand(bin.selectedBrand); - if (isNewBrand) { - this.fillInstallments(formObject); - } + clearLetters(element) { + const val = element.val(); + const newVal = val.replace(/[^0-9]+/g, ''); + element.val(newVal); + } + + clearNumbers(element) { + const val = element.val(); + const newVal = val.replace(/[0-9.-]+/g, ''); + element.val(newVal); + } - return; -}; + hideCardAmount(formObject) { + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.hideInputAmount(formObject); + } -PaymentMethodController.prototype.limitCharacters = function (element, limit) { - var val = element.val(); + fillFormText(formObject, method = null) { + const formText = this.platformConfig.text; - if(val != "" && val.length > limit) { - element.val(val.substring(0, limit)); - } -}; + const creditCardExpYear = formObject.creditCardExpYear.val(); + const creditCardExpMonth = formObject.creditCardExpMonth.val() + + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.fillExpirationYearSelect(formText, method, creditCardExpYear); + formHandler.fillExpirationMonthSelect(formText, method, creditCardExpMonth); + //@Todo add other texts + } -PaymentMethodController.prototype.clearLetters = function (element) { - var val = element.val(); - var newVal = val.replace(/[^0-9]+/g, ''); - element.val(newVal); -}; + fillSavedCreditCardsSelect(formObject) { + const platformConfig = this.platformConfig; -PaymentMethodController.prototype.clearNumbers = function (element) { - var val = element.val(); - var newVal = val.replace(/[0-9.-]+/g, ''); - element.val(newVal); -}; + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.fillSavedCreditCardsSelect(platformConfig, formObject); -PaymentMethodController.prototype.hideCardAmount = function (formObject) { - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.hideInputAmount(formObject); -}; + if (typeof formObject.savedCreditCardSelect[0] != 'undefined') { -PaymentMethodController.prototype.fillFormText = function (formObject, method = null) { - formText = this.platformConfig.text; + let brand = $('option:selected').attr('brand'); - var creditCardExpYear = formObject.creditCardExpYear.val(); - var creditCardExpMonth = formObject.creditCardExpMonth.val() + if (brand == undefined) { + brand = formObject.creditCardBrand.val(); + } - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.fillExpirationYearSelect(formText, method, creditCardExpYear); - formHandler.fillExpirationMonthSelect(formText, method, creditCardExpMonth); - //@Todo add other texts -}; + formObject.creditCardBrand.val(brand); -PaymentMethodController.prototype.fillSavedCreditCardsSelect = function (formObject) { - platformConfig = this.platformConfig; + if ( + typeof formObject.multibuyer != 'undefined' && + typeof formObject.multibuyer.showMultibuyer != 'undefined' && + formObject.savedCreditCardSelect[0].length > 0 + ) { + formObject.multibuyer.showMultibuyer.parent().hide(); + } + } + } - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.fillSavedCreditCardsSelect(platformConfig, formObject); + fillMultibuyerStateSelect(formObject) { + const platformConfig = this.platformConfig; - if (typeof formObject.savedCreditCardSelect[0] != 'undefined') { + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.fillMultibuyerStateSelect(platformConfig, formObject); + } - var brand = jQuery('option:selected').attr('brand'); + removeMultibuyerForm(formObject) { + const formHandler = new FormHandler(); + formHandler.init(formObject); + formHandler.removeMultibuyerForm(formObject); + } - if (brand == undefined) { - brand = formObject.creditCardBrand.val(); + addShowMultibuyerListener(formObject) { + $(formObject.multibuyer.showMultibuyer).on('click', function () { + formHandler.init(formObject); + formHandler.toggleMultibuyer(formObject); + }); } - formObject.creditCardBrand.val(brand); + isTotalOnAmountInputs(formObject, platformConfig) { + const orderTotal = platformConfig.updateTotals.getTotals()().grand_total; + const card1 = formObject[0].inputAmount.val()?.replace(platformConfig.currency.decimalSeparator, "."); + const card2 = formObject[1].inputAmount.val()?.replace(platformConfig.currency.decimalSeparator, "."); + const totalInputs = (parseFloat(card1) + parseFloat(card2)); - if ( - typeof formObject.multibuyer != 'undefined' && - typeof formObject.multibuyer.showMultibuyer != 'undefined' && - formObject.savedCreditCardSelect[0].length > 0 - ) { - formObject.multibuyer.showMultibuyer.parent().hide(); + return orderTotal == totalInputs; } - } -}; - -PaymentMethodController.prototype.fillMultibuyerStateSelect = function (formObject) { - platformConfig = this.platformConfig; - - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.fillMultibuyerStateSelect(platformConfig, formObject); -}; - -PaymentMethodController.prototype.removeMultibuyerForm = function (formObject) { - formHandler = new FormHandler(); - formHandler.init(formObject); - formHandler.removeMultibuyerForm(formObject); -}; - -PaymentMethodController.prototype.addShowMultibuyerListener = function(formObject) { - jQuery(formObject.multibuyer.showMultibuyer).on('click', function () { - formHandler.init(formObject); - formHandler.toggleMultibuyer(formObject); - }); -}; - -PaymentMethodController.prototype.isTotalOnAmountInputs = function(formObject, platformConfig) { - var orderTotal = platformConfig.updateTotals.getTotals()().grand_total; - var card1 = formObject[0].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); - var card2 = formObject[1].inputAmount.val().replace(platformConfig.currency.decimalSeparator, "."); - var totalInputs = (parseFloat(card1) + parseFloat(card2)); - - return orderTotal == totalInputs; -}; - -PaymentMethodController.prototype.validatePublicKey = function (publicKey) { - if (!publicKey) { - var error = - "Não foi possivel conectar com o serviço de pagamento. " + - "Por favor contate o administrador da loja."; - this.model.addErrors(error); - return false; - } - return true; -}; + validatePublicKey(publicKey) { + if (!publicKey) { + const error = + "Não foi possivel conectar com o serviço de pagamento. " + + "Por favor contate o administrador da loja."; + this.model.addErrors(error); + return false; + } + + return true; + } + } +}); diff --git a/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js b/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js index 0882118d..65e8bae1 100644 --- a/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js +++ b/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js @@ -2,56 +2,60 @@ * This code should be migrated to core_module */ -var PagarmeCore = { - paymentMethod : [] -}; - -PagarmeCore.initPaymentMethod = function (methodCode, platformConfig) { - var _self = this; - setTimeout(function() { - _self.init(methodCode, platformConfig); - }, 1000); -}; - -PagarmeCore.init = function (methodCode, platformConfig) { - this.paymentMethod[methodCode] = new PaymentMethodController(methodCode, platformConfig); - this.paymentMethod[methodCode].init(); -} -PagarmeCore.initBin = function (methodCode, obj) { - this.paymentMethod[methodCode].initBin(obj); -}; - -PagarmeCore.validatePaymentMethod = function (methodCode) { - this.paymentMethod = - new PaymentMethodController(methodCode); - - this.paymentMethod.init(); - return this.paymentMethod.formValidation(); -}; - -PagarmeCore.placeOrder = function(platformObject, model) { - - if (this.paymentMethod[model].model.validate()) { - try { - //This object should be injected on this method, not instantiated here - var platformOrderPlace = new PlatformPlaceOrder( - platformObject.obj, - platformObject.data, - platformObject.event - ); - - this.paymentMethod[model].placeOrder(platformOrderPlace); - } catch (e) { - console.log(e) +define([ + 'Pagarme_Pagarme/js/core/checkout/PaymentMethodController', + 'Pagarme_Pagarme/js/core/checkout/PlatformPlaceOrder' +], (PaymentMethodController, PlatformPlaceOrder) => { + const PagarmeCore = { + paymentMethod : [] + }; + + PagarmeCore.init = (methodCode, platformConfig) => { + PagarmeCore.paymentMethod[methodCode] = new PaymentMethodController(methodCode, platformConfig); + PagarmeCore.paymentMethod[methodCode].init(); + }; + + PagarmeCore.initPaymentMethod = (methodCode, platformConfig) => { + setTimeout(function() { + PagarmeCore.init(methodCode, platformConfig); + }, 1000); + }; + + PagarmeCore.initBin = (methodCode, obj) => { + PagarmeCore.paymentMethod[methodCode].initBin(obj); + }; + + PagarmeCore.validatePaymentMethod = (methodCode) => { + PagarmeCore.paymentMethod = + new PaymentMethodController(methodCode); + + PagarmeCore.paymentMethod.init(); + return PagarmeCore.paymentMethod.formValidation(); + }; + + PagarmeCore.placeOrder = (platformObject, model) => { + if (PagarmeCore.paymentMethod[model].model.validate()) { + try { + const platformOrderPlace = new PlatformPlaceOrder( + platformObject.obj, + platformObject.data, + platformObject.event + ); + PagarmeCore.paymentMethod[model].placeOrder(platformOrderPlace); + } catch (e) { + console.log(e) + } } - } - var errors = this.paymentMethod[model].model.errors; - if (errors.length > 0) { - for (index in errors) { - this.messageList.addErrorMessage(errors[index]); + const errors = PagarmeCore.paymentMethod[model].model.errors; + if (errors.length > 0) { + for (let index in errors) { + this.messageList.addErrorMessage(errors[index]); + } + jQuery("html, body").animate({scrollTop: 0}, 600); + console.log(errors); } - jQuery("html, body").animate({scrollTop: 0}, 600); - console.log(errors); - } -} \ No newline at end of file + }; + + return PagarmeCore; +}); diff --git a/view/frontend/web/js/core/checkout/PlatformConfig.js b/view/frontend/web/js/core/checkout/PlatformConfig.js new file mode 100644 index 00000000..9fcf6999 --- /dev/null +++ b/view/frontend/web/js/core/checkout/PlatformConfig.js @@ -0,0 +1,163 @@ +define([], () => { + const PlatformConfig = { + PlatformConfig: {} + }; + + PlatformConfig.getBrands = (data, paymentMethodBrands) => { + const availableBrands = []; + + if (paymentMethodBrands !== undefined) { + const brands = Object.keys(paymentMethodBrands); + + for (let i = 0, len = brands.length; i < len; i++) { + const brand = data.payment.ccform.icons[brands[i]]; + if (!brand) continue; + const url = brand.url; + + availableBrands[i] = { + 'title': brands[i], + 'image': url + + }; + } + } + return availableBrands; + }; + + PlatformConfig.getAvaliableBrands = (data) => { + const creditCardBrands = PlatformConfig.getBrands( + data, + data.payment.ccform.availableTypes.pagarme_creditcard + ); + + const voucherBrands = PlatformConfig.getBrands( + data, + data.payment.ccform.availableTypes.pagarme_voucher + ); + + const debitBrands = PlatformConfig.getBrands( + data, + data.payment.ccform.availableTypes.pagarme_debit + ); + + const twoCreditcardBrands = PlatformConfig.getBrands( + data, + data.payment.ccform.availableTypes.pagarme_two_creditcard + ); + + const billetCreditcardBrands = PlatformConfig.getBrands( + data, + data.payment.ccform.availableTypes.pagarme_billet_creditcard + ); + + return { + 'pagarme_creditcard': creditCardBrands, + 'pagarme_voucher': voucherBrands, + 'pagarme_debit': debitBrands, + 'pagarme_two_creditcard': twoCreditcardBrands, + 'pagarme_billet_creditcard': billetCreditcardBrands + }; + }; + + PlatformConfig.getSavedCreditCards = (platFormConfig) => { + let creditCard = null; + let twoCreditCard = null; + let billetCreditCard = null; + let voucherCard = null; + let debitCard = null; + + if ( + platFormConfig.payment.pagarme_creditcard.enabled_saved_cards && + typeof(platFormConfig.payment.pagarme_creditcard.cards != "undefined") + ) { + creditCard = platFormConfig.payment.pagarme_creditcard.cards; + } + + if ( + platFormConfig.payment.pagarme_voucher.enabled_saved_cards && + typeof(platFormConfig.payment.pagarme_voucher.cards != "undefined") + ) { + voucherCard = platFormConfig.payment.pagarme_voucher.cards; + } + + if ( + platFormConfig.payment.pagarme_two_creditcard.enabled_saved_cards && + typeof(platFormConfig.payment.pagarme_two_creditcard.cards != "undefined") + ) { + twoCreditCard = platFormConfig.payment.pagarme_two_creditcard.cards; + } + + if ( + platFormConfig.payment.pagarme_billet_creditcard.enabled_saved_cards && + typeof(platFormConfig.payment.pagarme_billet_creditcard.cards != "undefined") + ) { + billetCreditCard = platFormConfig.payment.pagarme_billet_creditcard.cards; + } + + if ( + platFormConfig.payment.pagarme_debit.enabled_saved_cards && + typeof(platFormConfig.payment.pagarme_debit.cards != "undefined") + ) { + debitCard = platFormConfig.payment.pagarme_debit.cards; + } + + return { + "pagarme_creditcard": creditCard, + "pagarme_two_creditcard": twoCreditCard, + "pagarme_billet_creditcard": billetCreditCard, + "pagarme_voucher": voucherCard, + "pagarme_debit": debitCard + }; + }; + + PlatformConfig.bind = (platformConfig) => { + const grandTotal = parseFloat(platformConfig.grand_total); + + const publicKey = platformConfig.payment.ccform.pk_token; + + const urls = { + base: platformConfig.base_url, + installments : platformConfig.moduleUrls.installments + }; + + const currency = { + code : platformConfig.quoteData.base_currency_code, + decimalSeparator : platformConfig.basePriceFormat.decimalSymbol, + precision : platformConfig.basePriceFormat.precision + }; + + const text = { + months: platformConfig.payment.ccform.months, + years: platformConfig.payment.ccform.years + } + + const avaliableBrands = PlatformConfig.getAvaliableBrands(platformConfig); + const savedAllCards = PlatformConfig.getSavedCreditCards(platformConfig); + + const loader = { + start: platformConfig.loader.startLoader, + stop: platformConfig.loader.stopLoader + }; + const totals = platformConfig.totalsData; + + PlatformConfig.PlatformConfig = { + avaliableBrands: avaliableBrands, + orderAmount : grandTotal.toFixed(platformConfig.basePriceFormat.precision), + urls: urls, + currency : currency, + text: text, + publicKey: publicKey, + totals: totals, + loader: loader, + addresses: platformConfig.addresses, + updateTotals: platformConfig.updateTotals, + savedAllCards: savedAllCards, + region_states: platformConfig.region_states, + isMultibuyerEnabled: platformConfig.is_multi_buyer_enabled + }; + + return PlatformConfig.PlatformConfig; + } + + return PlatformConfig; +}); diff --git a/view/frontend/web/js/core/checkout/PlatformFormBiding.js b/view/frontend/web/js/core/checkout/PlatformFormBiding.js deleted file mode 100644 index 02393242..00000000 --- a/view/frontend/web/js/core/checkout/PlatformFormBiding.js +++ /dev/null @@ -1,597 +0,0 @@ -var FormObject = {}; -var PlatformConfig = {}; - -PlatformConfig.bind = function (platformConfig) { - grandTotal = parseFloat(platformConfig.grand_total); - - publicKey = platformConfig.payment.ccform.pk_token; - - urls = { - base: platformConfig.base_url, - installments : platformConfig.moduleUrls.installments - }; - - currency = { - code : platformConfig.quoteData.base_currency_code, - decimalSeparator : platformConfig.basePriceFormat.decimalSymbol, - precision : platformConfig.basePriceFormat.precision - }; - - text = { - months: platformConfig.payment.ccform.months, - years: platformConfig.payment.ccform.years - } - - avaliableBrands = this.getAvaliableBrands(platformConfig); - savedAllCards = this.getSavedCreditCards(platformConfig); - - loader = { - start: platformConfig.loader.startLoader, - stop: platformConfig.loader.stopLoader - }; - totals = platformConfig.totalsData; - - var config = { - avaliableBrands: avaliableBrands, - orderAmount : grandTotal.toFixed(platformConfig.basePriceFormat.precision), - urls: urls, - currency : currency, - text: text, - publicKey: publicKey, - totals: totals, - loader: loader, - addresses: platformConfig.addresses, - updateTotals: platformConfig.updateTotals, - savedAllCards: savedAllCards, - region_states: platformConfig.region_states, - isMultibuyerEnabled: platformConfig.is_multi_buyer_enabled - }; - - this.PlatformConfig = config; - - return this.PlatformConfig; -}; - -PlatformConfig.getAvaliableBrands = function (data) { - creditCardBrands = this.getBrands( - data, - data.payment.ccform.availableTypes.pagarme_creditcard - ); - - voucherBrands = this.getBrands( - data, - data.payment.ccform.availableTypes.pagarme_voucher - ); - - debitBrands = this.getBrands( - data, - data.payment.ccform.availableTypes.pagarme_debit - ); - - twoCreditcardBrands = this.getBrands( - data, - data.payment.ccform.availableTypes.pagarme_two_creditcard - ); - - billetCreditcardBrands = this.getBrands( - data, - data.payment.ccform.availableTypes.pagarme_billet_creditcard - ); - - return { - 'pagarme_creditcard': creditCardBrands, - 'pagarme_voucher': voucherBrands, - 'pagarme_debit': debitBrands, - 'pagarme_two_creditcard': twoCreditcardBrands, - 'pagarme_billet_creditcard': billetCreditcardBrands - }; -} - -PlatformConfig.getBrands = function (data, paymentMethodBrands) { - var availableBrands = []; - - if (paymentMethodBrands !== undefined) { - var brands = Object.keys(paymentMethodBrands); - - for (var i = 0, len = brands.length; i < len; i++) { - brand = data.payment.ccform.icons[brands[i]]; - if (!brand) continue; - url = brand.url; - fixArray = []; - imageUrl = fixArray.concat(url); - - availableBrands[i] = { - 'title': brands[i], - 'image': imageUrl[0] - - }; - } - } - return availableBrands; -} - -FormObject.creditCardInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - var containerSelector = '#pagarme_creditcard-form'; - - if (typeof jQuery(containerSelector).html() == 'undefined') { - this.FormObject = null; - return; - } - - var creditCardForm = { - 'containerSelector' : containerSelector, - "creditCardNumber" : jQuery(containerSelector + " .cc_number"), - "creditCardHolderName" : jQuery(containerSelector + " .cc_owner"), - "creditCardExpMonth" : jQuery(containerSelector + " .cc_exp_month"), - "creditCardExpYear" : jQuery(containerSelector + " .cc_exp_year"), - "creditCardCvv" : jQuery(containerSelector + " .cc_cid"), - "creditCardInstallments" : jQuery(containerSelector + " .cc_installments"), - "creditCardBrand" : jQuery(containerSelector + " .cc_type"), - "creditCardToken" : jQuery(containerSelector + " .cc_token"), - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerSelector + " .amount-container"), - "savedCreditCardSelect" : jQuery(containerSelector + " .cc_saved_creditcards"), - "saveThisCard" : jQuery(containerSelector + " .save_this_card") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer" : jQuery(containerSelector + " .show_multibuyer"), - "firstname" : jQuery(containerSelector + " .multibuyer_firstname"), - "lastname" : jQuery(containerSelector + " .multibuyer_lastname"), - "email" : jQuery(containerSelector + " .multibuyer_email"), - "zipcode" : jQuery(containerSelector + " .multibuyer_zipcode"), - "document" : jQuery(containerSelector + " .multibuyer_document"), - "street" : jQuery(containerSelector + " .multibuyer_street"), - "number" : jQuery(containerSelector + " .multibuyer_number"), - "complement" : jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood" : jQuery(containerSelector + " .multibuyer_neighborhood"), - "city" : jQuery(containerSelector + " .multibuyer_city"), - "state" : jQuery(containerSelector + " .multibuyer_state"), - "homePhone" : jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone" : jQuery(containerSelector + " .multibuyer_mobile_phone") - } - } - - this.FormObject = creditCardForm; - this.FormObject.numberOfPaymentForms = 1; - this.FormObject.multibuyer = multibuyerForm; - this.FormObject.savedCardSelectUsed = 'pagarme_creditcard'; - - return this.FormObject; -}; - -FormObject.voucherInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - var containerSelector = '#pagarme_voucher-form'; - - if (typeof jQuery(containerSelector).html() == 'undefined') { - this.FormObject = null; - return; - } - - var voucherForm = { - 'containerSelector' : containerSelector, - "creditCardNumber" : jQuery(containerSelector + " .cc_number"), - "creditCardHolderName" : jQuery(containerSelector + " .cc_owner"), - "creditCardExpMonth" : jQuery(containerSelector + " .cc_exp_month"), - "creditCardExpYear" : jQuery(containerSelector + " .cc_exp_year"), - "creditCardCvv" : jQuery(containerSelector + " .cc_cid"), - "creditCardInstallments" : jQuery(containerSelector + " .cc_installments"), - "creditCardBrand" : jQuery(containerSelector + " .cc_type"), - "creditCardToken" : jQuery(containerSelector + " .cc_token"), - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "savedCreditCardSelect" : jQuery(containerSelector + " .cc_saved_creditcards"), - "saveThisCard" : jQuery(containerSelector + " .save_this_card") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer" : jQuery(containerSelector + " .show_multibuyer"), - "firstname" : jQuery(containerSelector + " .multibuyer_firstname"), - "lastname" : jQuery(containerSelector + " .multibuyer_lastname"), - "email" : jQuery(containerSelector + " .multibuyer_email"), - "zipcode" : jQuery(containerSelector + " .multibuyer_zipcode"), - "document" : jQuery(containerSelector + " .multibuyer_document"), - "street" : jQuery(containerSelector + " .multibuyer_street"), - "number" : jQuery(containerSelector + " .multibuyer_number"), - "complement" : jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood" : jQuery(containerSelector + " .multibuyer_neighborhood"), - "city" : jQuery(containerSelector + " .multibuyer_city"), - "state" : jQuery(containerSelector + " .multibuyer_state"), - "homePhone" : jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone" : jQuery(containerSelector + " .multibuyer_mobile_phone") - } - } - - this.FormObject = voucherForm; - this.FormObject.numberOfPaymentForms = 1; - this.FormObject.multibuyer = multibuyerForm; - this.FormObject.savedCardSelectUsed = 'pagarme_voucher'; - - return this.FormObject; -}; - -FormObject.debitInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - var containerSelector = '#pagarme_debit-form'; - - if (typeof jQuery(containerSelector).html() == 'undefined') { - this.FormObject = null; - return; - } - - var debitForm = { - 'containerSelector' : containerSelector, - "creditCardNumber" : jQuery(containerSelector + " .cc_number"), - "creditCardHolderName" : jQuery(containerSelector + " .cc_owner"), - "creditCardExpMonth" : jQuery(containerSelector + " .cc_exp_month"), - "creditCardExpYear" : jQuery(containerSelector + " .cc_exp_year"), - "creditCardCvv" : jQuery(containerSelector + " .cc_cid"), - "creditCardInstallments" : jQuery(containerSelector + " .cc_installments"), - "creditCardBrand" : jQuery(containerSelector + " .cc_type"), - "creditCardToken" : jQuery(containerSelector + " .cc_token"), - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "savedCreditCardSelect" : jQuery(containerSelector + " .cc_saved_creditcards"), - "saveThisCard" : jQuery(containerSelector + " .save_this_card") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = this.getMultibuyerForm(containerSelector) - } - - this.FormObject = debitForm; - this.FormObject.numberOfPaymentForms = 1; - this.FormObject.multibuyer = multibuyerForm; - this.FormObject.savedCardSelectUsed = 'pagarme_debit'; - - return this.FormObject; -}; - -FormObject.getMultibuyerForm = function (containerSelector) { - return { - "showMultibuyer" : jQuery(containerSelector + " .show_multibuyer"), - "firstname" : jQuery(containerSelector + " .multibuyer_firstname"), - "lastname" : jQuery(containerSelector + " .multibuyer_lastname"), - "email" : jQuery(containerSelector + " .multibuyer_email"), - "zipcode" : jQuery(containerSelector + " .multibuyer_zipcode"), - "document" : jQuery(containerSelector + " .multibuyer_document"), - "street" : jQuery(containerSelector + " .multibuyer_street"), - "number" : jQuery(containerSelector + " .multibuyer_number"), - "complement" : jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood" : jQuery(containerSelector + " .multibuyer_neighborhood"), - "city" : jQuery(containerSelector + " .multibuyer_city"), - "state" : jQuery(containerSelector + " .multibuyer_state"), - "homePhone" : jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone" : jQuery(containerSelector + " .multibuyer_mobile_phone") - } -} - -FormObject.twoCreditCardsInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - containerSelector = []; - containerSelector.push("#pagarme_two_creditcard-form #two-credit-cards-form-0"); - containerSelector.push("#pagarme_two_creditcard-form #two-credit-cards-form-1"); - - - if (typeof jQuery(containerSelector[0]).html() == 'undefined') { - this.FormObject = null; - return; - } - - //Using for for IE compatibility - for (var i = 0, len = containerSelector.length; i < len; i++) { - FormObject.fillTwoCreditCardsElements(containerSelector[i], i, isMultibuyerEnabled); - } - - this.FormObject.numberOfPaymentForms = 2; - - return this.FormObject; -}; - - -FormObject.pixInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - var containerSelector = '#pagarme_pix-form'; - - if (typeof jQuery(containerSelector).html() == 'undefined') { - this.FormObject = null; - return; - } - - var pixElements = { - 'containerSelector' : containerSelector, - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerSelector + " .amount-container") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer": jQuery(containerSelector + " .show_multibuyer"), - "firstname": jQuery(containerSelector + " .multibuyer_firstname"), - "lastname": jQuery(containerSelector + " .multibuyer_lastname"), - "email": jQuery(containerSelector + " .multibuyer_email"), - "zipcode": jQuery(containerSelector + " .multibuyer_zipcode"), - "document": jQuery(containerSelector + " .multibuyer_document"), - "street": jQuery(containerSelector + " .multibuyer_street"), - "number": jQuery(containerSelector + " .multibuyer_number"), - "complement": jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood": jQuery(containerSelector + " .multibuyer_neighborhood"), - "city": jQuery(containerSelector + " .multibuyer_city"), - "state": jQuery(containerSelector + " .multibuyer_state"), - "homePhone": jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone": jQuery(containerSelector + " .multibuyer_mobile_phone") - } - } - - this.FormObject = pixElements; - this.FormObject.numberOfPaymentForms = 1; - this.FormObject.multibuyer = multibuyerForm; - return this.FormObject; -} - -FormObject.boletoInit = function (isMultibuyerEnabled) { - - this.FormObject = {}; - - var containerSelector = '#pagarme_billet-form'; - - if (typeof jQuery(containerSelector).html() == 'undefined') { - this.FormObject = null; - return; - } - - var boletoElements = { - 'containerSelector' : containerSelector, - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerSelector + " .amount-container") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer": jQuery(containerSelector + " .show_multibuyer"), - "firstname": jQuery(containerSelector + " .multibuyer_firstname"), - "lastname": jQuery(containerSelector + " .multibuyer_lastname"), - "email": jQuery(containerSelector + " .multibuyer_email"), - "zipcode": jQuery(containerSelector + " .multibuyer_zipcode"), - "document": jQuery(containerSelector + " .multibuyer_document"), - "street": jQuery(containerSelector + " .multibuyer_street"), - "number": jQuery(containerSelector + " .multibuyer_number"), - "complement": jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood": jQuery(containerSelector + " .multibuyer_neighborhood"), - "city": jQuery(containerSelector + " .multibuyer_city"), - "state": jQuery(containerSelector + " .multibuyer_state"), - "homePhone": jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone": jQuery(containerSelector + " .multibuyer_mobile_phone") - } - } - - this.FormObject = boletoElements; - this.FormObject.numberOfPaymentForms = 1; - this.FormObject.multibuyer = multibuyerForm; - return this.FormObject; -} - -FormObject.boletoCreditCardInit = function (isMultibuyerEnabled) { - - var containerBoletoSelector = "#pagarme_billet_creditcard-form #billet-form"; - var containerCreditCardSelector = "#pagarme_billet_creditcard-form #credit-card-form"; - - this.FormObject = {}; - - if (typeof jQuery(containerCreditCardSelector + " .cc_installments").html() == 'undefined') { - this.FormObject = null; - return; - } - - var boletoElements = { - 'containerSelector' : containerBoletoSelector, - "inputAmount" : jQuery(containerBoletoSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerBoletoSelector + " .amount-container"), - }; - - var cardsElements = { - 'containerSelector' : containerCreditCardSelector, - "creditCardNumber" : jQuery(containerCreditCardSelector + " .cc_number"), - "creditCardHolderName" : jQuery(containerCreditCardSelector + " .cc_owner"), - "creditCardExpMonth" : jQuery(containerCreditCardSelector + " .cc_exp_month"), - "creditCardExpYear" : jQuery(containerCreditCardSelector + " .cc_exp_year"), - "creditCardCvv" : jQuery(containerCreditCardSelector + " .cc_cid"), - "creditCardInstallments" : jQuery(containerCreditCardSelector + " .cc_installments"), - "creditCardBrand" : jQuery(containerCreditCardSelector + " .cc_type"), - "creditCardToken" : jQuery(containerCreditCardSelector + " .cc_token"), - "inputAmount" : jQuery(containerCreditCardSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerCreditCardSelector + " .amount-container"), - "savedCreditCardSelect" : jQuery(containerCreditCardSelector + " .cc_saved_creditcards"), - "saveThisCard" : jQuery(containerCreditCardSelector + " .save_this_card") - }; - - this.FormObject[0] = boletoElements; - this.FormObject[1] = cardsElements; - - for (var i = 0, len = 2; i < len; i++) { - FormObject.fillBoletoCreditCardElements(this.FormObject[i].containerSelector, i, isMultibuyerEnabled); - } - - this.FormObject.numberOfPaymentForms = 2; - this.FormObject[1].savedCardSelectUsed = 'pagarme_billet_creditcard'; - - return this.FormObject; -} - -FormObject.fillBoletoCreditCardElements = function (containerSelector, elementId, isMultibuyerEnabled) { - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer" : jQuery(containerSelector + " .show_multibuyer"), - "firstname" : jQuery(containerSelector + " .multibuyer_firstname"), - "lastname" : jQuery(containerSelector + " .multibuyer_lastname"), - "email" : jQuery(containerSelector + " .multibuyer_email"), - "zipcode" : jQuery(containerSelector + " .multibuyer_zipcode"), - "document" : jQuery(containerSelector + " .multibuyer_document"), - "street" : jQuery(containerSelector + " .multibuyer_street"), - "number" : jQuery(containerSelector + " .multibuyer_number"), - "complement" : jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood" : jQuery(containerSelector + " .multibuyer_neighborhood"), - "city" : jQuery(containerSelector + " .multibuyer_city"), - "state" : jQuery(containerSelector + " .multibuyer_state"), - "homePhone" : jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone" : jQuery(containerSelector + " .multibuyer_mobile_phone") - } - - this.FormObject[elementId].multibuyer = multibuyerForm; - } - return this.FormObject; -} - -FormObject.fillTwoCreditCardsElements = function (containerSelector, elementId, isMultibuyerEnabled) { - - if (jQuery(containerSelector).children().length == 0) { - return; - } - - var elements = { - "creditCardNumber" : jQuery(containerSelector + " .cc_number"), - "creditCardHolderName" : jQuery(containerSelector + " .cc_owner"), - "creditCardExpMonth" : jQuery(containerSelector + " .cc_exp_month"), - "creditCardExpYear" : jQuery(containerSelector + " .cc_exp_year"), - "creditCardCvv" : jQuery(containerSelector + " .cc_cid"), - "creditCardInstallments" : jQuery(containerSelector + " .cc_installments"), - "creditCardBrand" : jQuery(containerSelector + " .cc_type"), - "creditCardToken" : jQuery(containerSelector + " .cc_token"), - "inputAmount" : jQuery(containerSelector + " .cc_amount"), - "inputAmountContainer" : jQuery(containerSelector + " .amount-container"), - "savedCreditCardSelect" : jQuery(containerSelector + " .cc_saved_creditcards"), - "saveThisCard" : jQuery(containerSelector + " .save_this_card") - }; - - if (isMultibuyerEnabled) { - var multibuyerForm = { - "showMultibuyer" : jQuery(containerSelector + " .show_multibuyer"), - "firstname" : jQuery(containerSelector + " .multibuyer_firstname"), - "lastname" : jQuery(containerSelector + " .multibuyer_lastname"), - "email" : jQuery(containerSelector + " .multibuyer_email"), - "zipcode" : jQuery(containerSelector + " .multibuyer_zipcode"), - "document" : jQuery(containerSelector + " .multibuyer_document"), - "street" : jQuery(containerSelector + " .multibuyer_street"), - "number" : jQuery(containerSelector + " .multibuyer_number"), - "complement" : jQuery(containerSelector + " .multibuyer_complement"), - "neighborhood" : jQuery(containerSelector + " .multibuyer_neighborhood"), - "city" : jQuery(containerSelector + " .multibuyer_city"), - "state" : jQuery(containerSelector + " .multibuyer_state"), - "homePhone" : jQuery(containerSelector + " .multibuyer_home_phone"), - "mobilePhone" : jQuery(containerSelector + " .multibuyer_mobile_phone") - } - } - - this.FormObject[elementId] = - this.renameTwoCreditCardsElements( - elements, - elementId - ); - - this.FormObject[elementId].multibuyer = - this.renameTwoCreditCardsElements( - multibuyerForm, - elementId - ); - - this.FormObject[elementId].containerSelector = containerSelector; - this.FormObject[elementId].savedCardSelectUsed = 'pagarme_two_creditcard'; - - return this.FormObject; -}; - -FormObject.renameTwoCreditCardsElements = function (elements, elementId) { - var twoCreditCardForm = {}; - - for (var key in elements) { - - name = elements[key].attr('name'); - - newName = name + '[' + elementId + ']'; - - if (name.match(/\[\d\]/g)) { - newName = name; - } - - elements[key].attr('name', newName); - elementType = 'input'; - - if (elements[key].is('select')) { - elementType = 'select'; - } - - newElement = - jQuery( - elementType + - "[name='" + - newName + - "']" - ); - twoCreditCardForm[key] = newElement; - } - - return twoCreditCardForm; -}; - -PlatformConfig.getSavedCreditCards = function (platFormConfig) { - var creditCard = null; - var twoCreditCard = null; - var billetCreditCard = null; - var voucherCard = null; - var debitCard = null; - - if ( - platFormConfig.payment.pagarme_creditcard.enabled_saved_cards && - typeof(platFormConfig.payment.pagarme_creditcard.cards != "undefined") - ) { - creditCard = platFormConfig.payment.pagarme_creditcard.cards; - } - - if ( - platFormConfig.payment.pagarme_voucher.enabled_saved_cards && - typeof(platFormConfig.payment.pagarme_voucher.cards != "undefined") - ) { - voucherCard = platFormConfig.payment.pagarme_voucher.cards; - } - - if ( - platFormConfig.payment.pagarme_two_creditcard.enabled_saved_cards && - typeof(platFormConfig.payment.pagarme_two_creditcard.cards != "undefined") - ) { - twoCreditCard = platFormConfig.payment.pagarme_two_creditcard.cards; - } - - if ( - platFormConfig.payment.pagarme_billet_creditcard.enabled_saved_cards && - typeof(platFormConfig.payment.pagarme_billet_creditcard.cards != "undefined") - ) { - billetCreditCard = platFormConfig.payment.pagarme_billet_creditcard.cards; - } - - if ( - platFormConfig.payment.pagarme_debit.enabled_saved_cards && - typeof(platFormConfig.payment.pagarme_debit.cards != "undefined") - ) { - debitCard = platFormConfig.payment.pagarme_debit.cards; - } - - return { - "pagarme_creditcard": creditCard, - "pagarme_two_creditcard": twoCreditCard, - "pagarme_billet_creditcard": billetCreditCard, - "pagarme_voucher": voucherCard, - "pagarme_debit": debitCard - }; -}; diff --git a/view/frontend/web/js/core/checkout/PlatformFormHandler.js b/view/frontend/web/js/core/checkout/PlatformFormHandler.js index 620216ed..91273cfa 100644 --- a/view/frontend/web/js/core/checkout/PlatformFormHandler.js +++ b/view/frontend/web/js/core/checkout/PlatformFormHandler.js @@ -1,234 +1,225 @@ -var FormHandler = function () { - formObject = {} -}; - -FormHandler.prototype.init = function (formObject) { - this.formObject = formObject; -}; - -FormHandler.prototype.switchBrand = function (brand) { - const brandsSelector = this.formObject.containerSelector + ' .brands'; - const brandElement = this.formObject.creditCardBrand; - - jQuery(brandsSelector).css('filter', 'grayscale(100%) opacity(60%)'); - - if(typeof brand != 'undefined' && brand.length > 0){ - const brandSelector = - this.formObject.containerSelector + ' .' + - brand.toLowerCase(); - - jQuery(brandSelector).css('filter', 'none'); - brandElement.val(brand); - - if (brandElement.val() !== 'default' && brandElement.val() !== '') { - brandElement.change(); +define(['jquery'], ($) => { + return class FormHandler { + constructor() { + this.formObject = {} } - - return; - } - - brandElement.val(''); -}; - -FormHandler.prototype.updateInstallmentSelect = function (installmentsObj, element, installmentSelected = null) { - var content = ""; - for (var i = 0, len = installmentsObj.length; i < len; i++) { - content += - ""; - } - - element.html(content); - - for (var i = 0; i < element[0].length; i++) { - var option = element[0].options[i]; - if (option.value == installmentSelected) { - element.val(installmentSelected); + init(formObject) { + this.formObject = formObject; } - } -}; - -FormHandler.prototype.fillBrandList = function (brandsObject, formObject) { - var html = ''; - - for (var i = 0, len = brandsObject.length; i < len; i++) { - if (!brandsObject[i]) continue; - html += - "
  • " + - "" + - "
  • "; - } + switchBrand(brand) { + const brandsSelector = this.formObject.containerSelector + ' .brands'; + const brandElement = this.formObject.creditCardBrand; - if (html == '') { - jQuery(formObject.containerSelector).find(".nobrand").show(); - } - - jQuery(formObject.containerSelector + ' .credit-card-types').html(html); -}; - -FormHandler.prototype.hideInputAmount = function () { - jQuery(this.formObject.containerSelector).find('.amount').hide(); -}; - -FormHandler.prototype.removeInstallmentsSelect = function () { - jQuery(this.formObject.containerSelector).find('.installments').remove(); -} + $(brandsSelector).css('filter', 'grayscale(100%) opacity(60%)'); -FormHandler.prototype.removeSavedCardsSelect = function (form) { - jQuery(this.formObject.containerSelector).find('.choice').remove(); -} + if(typeof brand != 'undefined' && brand.length > 0){ + const brandSelector = + this.formObject.containerSelector + ' .' + + brand.toLowerCase(); -FormHandler.prototype.fillExpirationYearSelect = function (formText, method, value = null) { + $(brandSelector).css('filter', 'none'); + brandElement.val(brand); - var html = ''; - var years = Object.keys(formText.years[method]); - var len = years.length; + if (brandElement.val() !== 'default' && brandElement.val() !== '') { + brandElement.change(); + } - for (var i = 0; i < len; i++) { - html += - "" - ; - } - - jQuery(this.formObject.creditCardExpYear).html(html); + return; + } - if (value != null) { - this.formObject.creditCardExpYear.val(value); - } -}; - -FormHandler.prototype.fillExpirationMonthSelect = function (formText, method, value = null) { - - var html = ''; - var months = formText.months[method]; - var monthKeys = Object.keys(months); - var len = monthKeys.length; - - for (var i = 0; i < len; i++) { - html += - "" - ; - } + brandElement.val(''); + } + updateInstallmentSelect(installmentsObj, element, installmentSelected = null) { + let content = ""; + for (let i = 0, len = installmentsObj.length; i < len; i++) { + content += + ""; + } - jQuery(this.formObject.creditCardExpMonth).html(html); + element.html(content); - if (value != null) { - this.formObject.creditCardExpMonth.val(value); - } -}; + for (let i = 0; i < element[0].length; i++) { + const option = element[0].options[i]; + if (option.value == installmentSelected) { + element.val(installmentSelected); + } + } + } + fillBrandList(brandsObject, formObject) { + let html = ''; + + for (let i = 0, len = brandsObject.length; i < len; i++) { + if (!brandsObject[i]) continue; + html += + "
  • " + + "" + + "
  • "; + } -FormHandler.prototype.fillSavedCreditCardsSelect = function (platformConfig, formObject) { - var html = ''; - var cards = platformConfig.savedAllCards[formObject.savedCardSelectUsed] + if (html == '') { + $(formObject.containerSelector).find(".nobrand").show(); + } - var brands = []; - platformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { - brands.push(item.title); - }) + $(formObject.containerSelector + ' .credit-card-types').html(html); + } + hideInputAmount() { + $(this.formObject.containerSelector).find('.amount').hide(); + } + removeInstallmentsSelect = function () { + $(this.formObject.containerSelector).find('.installments').remove(); + } + removeSavedCardsSelect = function () { + $(this.formObject.containerSelector).find('.choice').remove(); + } + fillExpirationYearSelect(formText, method, value = null) { + + let html = ''; + const years = Object.keys(formText.years[method]); + const len = years.length; + + for (let i = 0; i < len; i++) { + html += + "" + ; + } - if (cards) { - var cardKeys = Object.keys(cards); - var len = cardKeys.length; + $(this.formObject.creditCardExpYear).html(html); - for (var i = 0; i < len; i++) { + if (value != null) { + this.formObject.creditCardExpYear.val(value); + } + } + fillExpirationMonthSelect(formText, method, value = null) { + + let html = ''; + const months = formText.months[method]; + const monthKeys = Object.keys(months); + const len = monthKeys.length; + + for (let i = 0; i < len; i++) { + html += + "" + ; + } - var hasBrand = brands.includes(cards[i].brand); + $(this.formObject.creditCardExpMonth).html(html); - if (!hasBrand) { - continue; + if (value != null) { + this.formObject.creditCardExpMonth.val(value); } - - html += - "" - ; } - } + fillSavedCreditCardsSelect = function (platformConfig, formObject) { + let html = ''; + const cards = platformConfig.savedAllCards[formObject.savedCardSelectUsed] + + const brands = []; + platformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { + brands.push(item.title); + }) + + if (cards) { + const cardKeys = Object.keys(cards); + const len = cardKeys.length; + + for (let i = 0; i < len; i++) { + + const hasBrand = brands.includes(cards[i].brand); + + if (!hasBrand) { + continue; + } + + html += + "" + ; + } + } - if (html.length > 0 && formObject.savedCreditCardSelect.val() != "new") { - jQuery(formObject.containerSelector + ' .new').hide(); - jQuery(formObject.containerSelector).find('.saved').show(); + if (html.length > 0 && formObject.savedCreditCardSelect.val() != "new") { + $(formObject.containerSelector + ' .new').hide(); + $(formObject.containerSelector).find('.saved').show(); - html += ""; - jQuery(formObject.savedCreditCardSelect).html(html); - } -}; + html += ""; + $(formObject.savedCreditCardSelect).html(html); + } + } + fillMultibuyerStateSelect(platformConfig, formObject) { + let html = ""; + const states = platformConfig.region_states; -FormHandler.prototype.fillMultibuyerStateSelect = function (platformConfig, formObject) { - var html = ""; - var states = platformConfig.region_states; + if (states) { + const stateKeys = Object.keys(states); + const len = stateKeys.length; - if (states) { - var stateKeys = Object.keys(states); - var len = stateKeys.length; + for (let i = 0; i < len; i++) { - for (var i = 0; i < len; i++) { + const name = states[i].name || states[i].default_name; - var name = states[i].name || states[i].default_name; + html += + "" + ; + } + } - "'>" + - name + - "" - ; + if (html.length > 0) { + $(formObject.multibuyer.state).html(html); + } } - } - - if (html.length > 0) { - jQuery(formObject.multibuyer.state).html(html); - } -}; - -FormHandler.prototype.removeMultibuyerForm = function (formObject) { - jQuery(formObject.containerSelector + ' .multibuyer').remove(); - jQuery(formObject.containerSelector + ' .show_multibuyer_box').remove(); -} - -FormHandler.prototype.toggleMultibuyer = function (formObject) { - if (formObject.multibuyer.showMultibuyer.prop('checked')) { - - if (formObject.saveThisCard !== undefined) { - formObject.saveThisCard.parent().hide(); + removeMultibuyerForm(formObject) { + $(formObject.containerSelector + ' .multibuyer').remove(); + $(formObject.containerSelector + ' .show_multibuyer_box').remove(); } - jQuery(formObject.containerSelector + ' .multibuyer').show(); - return; - } + toggleMultibuyer(formObject) { + if (formObject.multibuyer.showMultibuyer.prop('checked')) { + + if (formObject.saveThisCard !== undefined) { + formObject.saveThisCard.parent().hide(); + } + $(formObject.containerSelector + ' .multibuyer').show(); + return; + } - if (formObject.saveThisCard !== undefined) { - formObject.saveThisCard.parent().show(); + if (formObject.saveThisCard !== undefined) { + formObject.saveThisCard.parent().show(); + } + $(formObject.containerSelector + ' .multibuyer').hide(); + return; + } } - jQuery(formObject.containerSelector + ' .multibuyer').hide(); - return; -} +}); diff --git a/view/frontend/web/js/core/checkout/PlatformPlaceOrder.js b/view/frontend/web/js/core/checkout/PlatformPlaceOrder.js index 8ce5a379..9e44d4b8 100644 --- a/view/frontend/web/js/core/checkout/PlatformPlaceOrder.js +++ b/view/frontend/web/js/core/checkout/PlatformPlaceOrder.js @@ -1,12 +1,15 @@ -const PlatformPlaceOrder = function (platformObject, data, event) { - this.platformObject = platformObject; - this.data = data; - this.event = event; -} - -PlatformPlaceOrder.prototype.placeOrder = function() { - return this.platformObject.placeOrder( - this.data, - this.event - ); -} \ No newline at end of file +define([], () => { + return class PlatformPlaceOrder { + constructor(platformObject, data, event) { + this.platformObject = platformObject; + this.data = data; + this.event = event; + } + placeOrder = function() { + return this.platformObject.placeOrder( + this.data, + this.event + ); + } + } +}); diff --git a/view/frontend/web/js/core/models/BoletoCreditcardModel.js b/view/frontend/web/js/core/models/BoletoCreditcardModel.js index 7ae76b89..a5ad6101 100644 --- a/view/frontend/web/js/core/models/BoletoCreditcardModel.js +++ b/view/frontend/web/js/core/models/BoletoCreditcardModel.js @@ -1,187 +1,188 @@ -var BoletoCreditcardModel= function (formObject, publicKey) { - this.formObject = formObject; - this.publicKey = publicKey; - this.modelToken = new CreditCardToken(this.formObject); - this.errors = []; - this.formIds = [0, 1]; -}; - -BoletoCreditcardModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - var _self = this; - var errors = false; - - for (id in this.formObject) { - - if (id != 1) { - continue; - } - - if ( - typeof this.formObject[id].savedCreditCardSelect.val() != 'undefined' && - this.formObject[id].savedCreditCardSelect.val() != 'new' && - this.formObject[id].savedCreditCardSelect.val() != '' && - this.formObject[id].savedCreditCardSelect.html().length > 1 - ) { - continue; - } - - this.getCreditCardToken( - this.formObject[id], - function (data) { - _self.formObject[id].creditCardToken.val(data.id); - }, - function (error) { - errors = true; - _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); - } - ); - } - - if (!errors) { - _self.placeOrderObject.placeOrder(); - } -}; - -BoletoCreditcardModel.prototype.getFormIdInverted = function (id) { - var ids = this.formIds.slice(0); - var index = ids.indexOf(id); - ids.splice(index, 1); - - return ids[0]; -} - -BoletoCreditcardModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -BoletoCreditcardModel.prototype.getCreditCardToken = function (formObject, success, error) { - var modelToken = new CreditCardToken(formObject); - modelToken.getToken(this.publicKey) - .done(success) - .fail(error); -}; - -BoletoCreditcardModel.prototype.validate = function () { - - var formsInvalid = []; - - for (id in this.formObject) { - - if (id.length > 1) { - continue; - } - var multibuyerValidator = new MultibuyerValidator(this.formObject[id]); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isMultibuyerValid) { - continue; - } - - formsInvalid.push(true); - } - - var creditCardValidator = new CreditCardValidator(this.formObject[1]); - var isCreditCardValid = creditCardValidator.validate(); - - formsInvalid.push(!isCreditCardValid); - - var hasFormInvalid = formsInvalid.filter(function (item) { - return item; - }); - - if (hasFormInvalid.length > 0) { - return false; - } - - return true; -}; - -BoletoCreditcardModel.prototype.getData = function () { - - saveThiscard = 0; - - if (this.formObject[1].saveThisCard.prop('checked') === 'on') { - saveThiscard = 1; - } - - var data = { - 'method': "pagarme_billet_creditcard", - 'additional_data': { - //boleto - 'cc_billet_amount': this.formObject[0].inputAmount.val(), - //credit_card - 'cc_cc_amount': this.formObject[1].inputAmount.val(), - 'cc_cc_tax_amount': this.formObject[1].creditCardInstallments.find(':selected').attr('interest'), - 'cc_type': this.formObject[1].creditCardBrand.val(), - 'cc_last_4': this.getLastFourNumbers(1), - 'cc_cid': this.formObject[1].creditCardCvv.val(), - 'cc_ss_start_year': this.formObject[1].creditCardExpYear.val(), - 'cc_ss_start_month': this.formObject[1].creditCardExpMonth.val(), - 'cc_number': this.formObject[1].creditCardNumber.val(), - 'cc_owner': this.formObject[1].creditCardHolderName.val(), - 'cc_savecard': saveThiscard, - 'cc_saved_card': this.formObject[1].savedCreditCardSelect.val(), - 'cc_installments': this.formObject[1].creditCardInstallments.val(), - 'cc_token_credit_card': this.formObject[1].creditCardToken.val(), - } - } - - if ( - typeof this.formObject[0].multibuyer != 'undefined' && - typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' && - this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - multibuyer = this.formObject[0].multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.billet_buyer_checkbox = 1; - data.additional_data.billet_buyer_name = fullName; - data.additional_data.billet_buyer_email = multibuyer.email.val(); - data.additional_data.billet_buyer_document = multibuyer.document.val(); - data.additional_data.billet_buyer_street_title = multibuyer.street.val(); - data.additional_data.billet_buyer_street_number = multibuyer.number.val(); - data.additional_data.billet_buyer_street_complement = multibuyer.complement.val(); - data.additional_data.billet_buyer_zipcode = multibuyer.zipcode.val(); - data.additional_data.billet_buyer_neighborhood = multibuyer.neighborhood.val(); - data.additional_data.billet_buyer_city = multibuyer.city.val(); - data.additional_data.billet_buyer_state = multibuyer.state.val(); - data.additional_data.billet_buyer_home_phone = multibuyer.homePhone.val(); - data.additional_data.billet_buyer_mobile_phone = multibuyer.mobilePhone.val(); - } - - if ( - typeof this.formObject[1].multibuyer != 'undefined' && - typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' && - this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - multibuyer = this.formObject[1].multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.cc_buyer_checkbox = 1; - data.additional_data.cc_buyer_name = fullName; - data.additional_data.cc_buyer_email = multibuyer.email.val(); - data.additional_data.cc_buyer_document = multibuyer.document.val(); - data.additional_data.cc_buyer_street_title = multibuyer.street.val(); - data.additional_data.cc_buyer_street_number = multibuyer.number.val(); - data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(); - data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(); - data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(); - data.additional_data.cc_buyer_city = multibuyer.city.val(); - data.additional_data.cc_buyer_state = multibuyer.state.val(); - data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(); - data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val(); - } - - return data; -}; - -BoletoCreditcardModel.prototype.getLastFourNumbers = function(id) { - var number = this.formObject[id].creditCardNumber.val(); - if (number !== undefined) { - return number.slice(-4); - } - return ""; -} +define([ + 'Pagarme_Pagarme/js/core/validators/CreditCardValidator', + 'Pagarme_Pagarme/js/core/validators/MultibuyerValidator', + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', +], (CreditCardValidator, MultibuyerValidator, CreditCardToken) => { + return class BoletoCreditcardModel { + constructor(formObject, publicKey) { + this.formObject = formObject; + this.publicKey = publicKey; + this.modelToken = new CreditCardToken(this.formObject); + this.errors = []; + this.formIds = [0, 1]; + } + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + const _self = this; + let errors = false; + + for (const id in this.formObject) { + + if (id != 1) { + continue; + } + + if ( + typeof this.formObject[id].savedCreditCardSelect.val() != 'undefined' && + this.formObject[id].savedCreditCardSelect.val() != 'new' && + this.formObject[id].savedCreditCardSelect.val() != '' && + this.formObject[id].savedCreditCardSelect.html().length > 1 + ) { + continue; + } + + this.getCreditCardToken( + this.formObject[id], + function (data) { + _self.formObject[id].creditCardToken.val(data.id); + }, + function (error) { + errors = true; + _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); + } + ); + } + + if (!errors) { + _self.placeOrderObject.placeOrder(); + } + } + getFormIdInverted(id) { + const ids = this.formIds.slice(0); + const index = ids.indexOf(id); + ids.splice(index, 1); + + return ids[0]; + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + getCreditCardToken(formObject, success, error) { + const modelToken = new CreditCardToken(formObject); + modelToken.getToken(this.publicKey) + .done(success) + .fail(error); + } + validate() { + + const formsInvalid = []; + + for (const id in this.formObject) { + + if (id.length > 1) { + continue; + } + const multibuyerValidator = new MultibuyerValidator(this.formObject[id]); + const isMultibuyerValid = multibuyerValidator.validate(); + + if (isMultibuyerValid) { + continue; + } + + formsInvalid.push(true); + } + + const creditCardValidator = new CreditCardValidator(this.formObject[1]); + const isCreditCardValid = creditCardValidator.validate(); + + formsInvalid.push(!isCreditCardValid); + + const hasFormInvalid = formsInvalid.filter(function (item) { + return item; + }); + + if (hasFormInvalid.length > 0) { + return false; + } + + return true; + } + getData() { + + let saveThiscard = 0; + + if (this.formObject[1].saveThisCard.prop('checked') === 'on') { + saveThiscard = 1; + } + + const data = { + 'method': "pagarme_billet_creditcard", + 'additional_data': { + //boleto + 'cc_billet_amount': this.formObject[0].inputAmount.val(), + //credit_card + 'cc_cc_amount': this.formObject[1].inputAmount.val(), + 'cc_cc_tax_amount': this.formObject[1].creditCardInstallments.find(':selected').attr('interest'), + 'cc_type': this.formObject[1].creditCardBrand.val(), + 'cc_last_4': this.getLastFourNumbers(1), + 'cc_cid': this.formObject[1].creditCardCvv.val(), + 'cc_ss_start_year': this.formObject[1].creditCardExpYear.val(), + 'cc_ss_start_month': this.formObject[1].creditCardExpMonth.val(), + 'cc_number': this.formObject[1].creditCardNumber.val(), + 'cc_owner': this.formObject[1].creditCardHolderName.val(), + 'cc_savecard': saveThiscard, + 'cc_saved_card': this.formObject[1].savedCreditCardSelect.val(), + 'cc_installments': this.formObject[1].creditCardInstallments.val(), + 'cc_token_credit_card': this.formObject[1].creditCardToken.val(), + } + } + + if ( + typeof this.formObject[0].multibuyer != 'undefined' && + typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' && + this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + const multibuyer = this.formObject[0].multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.billet_buyer_checkbox = 1; + data.additional_data.billet_buyer_name = fullName; + data.additional_data.billet_buyer_email = multibuyer.email.val(); + data.additional_data.billet_buyer_document = multibuyer.document.val(); + data.additional_data.billet_buyer_street_title = multibuyer.street.val(); + data.additional_data.billet_buyer_street_number = multibuyer.number.val(); + data.additional_data.billet_buyer_street_complement = multibuyer.complement.val(); + data.additional_data.billet_buyer_zipcode = multibuyer.zipcode.val(); + data.additional_data.billet_buyer_neighborhood = multibuyer.neighborhood.val(); + data.additional_data.billet_buyer_city = multibuyer.city.val(); + data.additional_data.billet_buyer_state = multibuyer.state.val(); + data.additional_data.billet_buyer_home_phone = multibuyer.homePhone.val(); + data.additional_data.billet_buyer_mobile_phone = multibuyer.mobilePhone.val(); + } + + if ( + typeof this.formObject[1].multibuyer != 'undefined' && + typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' && + this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + const multibuyer = this.formObject[1].multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox = 1; + data.additional_data.cc_buyer_name = fullName; + data.additional_data.cc_buyer_email = multibuyer.email.val(); + data.additional_data.cc_buyer_document = multibuyer.document.val(); + data.additional_data.cc_buyer_street_title = multibuyer.street.val(); + data.additional_data.cc_buyer_street_number = multibuyer.number.val(); + data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(); + data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(); + data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(); + data.additional_data.cc_buyer_city = multibuyer.city.val(); + data.additional_data.cc_buyer_state = multibuyer.state.val(); + data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(); + data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val(); + } + + return data; + } + getLastFourNumbers(id) { + const number = this.formObject[id].creditCardNumber.val(); + if (number !== undefined) { + return number.slice(-4); + } + return ""; + } + } +}); diff --git a/view/frontend/web/js/core/models/BoletoModel.js b/view/frontend/web/js/core/models/BoletoModel.js index 79e8dc7e..11b3841a 100644 --- a/view/frontend/web/js/core/models/BoletoModel.js +++ b/view/frontend/web/js/core/models/BoletoModel.js @@ -1,61 +1,61 @@ -var BoletoModel = function (formObject) { - this.formObject = formObject; - this.errors = []; -}; - -BoletoModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - this.placeOrderObject.placeOrder(); -} - -BoletoModel.prototype.validate = function () { - - var multibuyerValidator = new MultibuyerValidator(this.formObject); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isMultibuyerValid) { - return true; +define(['Pagarme_Pagarme/js/core/validators/MultibuyerValidator'], (MultibuyerValidator) => { + return class BoletoModel { + constructor(formObject) { + this.formObject = formObject; + this.errors = []; + } + placeOrder = function (placeOrderObject) { + this.placeOrderObject = placeOrderObject; + this.placeOrderObject.placeOrder(); + } + validate() { + + const multibuyerValidator = new MultibuyerValidator(this.formObject); + const isMultibuyerValid = multibuyerValidator.validate(); + + if (isMultibuyerValid) { + return true; + } + + return false; + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + getData() { + + const data = { + 'method': "pagarme_billet", + 'additional_data': {} + }; + + if ( + typeof this.formObject.multibuyer != 'undefined' && + typeof this.formObject.multibuyer.showMultibuyer != 'undefined' && + this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + + const multibuyer = this.formObject.multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.billet_buyer_checkbox = 1; + data.additional_data.billet_buyer_name = fullName; + data.additional_data.billet_buyer_email = multibuyer.email.val(); + data.additional_data.billet_buyer_document = multibuyer.document.val(); + data.additional_data.billet_buyer_street_title = multibuyer.street.val(); + data.additional_data.billet_buyer_street_number = multibuyer.number.val(); + data.additional_data.billet_buyer_street_complement = multibuyer.complement.val(); + data.additional_data.billet_buyer_zipcode = multibuyer.zipcode.val(); + data.additional_data.billet_buyer_neighborhood = multibuyer.neighborhood.val(); + data.additional_data.billet_buyer_city = multibuyer.city.val(); + data.additional_data.billet_buyer_state = multibuyer.state.val(); + data.additional_data.billet_buyer_home_phone = multibuyer.homePhone.val(); + data.additional_data.billet_buyer_mobile_phone = multibuyer.mobilePhone.val(); + } + + return data; + } } - - return false; -}; - -BoletoModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -BoletoModel.prototype.getData = function () { - - data = { - 'method': "pagarme_billet", - 'additional_data': {} - }; - - if ( - typeof this.formObject.multibuyer != 'undefined' && - typeof this.formObject.multibuyer.showMultibuyer != 'undefined' && - this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - - multibuyer = this.formObject.multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.billet_buyer_checkbox = 1; - data.additional_data.billet_buyer_name = fullName; - data.additional_data.billet_buyer_email = multibuyer.email.val(); - data.additional_data.billet_buyer_document = multibuyer.document.val(); - data.additional_data.billet_buyer_street_title = multibuyer.street.val(); - data.additional_data.billet_buyer_street_number = multibuyer.number.val(); - data.additional_data.billet_buyer_street_complement = multibuyer.complement.val(); - data.additional_data.billet_buyer_zipcode = multibuyer.zipcode.val(); - data.additional_data.billet_buyer_neighborhood = multibuyer.neighborhood.val(); - data.additional_data.billet_buyer_city = multibuyer.city.val(); - data.additional_data.billet_buyer_state = multibuyer.state.val(); - data.additional_data.billet_buyer_home_phone = multibuyer.homePhone.val(); - data.additional_data.billet_buyer_mobile_phone = multibuyer.mobilePhone.val(); - } - - return data; -} +}); diff --git a/view/frontend/web/js/core/models/CreditCardModel.js b/view/frontend/web/js/core/models/CreditCardModel.js index 33290eb1..6de6d852 100644 --- a/view/frontend/web/js/core/models/CreditCardModel.js +++ b/view/frontend/web/js/core/models/CreditCardModel.js @@ -1,129 +1,128 @@ -var CreditCardModel = function (formObject, publicKey) { - this.formObject = formObject; - this.publicKey = publicKey; - this.errors = []; -}; - -CreditCardModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - var _self = this; - - if ( - typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && - _self.formObject.savedCreditCardSelect.html().length > 1 && - _self.formObject.savedCreditCardSelect.val() != 'new' && - _self.formObject.savedCreditCardSelect.val() != '' - ) { - _self.placeOrderObject.placeOrder(); - return; - } - - this.getCreditCardToken( - function (data) { - _self.formObject.creditCardToken.val(data.id); - _self.placeOrderObject.placeOrder(); - }, - function (error) { - var errors = error.responseJSON; - _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); +define([ + 'Pagarme_Pagarme/js/core/validators/CreditCardValidator', + 'Pagarme_Pagarme/js/core/validators/MultibuyerValidator', + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', +], (CreditCardValidator, MultibuyerValidator, CreditCardToken) => { + return class CreditCardModel { + constructor(formObject, publicKey) { + this.formObject = formObject; + this.publicKey = publicKey; + this.errors = []; } - ); -}; - -CreditCardModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -CreditCardModel.prototype.validate = function () { - - var creditCardValidator = new CreditCardValidator(this.formObject); - var isCreditCardValid = creditCardValidator.validate(); - - var multibuyerValidator = new MultibuyerValidator(this.formObject); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isCreditCardValid && isMultibuyerValid) { - return true; - } - - return false; -}; - -CreditCardModel.prototype.getCreditCardToken = function (success, error) { - var modelToken = new CreditCardToken(this.formObject); - modelToken.getToken(this.publicKey) - .done(success) - .fail(error); -}; - -CreditCardModel.prototype.getData = function () { - saveThiscard = 0; - var formObject = this.formObject; - - if (formObject.saveThisCard.prop( "checked" )) { - saveThiscard = 1; - } - - data = this.fillData(); - data.additional_data.cc_buyer_checkbox = false; + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + const _self = this; + + if ( + typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && + _self.formObject.savedCreditCardSelect.html().length > 1 && + _self.formObject.savedCreditCardSelect.val() != 'new' && + _self.formObject.savedCreditCardSelect.val() != '' + ) { + _self.placeOrderObject.placeOrder(); + return; + } + + this.getCreditCardToken( + function (data) { + _self.formObject.creditCardToken.val(data.id); + _self.placeOrderObject.placeOrder(); + }, + function (error) { + _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); + } + ); + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + validate() { - if ( - typeof formObject.multibuyer != 'undefined' && - formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - data = this.fillMultibuyerData(data); - } + const creditCardValidator = new CreditCardValidator(this.formObject); + const isCreditCardValid = creditCardValidator.validate(); - return data; -}; + const multibuyerValidator = new MultibuyerValidator(this.formObject); + const isMultibuyerValid = multibuyerValidator.validate(); -CreditCardModel.prototype.fillData = function() { - var formObject = this.formObject; + if (isCreditCardValid && isMultibuyerValid) { + return true; + } - return { - 'method': "pagarme_creditcard", - 'additional_data': { - 'cc_type': formObject.creditCardBrand.val(), - 'cc_last_4': this.getLastFourNumbers(), - 'cc_exp_year': formObject.creditCardExpYear.val(), - 'cc_exp_month': formObject.creditCardExpMonth.val(), - 'cc_owner': formObject.creditCardHolderName.val(), - 'cc_savecard': saveThiscard, - 'cc_saved_card': formObject.savedCreditCardSelect.val(), - 'cc_installments': formObject.creditCardInstallments.val(), - 'cc_token_credit_card': formObject.creditCardToken.val(), - 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest') + return false; + } + getCreditCardToken(success, error) { + const modelToken = new CreditCardToken(this.formObject); + modelToken.getToken(this.publicKey) + .done(success) + .fail(error); } - }; -}; + getData() { + this.saveThiscard = 0; + const formObject = this.formObject; -CreditCardModel.prototype.fillMultibuyerData = function(data) { - multibuyer = this.formObject.multibuyer; - fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + if (formObject.saveThisCard.prop( "checked" )) { + this.saveThiscard = 1; + } - data.additional_data.cc_buyer_checkbox = 1, - data.additional_data.cc_buyer_name = fullname, - data.additional_data.cc_buyer_email = multibuyer.email.val(), - data.additional_data.cc_buyer_document = multibuyer.document.val(), - data.additional_data.cc_buyer_street_title = multibuyer.street.val(), - data.additional_data.cc_buyer_street_number = multibuyer.number.val(), - data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), - data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), - data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), - data.additional_data.cc_buyer_city = multibuyer.city.val(), - data.additional_data.cc_buyer_state = multibuyer.state.val(), - data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), - data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() + let data = this.fillData(); + data.additional_data.cc_buyer_checkbox = false; - return data; -}; + if ( + typeof formObject.multibuyer != 'undefined' && + formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + data = this.fillMultibuyerData(data); + } -CreditCardModel.prototype.getLastFourNumbers = function() { - var number = this.formObject.creditCardNumber.val(); - if (number !== undefined) { - return number.slice(-4); + return data; + } + fillData() { + const formObject = this.formObject; + + return { + 'method': "pagarme_creditcard", + 'additional_data': { + 'cc_type': formObject.creditCardBrand.val(), + 'cc_last_4': this.getLastFourNumbers(), + 'cc_exp_year': formObject.creditCardExpYear.val(), + 'cc_exp_month': formObject.creditCardExpMonth.val(), + 'cc_owner': formObject.creditCardHolderName.val(), + 'cc_savecard': this.saveThiscard, + 'cc_saved_card': formObject.savedCreditCardSelect.val(), + 'cc_installments': formObject.creditCardInstallments.val(), + 'cc_token_credit_card': formObject.creditCardToken.val(), + 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest') + } + }; + } + fillMultibuyerData(data) { + const multibuyer = this.formObject.multibuyer; + const fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox = 1, + data.additional_data.cc_buyer_name = fullname, + data.additional_data.cc_buyer_email = multibuyer.email.val(), + data.additional_data.cc_buyer_document = multibuyer.document.val(), + data.additional_data.cc_buyer_street_title = multibuyer.street.val(), + data.additional_data.cc_buyer_street_number = multibuyer.number.val(), + data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), + data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), + data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), + data.additional_data.cc_buyer_city = multibuyer.city.val(), + data.additional_data.cc_buyer_state = multibuyer.state.val(), + data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), + data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() + + return data; + } + getLastFourNumbers() { + const number = this.formObject.creditCardNumber.val(); + if (number !== undefined) { + return number.slice(-4); + } + return ""; + } } - return ""; -}; +}); diff --git a/view/frontend/web/js/core/models/DebitModel.js b/view/frontend/web/js/core/models/DebitModel.js index a11548af..e0456ac2 100644 --- a/view/frontend/web/js/core/models/DebitModel.js +++ b/view/frontend/web/js/core/models/DebitModel.js @@ -1,129 +1,128 @@ -var DebitModel = function (formObject, publicKey) { - this.formObject = formObject; - this.publicKey = publicKey; - this.errors = []; -}; - -DebitModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - var _self = this; - - if ( - typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && - _self.formObject.savedCreditCardSelect.html().length > 1 && - _self.formObject.savedCreditCardSelect.val() != 'new' && - _self.formObject.savedCreditCardSelect.val() != '' - ) { - _self.placeOrderObject.placeOrder(); - return; - } - - this.getCreditCardToken( - function (data) { - _self.formObject.creditCardToken.val(data.id); - _self.placeOrderObject.placeOrder(); - }, - function (error) { - var errors = error.responseJSON; - _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); +define([ + 'Pagarme_Pagarme/js/core/validators/CreditCardValidator', + 'Pagarme_Pagarme/js/core/validators/MultibuyerValidator', + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', +], (CreditCardValidator, MultibuyerValidator, CreditCardToken) => { + return class DebitModel { + constructor(formObject, publicKey) { + this.formObject = formObject; + this.publicKey = publicKey; + this.errors = []; } - ); -}; - -DebitModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -DebitModel.prototype.validate = function () { - - var creditCardValidator = new CreditCardValidator(this.formObject); - var isCreditCardValid = creditCardValidator.validate(); - - var multibuyerValidator = new MultibuyerValidator(this.formObject); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isCreditCardValid && isMultibuyerValid) { - return true; - } - - return false; -}; + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + const _self = this; + + if ( + typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && + _self.formObject.savedCreditCardSelect.html().length > 1 && + _self.formObject.savedCreditCardSelect.val() != 'new' && + _self.formObject.savedCreditCardSelect.val() != '' + ) { + _self.placeOrderObject.placeOrder(); + return; + } + + this.getCreditCardToken( + function (data) { + _self.formObject.creditCardToken.val(data.id); + _self.placeOrderObject.placeOrder(); + }, + function (error) { + _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); + } + ); + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + validate() { -DebitModel.prototype.getCreditCardToken = function (success, error) { - var modelToken = new CreditCardToken(this.formObject); - modelToken.getToken(this.publicKey) - .done(success) - .fail(error); -}; + const creditCardValidator = new CreditCardValidator(this.formObject); + const isCreditCardValid = creditCardValidator.validate(); -DebitModel.prototype.getData = function () { - saveThiscard = 0; - var formObject = this.formObject; + const multibuyerValidator = new MultibuyerValidator(this.formObject); + const isMultibuyerValid = multibuyerValidator.validate(); - if (formObject.saveThisCard.prop( "checked" )) { - saveThiscard = 1; - } + if (isCreditCardValid && isMultibuyerValid) { + return true; + } - data = this.fillData(); - data.additional_data.cc_buyer_checkbox = false; + return false; + } + getCreditCardToken(success, error) { + const modelToken = new CreditCardToken(this.formObject); + modelToken.getToken(this.publicKey) + .done(success) + .fail(error); + } + getData() { + this.saveThiscard = 0; + const formObject = this.formObject; - if ( - typeof formObject.multibuyer != 'undefined' && - formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - data = this.fillMultibuyerData(data); - } + if (formObject.saveThisCard.prop( "checked" )) { + this.saveThiscard = 1; + } - return data; -}; + let data = this.fillData(); + data.additional_data.cc_buyer_checkbox = false; -DebitModel.prototype.fillData = function() { - var formObject = this.formObject; + if ( + typeof formObject.multibuyer != 'undefined' && + formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + data = this.fillMultibuyerData(data); + } - return { - 'method': "pagarme_debit", - 'additional_data': { - 'cc_type': formObject.creditCardBrand.val(), - 'cc_last_4': this.getLastFourNumbers(), - 'cc_exp_year': formObject.creditCardExpYear.val(), - 'cc_exp_month': formObject.creditCardExpMonth.val(), - 'cc_owner': formObject.creditCardHolderName.val(), - 'cc_savecard': saveThiscard, - 'cc_saved_card': formObject.savedCreditCardSelect.val(), - 'cc_installments': formObject.creditCardInstallments.val(), - 'cc_token_credit_card': formObject.creditCardToken.val(), - 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest') + return data; + } + fillData() { + const formObject = this.formObject; + + return { + 'method': "pagarme_debit", + 'additional_data': { + 'cc_type': formObject.creditCardBrand.val(), + 'cc_last_4': this.getLastFourNumbers(), + 'cc_exp_year': formObject.creditCardExpYear.val(), + 'cc_exp_month': formObject.creditCardExpMonth.val(), + 'cc_owner': formObject.creditCardHolderName.val(), + 'cc_savecard': this.saveThiscard, + 'cc_saved_card': formObject.savedCreditCardSelect.val(), + 'cc_installments': formObject.creditCardInstallments.val(), + 'cc_token_credit_card': formObject.creditCardToken.val(), + 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest') + } + }; + } + fillMultibuyerData(data) { + const multibuyer = this.formObject.multibuyer; + const fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox = 1, + data.additional_data.cc_buyer_name = fullname, + data.additional_data.cc_buyer_email = multibuyer.email.val(), + data.additional_data.cc_buyer_document = multibuyer.document.val(), + data.additional_data.cc_buyer_street_title = multibuyer.street.val(), + data.additional_data.cc_buyer_street_number = multibuyer.number.val(), + data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), + data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), + data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), + data.additional_data.cc_buyer_city = multibuyer.city.val(), + data.additional_data.cc_buyer_state = multibuyer.state.val(), + data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), + data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() + + return data; + } + getLastFourNumbers() { + const number = this.formObject.creditCardNumber.val(); + if (number !== undefined) { + return number.slice(-4); + } + return ""; } }; -}; - -DebitModel.prototype.fillMultibuyerData = function(data) { - multibuyer = this.formObject.multibuyer; - fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.cc_buyer_checkbox = 1, - data.additional_data.cc_buyer_name = fullname, - data.additional_data.cc_buyer_email = multibuyer.email.val(), - data.additional_data.cc_buyer_document = multibuyer.document.val(), - data.additional_data.cc_buyer_street_title = multibuyer.street.val(), - data.additional_data.cc_buyer_street_number = multibuyer.number.val(), - data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), - data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), - data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), - data.additional_data.cc_buyer_city = multibuyer.city.val(), - data.additional_data.cc_buyer_state = multibuyer.state.val(), - data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), - data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() - - return data; -}; - -DebitModel.prototype.getLastFourNumbers = function() { - var number = this.formObject.creditCardNumber.val(); - if (number !== undefined) { - return number.slice(-4); - } - return ""; -}; +}); diff --git a/view/frontend/web/js/core/models/PixModel.js b/view/frontend/web/js/core/models/PixModel.js index 88922163..28db5d83 100644 --- a/view/frontend/web/js/core/models/PixModel.js +++ b/view/frontend/web/js/core/models/PixModel.js @@ -1,60 +1,60 @@ -PixModel = function (formObject) { - this.formObject = formObject; - this.errors = []; -}; - -PixModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - this.placeOrderObject.placeOrder(); -} - -PixModel.prototype.validate = function () { - var multibuyerValidator = new MultibuyerValidator(this.formObject); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isMultibuyerValid) { - return true; - } - - return false; -}; - -PixModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -PixModel.prototype.getData = function () { - - var data = { - 'method': "pagarme_pix", - 'additional_data': {} +define(['Pagarme_Pagarme/js/core/validators/MultibuyerValidator'], (MultibuyerValidator) => { + return class PixModel { + constructor(formObject) { + this.formObject = formObject; + this.errors = []; + } + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + this.placeOrderObject.placeOrder(); + } + validate() { + const multibuyerValidator = new MultibuyerValidator(this.formObject); + const isMultibuyerValid = multibuyerValidator.validate(); + + if (isMultibuyerValid) { + return true; + } + + return false; + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + getData() { + + const data = { + 'method': "pagarme_pix", + 'additional_data': {} + }; + + if ( + typeof this.formObject.multibuyer != 'undefined' && + typeof this.formObject.multibuyer.showMultibuyer != 'undefined' && + this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + + const multibuyer = this.formObject.multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.pix_buyer_checkbox = 1; + data.additional_data.pix_buyer_name = fullName; + data.additional_data.pix_buyer_email = multibuyer.email.val(); + data.additional_data.pix_buyer_document = multibuyer.document.val(); + data.additional_data.pix_buyer_street_title = multibuyer.street.val(); + data.additional_data.pix_buyer_street_number = multibuyer.number.val(); + data.additional_data.pix_buyer_street_complement = multibuyer.complement.val(); + data.additional_data.pix_buyer_zipcode = multibuyer.zipcode.val(); + data.additional_data.pix_buyer_neighborhood = multibuyer.neighborhood.val(); + data.additional_data.pix_buyer_city = multibuyer.city.val(); + data.additional_data.pix_buyer_state = multibuyer.state.val(); + data.additional_data.pix_buyer_home_phone = multibuyer.homePhone.val(); + data.additional_data.pix_buyer_mobile_phone = multibuyer.mobilePhone.val(); + } + + return data; + } }; - - if ( - typeof this.formObject.multibuyer != 'undefined' && - typeof this.formObject.multibuyer.showMultibuyer != 'undefined' && - this.formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - - multibuyer = this.formObject.multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.pix_buyer_checkbox = 1; - data.additional_data.pix_buyer_name = fullName; - data.additional_data.pix_buyer_email = multibuyer.email.val(); - data.additional_data.pix_buyer_document = multibuyer.document.val(); - data.additional_data.pix_buyer_street_title = multibuyer.street.val(); - data.additional_data.pix_buyer_street_number = multibuyer.number.val(); - data.additional_data.pix_buyer_street_complement = multibuyer.complement.val(); - data.additional_data.pix_buyer_zipcode = multibuyer.zipcode.val(); - data.additional_data.pix_buyer_neighborhood = multibuyer.neighborhood.val(); - data.additional_data.pix_buyer_city = multibuyer.city.val(); - data.additional_data.pix_buyer_state = multibuyer.state.val(); - data.additional_data.pix_buyer_home_phone = multibuyer.homePhone.val(); - data.additional_data.pix_buyer_mobile_phone = multibuyer.mobilePhone.val(); - } - - return data; -} +}); diff --git a/view/frontend/web/js/core/models/TwoCreditcardsModel.js b/view/frontend/web/js/core/models/TwoCreditcardsModel.js index 067ae9cd..459dbdb3 100644 --- a/view/frontend/web/js/core/models/TwoCreditcardsModel.js +++ b/view/frontend/web/js/core/models/TwoCreditcardsModel.js @@ -1,204 +1,204 @@ -var TwoCreditcardsModel= function (formObject, publicKey) { - this.formObject = formObject; - this.publicKey = publicKey; - this.modelToken = new CreditCardToken(this.formObject); - this.errors = []; - this.formIds = [0, 1]; -}; - -TwoCreditcardsModel.prototype.validate = function () { - - var formsInvalid = []; - - for (id in this.formObject) { - - if (id.length > 1) { - continue; - } - var creditCardValidator = new CreditCardValidator(this.formObject[id]); - var isCreditCardValid = creditCardValidator.validate(); - - var multibuyerValidator = new MultibuyerValidator(this.formObject[id]); - var isMultibuyerValid = multibuyerValidator.validate(); - - if (isCreditCardValid && isMultibuyerValid) { - continue; - } - - formsInvalid.push(true); - } - - var hasFormInvalid = formsInvalid.filter(function (item) { - return item; - }); - - if (hasFormInvalid.length > 0) { - return false; - } - - return true; -}; - -TwoCreditcardsModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - var _self = this; - var errors = false; - - for (id in this.formObject) { - - if (id.length > 1) { - continue; - } - - if ( - typeof this.formObject[id].savedCreditCardSelect.val() != 'undefined' && - this.formObject[id].savedCreditCardSelect.val() != 'new' && - this.formObject[id].savedCreditCardSelect.val() != '' && - this.formObject[id].savedCreditCardSelect.html().length > 1 - ) { - continue; - } - - this.getCreditCardToken( - this.formObject[id], - function (data) { - _self.formObject[id].creditCardToken.val(data.id); - }, - function (error) { - errors = true; - _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); - } - ); - } - - if (!errors) { - _self.placeOrderObject.placeOrder(); - } -}; - -TwoCreditcardsModel.prototype.getFormIdInverted = function (id) { - var ids = this.formIds.slice(0); - var index = ids.indexOf(id); - ids.splice(index, 1); - - return ids[0]; -} - -TwoCreditcardsModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -TwoCreditcardsModel.prototype.getCreditCardToken = function (formObject, success, error) { - var modelToken = new CreditCardToken(formObject); - modelToken.getToken(this.publicKey) - .done(success) - .fail(error); -}; - -TwoCreditcardsModel.prototype.getData = function () { - var data = this.fillData(); - - if ( - typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' && - this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - multibuyer = this.formObject[0].multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.cc_buyer_checkbox_first = 1; - data.additional_data.cc_buyer_name_first = fullName; - data.additional_data.cc_buyer_email_first = multibuyer.email.val(); - data.additional_data.cc_buyer_document_first = multibuyer.document.val(); - data.additional_data.cc_buyer_street_title_first = multibuyer.street.val(); - data.additional_data.cc_buyer_street_number_first = multibuyer.number.val(); - data.additional_data.cc_buyer_street_complement_first = multibuyer.complement.val(); - data.additional_data.cc_buyer_zipcode_first = multibuyer.zipcode.val(); - data.additional_data.cc_buyer_neighborhood_first = multibuyer.neighborhood.val(); - data.additional_data.cc_buyer_city_first = multibuyer.city.val(); - data.additional_data.cc_buyer_state_first = multibuyer.state.val(); - data.additional_data.cc_buyer_home_phone_first = multibuyer.homePhone.val(); - data.additional_data.cc_buyer_mobile_phone_first = multibuyer.mobilePhone.val(); - } - - if ( - typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' && - this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - multibuyer = this.formObject[1].multibuyer; - fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.cc_buyer_checkbox_second = 1; - data.additional_data.cc_buyer_name_second = fullName; - data.additional_data.cc_buyer_email_second = multibuyer.email.val(); - data.additional_data.cc_buyer_document_second = multibuyer.document.val(); - data.additional_data.cc_buyer_street_title_second = multibuyer.street.val(); - data.additional_data.cc_buyer_street_number_second = multibuyer.number.val(); - data.additional_data.cc_buyer_street_complement_second = multibuyer.complement.val(); - data.additional_data.cc_buyer_zipcode_second = multibuyer.zipcode.val(); - data.additional_data.cc_buyer_neighborhood_second = multibuyer.neighborhood.val(); - data.additional_data.cc_buyer_city_second = multibuyer.city.val(); - data.additional_data.cc_buyer_state_second = multibuyer.state.val(); - data.additional_data.cc_buyer_home_phone_second = multibuyer.homePhone.val(); - data.additional_data.cc_buyer_mobile_phone_second = multibuyer.mobilePhone.val(); - } - - return data; -}; - -TwoCreditcardsModel.prototype.fillData = function () { - - var saveFirstCard = 0; - var saveSecondCard = 0; - - if (this.formObject[0].saveThisCard.prop('checked') == true) { - saveFirstCard = 1; - } - - if (this.formObject[1].saveThisCard.prop('checked') == true) { - saveSecondCard = 1; - } - - return { - 'method': "pagarme_two_creditcard", - 'additional_data': { - //first - 'cc_first_card_amount': this.formObject[0].inputAmount.val(), - 'cc_first_card_tax_amount': this.formObject[0].creditCardInstallments.find(':selected').attr('interest'), - 'cc_type_first': this.formObject[0].creditCardBrand.val(), - 'cc_last_4_first': this.getLastFourNumbers(0), - 'cc_cid_first': this.formObject[0].creditCardCvv.val(), - 'cc_exp_year_first': this.formObject[0].creditCardExpYear.val(), - 'cc_exp_month_first': this.formObject[0].creditCardExpMonth.val(), - 'cc_number_first': this.formObject[0].creditCardNumber.val(), - 'cc_owner_first': this.formObject[0].creditCardHolderName.val(), - 'cc_savecard_first' : saveFirstCard, - 'cc_saved_card_first' : this.formObject[0].savedCreditCardSelect.val(), - 'cc_installments_first': this.formObject[0].creditCardInstallments.val(), - 'cc_token_credit_card_first' : this.formObject[0].creditCardToken.val(), - //second - 'cc_second_card_amount': this.formObject[1].inputAmount.val(), - 'cc_second_card_tax_amount': this.formObject[1].creditCardInstallments.find(':selected').attr('interest'), - 'cc_type_second': this.formObject[1].creditCardBrand.val(), - 'cc_last_4_second': this.getLastFourNumbers(1), - 'cc_cid_second': this.formObject[1].creditCardCvv.val(), - 'cc_exp_year_second': this.formObject[1].creditCardExpYear.val(), - 'cc_exp_month_second': this.formObject[1].creditCardExpMonth.val(), - 'cc_number_second': this.formObject[1].creditCardNumber.val(), - 'cc_owner_second': this.formObject[1].creditCardHolderName.val(), - 'cc_savecard_second' : saveSecondCard, - 'cc_saved_card_second' : this.formObject[1].savedCreditCardSelect.val(), - 'cc_installments_second': this.formObject[1].creditCardInstallments.val(), - 'cc_token_credit_card_second' : this.formObject[1].creditCardToken.val() +define([ + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', + 'Pagarme_Pagarme/js/core/validators/CreditCardValidator', + 'Pagarme_Pagarme/js/core/validators/MultibuyerValidator', +], (CreditCardToken, CreditCardValidator, MultibuyerValidator) => { + return class TwoCreditcardsModel { + constructor(formObject, publicKey) { + this.formObject = formObject; + this.publicKey = publicKey; + this.modelToken = new CreditCardToken(this.formObject); + this.errors = []; + this.formIds = [0, 1]; } - }; -}; - -TwoCreditcardsModel.prototype.getLastFourNumbers = function(id) { - var number = this.formObject[id].creditCardNumber.val(); - if (number !== undefined) { - return number.slice(-4); - } - return ""; -}; + validate() { + + const formsInvalid = []; + + for (const id in this.formObject) { + + if (id.length > 1) { + continue; + } + const creditCardValidator = new CreditCardValidator(this.formObject[id]); + const isCreditCardValid = creditCardValidator.validate(); + + const multibuyerValidator = new MultibuyerValidator(this.formObject[id]); + const isMultibuyerValid = multibuyerValidator.validate(); + + if (isCreditCardValid && isMultibuyerValid) { + continue; + } + + formsInvalid.push(true); + } + + const hasFormInvalid = formsInvalid.filter(function (item) { + return item; + }); + + if (hasFormInvalid.length > 0) { + return false; + } + + return true; + } + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + const _self = this; + let errors = false; + + for (const id in this.formObject) { + + if (id.length > 1) { + continue; + } + + if ( + typeof this.formObject[id].savedCreditCardSelect.val() != 'undefined' && + this.formObject[id].savedCreditCardSelect.val() != 'new' && + this.formObject[id].savedCreditCardSelect.val() != '' && + this.formObject[id].savedCreditCardSelect.html().length > 1 + ) { + continue; + } + + this.getCreditCardToken( + this.formObject[id], + function (data) { + _self.formObject[id].creditCardToken.val(data.id); + }, + function (error) { + errors = true; + _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); + } + ); + } + + if (!errors) { + _self.placeOrderObject.placeOrder(); + } + } + getFormIdInverted(id) { + const ids = this.formIds.slice(0); + const index = ids.indexOf(id); + ids.splice(index, 1); + + return ids[0]; + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + getCreditCardToken(formObject, success, error) { + const modelToken = new CreditCardToken(formObject); + modelToken.getToken(this.publicKey) + .done(success) + .fail(error); + } + getData() { + const data = this.fillData(); + + if ( + typeof this.formObject[0].multibuyer.showMultibuyer != 'undefined' && + this.formObject[0].multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + const multibuyer = this.formObject[0].multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox_first = 1; + data.additional_data.cc_buyer_name_first = fullName; + data.additional_data.cc_buyer_email_first = multibuyer.email.val(); + data.additional_data.cc_buyer_document_first = multibuyer.document.val(); + data.additional_data.cc_buyer_street_title_first = multibuyer.street.val(); + data.additional_data.cc_buyer_street_number_first = multibuyer.number.val(); + data.additional_data.cc_buyer_street_complement_first = multibuyer.complement.val(); + data.additional_data.cc_buyer_zipcode_first = multibuyer.zipcode.val(); + data.additional_data.cc_buyer_neighborhood_first = multibuyer.neighborhood.val(); + data.additional_data.cc_buyer_city_first = multibuyer.city.val(); + data.additional_data.cc_buyer_state_first = multibuyer.state.val(); + data.additional_data.cc_buyer_home_phone_first = multibuyer.homePhone.val(); + data.additional_data.cc_buyer_mobile_phone_first = multibuyer.mobilePhone.val(); + } + + if ( + typeof this.formObject[1].multibuyer.showMultibuyer != 'undefined' && + this.formObject[1].multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + const multibuyer = this.formObject[1].multibuyer; + const fullName = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox_second = 1; + data.additional_data.cc_buyer_name_second = fullName; + data.additional_data.cc_buyer_email_second = multibuyer.email.val(); + data.additional_data.cc_buyer_document_second = multibuyer.document.val(); + data.additional_data.cc_buyer_street_title_second = multibuyer.street.val(); + data.additional_data.cc_buyer_street_number_second = multibuyer.number.val(); + data.additional_data.cc_buyer_street_complement_second = multibuyer.complement.val(); + data.additional_data.cc_buyer_zipcode_second = multibuyer.zipcode.val(); + data.additional_data.cc_buyer_neighborhood_second = multibuyer.neighborhood.val(); + data.additional_data.cc_buyer_city_second = multibuyer.city.val(); + data.additional_data.cc_buyer_state_second = multibuyer.state.val(); + data.additional_data.cc_buyer_home_phone_second = multibuyer.homePhone.val(); + data.additional_data.cc_buyer_mobile_phone_second = multibuyer.mobilePhone.val(); + } + + return data; + } + fillData() { + + let saveFirstCard = 0; + let saveSecondCard = 0; + + if (this.formObject[0].saveThisCard.prop('checked') == true) { + saveFirstCard = 1; + } + + if (this.formObject[1].saveThisCard.prop('checked') == true) { + saveSecondCard = 1; + } + + return { + 'method': "pagarme_two_creditcard", + 'additional_data': { + //first + 'cc_first_card_amount': this.formObject[0].inputAmount.val(), + 'cc_first_card_tax_amount': this.formObject[0].creditCardInstallments.find(':selected').attr('interest'), + 'cc_type_first': this.formObject[0].creditCardBrand.val(), + 'cc_last_4_first': this.getLastFourNumbers(0), + 'cc_cid_first': this.formObject[0].creditCardCvv.val(), + 'cc_exp_year_first': this.formObject[0].creditCardExpYear.val(), + 'cc_exp_month_first': this.formObject[0].creditCardExpMonth.val(), + 'cc_number_first': this.formObject[0].creditCardNumber.val(), + 'cc_owner_first': this.formObject[0].creditCardHolderName.val(), + 'cc_savecard_first' : saveFirstCard, + 'cc_saved_card_first' : this.formObject[0].savedCreditCardSelect.val(), + 'cc_installments_first': this.formObject[0].creditCardInstallments.val(), + 'cc_token_credit_card_first' : this.formObject[0].creditCardToken.val(), + //second + 'cc_second_card_amount': this.formObject[1].inputAmount.val(), + 'cc_second_card_tax_amount': this.formObject[1].creditCardInstallments.find(':selected').attr('interest'), + 'cc_type_second': this.formObject[1].creditCardBrand.val(), + 'cc_last_4_second': this.getLastFourNumbers(1), + 'cc_cid_second': this.formObject[1].creditCardCvv.val(), + 'cc_exp_year_second': this.formObject[1].creditCardExpYear.val(), + 'cc_exp_month_second': this.formObject[1].creditCardExpMonth.val(), + 'cc_number_second': this.formObject[1].creditCardNumber.val(), + 'cc_owner_second': this.formObject[1].creditCardHolderName.val(), + 'cc_savecard_second' : saveSecondCard, + 'cc_saved_card_second' : this.formObject[1].savedCreditCardSelect.val(), + 'cc_installments_second': this.formObject[1].creditCardInstallments.val(), + 'cc_token_credit_card_second' : this.formObject[1].creditCardToken.val() + } + }; + } + getLastFourNumbers(id) { + const number = this.formObject[id].creditCardNumber.val(); + if (number !== undefined) { + return number.slice(-4); + } + return ""; + } + }; +}); diff --git a/view/frontend/web/js/core/models/VoucherModel.js b/view/frontend/web/js/core/models/VoucherModel.js index 3dd596ae..1be8784a 100644 --- a/view/frontend/web/js/core/models/VoucherModel.js +++ b/view/frontend/web/js/core/models/VoucherModel.js @@ -1,139 +1,139 @@ -var VoucherModel = function (formObject, publicKey) { - this.formObject = formObject; - this.publicKey = publicKey; - this.errors = []; -}; - -VoucherModel.prototype.placeOrder = function (placeOrderObject) { - this.placeOrderObject = placeOrderObject; - var _self = this; - - if ( - typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && - _self.formObject.savedCreditCardSelect.html().length > 1 && - _self.formObject.savedCreditCardSelect.val() != 'new' && - _self.formObject.savedCreditCardSelect.val() != '' - ) { - _self.placeOrderObject.placeOrder(); - return; - } - - this.getCreditCardToken( - function (data) { - _self.formObject.creditCardToken.val(data.id); - _self.placeOrderObject.placeOrder(); - }, - function (error) { - var errors = error.responseJSON; - _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); - } - ); -}; - -VoucherModel.prototype.addErrors = function (error) { - this.errors.push({ - message: error - }) -} - -VoucherModel.prototype.validate = function () { - - var creditCardValidator = new CreditCardValidator(this.formObject); - var isCreditCardValid = creditCardValidator.validate(); - - var multibuyerValidator = new MultibuyerValidator(this.formObject); - var isMultibuyerValid = multibuyerValidator.validate(); - - var voucherCardValidator = new VoucherCardValidator(this.formObject); - var isVoucherCardValid = voucherCardValidator.validate(); - - if (isCreditCardValid && isMultibuyerValid && isVoucherCardValid) { - return true; - } - - return false; -}; - -VoucherModel.prototype.getCreditCardToken = function (success, error) { - - var documentNumber = platFormConfig.addresses.billingAddress.vatId; - if (typeof documentNumber === "undefined") { - documentNumber = platFormConfig.customerData.taxvat; - } - - var modelToken = new CreditCardToken(this.formObject, documentNumber); - modelToken.getToken(this.publicKey) - .done(success) - .fail(error); -}; - -VoucherModel.prototype.getData = function () { - saveThiscard = 0; - var formObject = this.formObject; - - if (formObject.saveThisCard.prop( "checked" )) { - saveThiscard = 1; - } - - data = this.fillData(); - data.additional_data.cc_buyer_checkbox = false; - - if ( - typeof formObject.multibuyer != 'undefined' && - formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { - data = this.fillMultibuyerData(data); - } - - return data; -}; - -VoucherModel.prototype.fillData = function() { - var formObject = this.formObject; - - return { - 'method': "pagarme_voucher", - 'additional_data': { - 'cc_type': formObject.creditCardBrand.val(), - 'cc_last_4': this.getLastFourNumbers(), - 'cc_exp_year': formObject.creditCardExpYear.val(), - 'cc_exp_month': formObject.creditCardExpMonth.val(), - 'cc_owner': formObject.creditCardHolderName.val(), - 'cc_savecard': saveThiscard, - 'cc_saved_card': formObject.savedCreditCardSelect.val(), - 'cc_installments': formObject.creditCardInstallments.val(), - 'cc_token_credit_card': formObject.creditCardToken.val(), - 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest'), - 'cc_cvv_card': formObject.creditCardCvv.val() - } - }; -}; - -VoucherModel.prototype.fillMultibuyerData = function(data) { - multibuyer = this.formObject.multibuyer; - fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); - - data.additional_data.cc_buyer_checkbox = 1, - data.additional_data.cc_buyer_name = fullname, - data.additional_data.cc_buyer_email = multibuyer.email.val(), - data.additional_data.cc_buyer_document = multibuyer.document.val(), - data.additional_data.cc_buyer_street_title = multibuyer.street.val(), - data.additional_data.cc_buyer_street_number = multibuyer.number.val(), - data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), - data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), - data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), - data.additional_data.cc_buyer_city = multibuyer.city.val(), - data.additional_data.cc_buyer_state = multibuyer.state.val(), - data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), - data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() - - return data; -}; - -VoucherModel.prototype.getLastFourNumbers = function() { - var number = this.formObject.creditCardNumber.val(); - if (number !== undefined) { - return number.slice(-4); - } - return ""; -}; +define([ + 'Pagarme_Pagarme/js/core/validators/CreditCardValidator', + 'Pagarme_Pagarme/js/core/validators/MultibuyerValidator', + 'Pagarme_Pagarme/js/core/validators/VoucherCardValidator', + 'Pagarme_Pagarme/js/core/checkout/CreditCardToken', +], (CreditCardValidator, MultibuyerValidator, VoucherCardValidator, CreditCardToken) => { + return class VoucherModel { + constructor(formObject, publicKey) { + this.formObject = formObject; + this.publicKey = publicKey; + this.errors = []; + } + placeOrder(placeOrderObject) { + this.placeOrderObject = placeOrderObject; + const _self = this; + + if ( + typeof _self.formObject.savedCreditCardSelect.val() != 'undefined' && + _self.formObject.savedCreditCardSelect.html().length > 1 && + _self.formObject.savedCreditCardSelect.val() != 'new' && + _self.formObject.savedCreditCardSelect.val() != '' + ) { + _self.placeOrderObject.placeOrder(); + return; + } + + this.getCreditCardToken( + function (data) { + _self.formObject.creditCardToken.val(data.id); + _self.placeOrderObject.placeOrder(); + }, + function (error) { + _self.addErrors("Cartão inválido. Por favor, verifique os dados digitados e tente novamente"); + } + ); + } + addErrors(error) { + this.errors.push({ + message: error + }) + } + validate() { + + const creditCardValidator = new CreditCardValidator(this.formObject); + const isCreditCardValid = creditCardValidator.validate(); + + const multibuyerValidator = new MultibuyerValidator(this.formObject); + const isMultibuyerValid = multibuyerValidator.validate(); + + const voucherCardValidator = new VoucherCardValidator(this.formObject); + const isVoucherCardValid = voucherCardValidator.validate(); + + if (isCreditCardValid && isMultibuyerValid && isVoucherCardValid) { + return true; + } + + return false; + } + getCreditCardToken(success, error) { + + let documentNumber = platFormConfig.addresses.billingAddress.vatId; + if (typeof documentNumber === "undefined") { + documentNumber = platFormConfig.customerData.taxvat; + } + + const modelToken = new CreditCardToken(this.formObject, documentNumber); + modelToken.getToken(this.publicKey) + .done(success) + .fail(error); + } + getData() { + this.saveThiscard = 0; + const formObject = this.formObject; + + if (formObject.saveThisCard.prop( "checked" )) { + this.saveThiscard = 1; + } + + let data = this.fillData(); + data.additional_data.cc_buyer_checkbox = false; + + if ( + typeof formObject.multibuyer != 'undefined' && + formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { + data = this.fillMultibuyerData(data); + } + + return data; + } + fillData() { + const formObject = this.formObject; + + return { + 'method': "pagarme_voucher", + 'additional_data': { + 'cc_type': formObject.creditCardBrand.val(), + 'cc_last_4': this.getLastFourNumbers(), + 'cc_exp_year': formObject.creditCardExpYear.val(), + 'cc_exp_month': formObject.creditCardExpMonth.val(), + 'cc_owner': formObject.creditCardHolderName.val(), + 'cc_savecard': this.saveThiscard, + 'cc_saved_card': formObject.savedCreditCardSelect.val(), + 'cc_installments': formObject.creditCardInstallments.val(), + 'cc_token_credit_card': formObject.creditCardToken.val(), + 'cc_card_tax_amount' : formObject.creditCardInstallments.find(':selected').attr('interest'), + 'cc_cvv_card': formObject.creditCardCvv.val() + } + }; + } + fillMultibuyerData(data) { + const multibuyer = this.formObject.multibuyer; + const fullname = multibuyer.firstname.val() + ' ' + multibuyer.lastname.val(); + + data.additional_data.cc_buyer_checkbox = 1, + data.additional_data.cc_buyer_name = fullname, + data.additional_data.cc_buyer_email = multibuyer.email.val(), + data.additional_data.cc_buyer_document = multibuyer.document.val(), + data.additional_data.cc_buyer_street_title = multibuyer.street.val(), + data.additional_data.cc_buyer_street_number = multibuyer.number.val(), + data.additional_data.cc_buyer_street_complement = multibuyer.complement.val(), + data.additional_data.cc_buyer_zipcode = multibuyer.zipcode.val(), + data.additional_data.cc_buyer_neighborhood = multibuyer.neighborhood.val(), + data.additional_data.cc_buyer_city = multibuyer.city.val(), + data.additional_data.cc_buyer_state = multibuyer.state.val(), + data.additional_data.cc_buyer_home_phone = multibuyer.homePhone.val(), + data.additional_data.cc_buyer_mobile_phone = multibuyer.mobilePhone.val() + + return data; + } + getLastFourNumbers() { + const number = this.formObject.creditCardNumber.val(); + if (number !== undefined) { + return number.slice(-4); + } + return ""; + } + }; +}); diff --git a/view/frontend/web/js/core/validators/CreditCardValidator.js b/view/frontend/web/js/core/validators/CreditCardValidator.js index 704cb161..710bacea 100644 --- a/view/frontend/web/js/core/validators/CreditCardValidator.js +++ b/view/frontend/web/js/core/validators/CreditCardValidator.js @@ -1,141 +1,138 @@ -var CreditCardValidator = function (formObject) { - this.formObject = formObject; -}; - -CreditCardValidator.prototype.validate = function () { - if ( - typeof this.formObject.savedCreditCardSelect != 'undefined' && - this.formObject.savedCreditCardSelect.html().length > 1 && - this.formObject.savedCreditCardSelect.val() !== 'new' - ) { - return this.validateSavedCard(); - } - return this.validateNewCard(); -} - -CreditCardValidator.prototype.validateSavedCard = function () { - - var inputsInvalid = []; - var formObject = this.formObject; - - - if (formObject.savedCreditCardSelect.val() == "") { - inputsInvalid.push( - this.isInputInvalid(formObject.savedCreditCardSelect) - ); - } - - inputsInvalid.push( - this.isInputInstallmentInvalid(formObject.creditCardInstallments) - ); - - var hasInputInvalid = inputsInvalid.filter(function (item) { - return item; - }); - - if (hasInputInvalid.length > 0) { - return false; - } - - return true; -} - -CreditCardValidator.prototype.validateNewCard = function () { - - var inputsInvalid = []; - var formObject = this.formObject; - - inputsInvalid.push( - this.isInputInvalid(formObject.creditCardBrand), - this.isInputInvalid(formObject.creditCardNumber), - this.isInputInvalid(formObject.creditCardHolderName), - this.isInputInvalid(formObject.creditCardCvv), - this.isInputExpirationInvalid(formObject), - this.isInputInstallmentInvalid(formObject.creditCardInstallments), - this.isInputInvalidBrandAvailable(formObject.creditCardBrand) - ); - - var hasInputInvalid = inputsInvalid.filter(function (item) { - return item; - }); - - if (hasInputInvalid.length > 0) { - return false; - } - - return true; -} - -CreditCardValidator.prototype.isInputInvalidBrandAvailable = function (element) { - var parentsElements = element.parent().parent(); - - var brands = []; - PlatformConfig.PlatformConfig.avaliableBrands[this.formObject.savedCardSelectUsed].forEach(function (item) { - brands.push(item.title.toUpperCase()); - }); - - if (!brands.includes(this.formObject.creditCardBrand.val().toUpperCase())) { - parentsElements.addClass("_error"); - parentsElements.find(".field-error").show(); - parentsElements.find(".nobrand").hide(); - return true; - } - - parentsElements.removeClass("_error"); - parentsElements.find(".field-error").hide(); - return false; -} - -CreditCardValidator.prototype.isInputInvalid = function (element, message = "") { - - var parentsElements = element.parent().parent(); - - if (element.val() == "") { - parentsElements.addClass("_error"); - parentsElements.find('.field-error').show(); - return true; - } - - parentsElements.removeClass('_error'); - parentsElements.find('.field-error').hide(); - return false; -} - -CreditCardValidator.prototype.isInputExpirationInvalid = function (formObject) { - var cardExpirationMonth = formObject.creditCardExpMonth; - var cardExpirationYear = formObject.creditCardExpYear; - - var cardDate = new Date (cardExpirationYear.val(), cardExpirationMonth.val() -1); - var dateNow = new Date(); - - var monthParentsElements = cardExpirationMonth.parent().parent(); - var yearParentsElements = cardExpirationYear.parent().parent(); - var parentsElements = yearParentsElements.parents(".field"); - - if (cardDate < dateNow) { - monthParentsElements.addClass("_error"); - yearParentsElements.addClass("_error"); - parentsElements.find('.field-error').show(); - return true; - } - - monthParentsElements.removeClass("_error"); - yearParentsElements.removeClass("_error"); - parentsElements.find('.field-error').hide(); - return false; -} - -CreditCardValidator.prototype.isInputInstallmentInvalid = function (element) { - - var parentsElements = element.parents(".field"); - - if (element.val() == "") { - - element.parent().parent().addClass("_error"); - parentsElements.find('.field-error').show(); - return true; - } - element.parent().parent().removeClass("_error"); - parentsElements.find('.field-error').hide(); - return false; -} +define(['Pagarme_Pagarme/js/core/checkout/PlatformConfig',], (PlatformConfig) => { + return class CreditCardValidator { + constructor(formObject) { + this.formObject = formObject; + } + validate() { + if ( + typeof this.formObject.savedCreditCardSelect != 'undefined' && + this.formObject.savedCreditCardSelect.html().length > 1 && + this.formObject.savedCreditCardSelect.val() !== 'new' + ) { + return this.validateSavedCard(); + } + return this.validateNewCard(); + } + validateSavedCard() { + + const inputsInvalid = []; + const formObject = this.formObject; + + + if (formObject.savedCreditCardSelect.val() == "") { + inputsInvalid.push( + this.isInputInvalid(formObject.savedCreditCardSelect) + ); + } + + inputsInvalid.push( + this.isInputInstallmentInvalid(formObject.creditCardInstallments) + ); + + const hasInputInvalid = inputsInvalid.filter(function (item) { + return item; + }); + + if (hasInputInvalid.length > 0) { + return false; + } + + return true; + } + validateNewCard() { + + const inputsInvalid = []; + const formObject = this.formObject; + + inputsInvalid.push( + this.isInputInvalid(formObject.creditCardBrand), + this.isInputInvalid(formObject.creditCardNumber), + this.isInputInvalid(formObject.creditCardHolderName), + this.isInputInvalid(formObject.creditCardCvv), + this.isInputExpirationInvalid(formObject), + this.isInputInstallmentInvalid(formObject.creditCardInstallments), + this.isInputInvalidBrandAvailable(formObject.creditCardBrand) + ); + + const hasInputInvalid = inputsInvalid.filter(function (item) { + return item; + }); + + if (hasInputInvalid.length > 0) { + return false; + } + + return true; + } + isInputInvalidBrandAvailable(element) { + const parentsElements = element.parent().parent(); + + const brands = []; + PlatformConfig.PlatformConfig.avaliableBrands[this.formObject.savedCardSelectUsed].forEach(function (item) { + brands.push(item.title.toUpperCase()); + }); + + if (!brands.includes(this.formObject.creditCardBrand.val().toUpperCase())) { + parentsElements.addClass("_error"); + parentsElements.find(".field-error").show(); + parentsElements.find(".nobrand").hide(); + return true; + } + + parentsElements.removeClass("_error"); + parentsElements.find(".field-error").hide(); + return false; + } + isInputInvalid(element, message = "") { + + const parentsElements = element.parent().parent(); + + if (element.val() == "") { + parentsElements.addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } + + parentsElements.removeClass('_error'); + parentsElements.find('.field-error').hide(); + return false; + } + isInputExpirationInvalid(formObject) { + const cardExpirationMonth = formObject.creditCardExpMonth; + const cardExpirationYear = formObject.creditCardExpYear; + + const cardDate = new Date (cardExpirationYear.val(), cardExpirationMonth.val() -1); + const dateNow = new Date(); + + const monthParentsElements = cardExpirationMonth.parent().parent(); + const yearParentsElements = cardExpirationYear.parent().parent(); + const parentsElements = yearParentsElements.parents(".field"); + + if (cardDate < dateNow) { + monthParentsElements.addClass("_error"); + yearParentsElements.addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } + + monthParentsElements.removeClass("_error"); + yearParentsElements.removeClass("_error"); + parentsElements.find('.field-error').hide(); + return false; + } + isInputInstallmentInvalid(element) { + + const parentsElements = element.parents(".field"); + + if (element.val() == "") { + + element.parent().parent().addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } + element.parent().parent().removeClass("_error"); + parentsElements.find('.field-error').hide(); + return false; + } + } +}); diff --git a/view/frontend/web/js/core/validators/CustomerValidator.js b/view/frontend/web/js/core/validators/CustomerValidator.js index 0a05136f..39fdc402 100644 --- a/view/frontend/web/js/core/validators/CustomerValidator.js +++ b/view/frontend/web/js/core/validators/CustomerValidator.js @@ -1,29 +1,31 @@ -var CustomerValidator = function (addressObject) { - this.addressObject = addressObject; - this.errors = []; -}; +define([], () => { + return class CustomerValidator { + constructor(addressObject) { + this.addressObject = addressObject; + this.errors = []; + } + validate() { + const address = this.addressObject; -CustomerValidator.prototype.validate = function () { - var address = this.addressObject; + if (address == null) { + this.errors.push("Customer address is required"); + return; + } - if (address == null) { - this.errors.push("Customer address is required"); - return; - } - - if (address.vatId <= 0 && address.vatId != null) { - this.errors.push("O campo CPF/CNPJ é obrigatório."); - } + if (address.vatId <= 0 && address.vatId != null) { + this.errors.push("O campo CPF/CNPJ é obrigatório."); + } - if (address.street.length < 3) { - this.errors.push( - "O endereço fornecido está diferente do esperado. " + - "Verifique se você preencheu os campos " + - "rua, número e bairro e tente novamente." - ); + if (address.street.length < 3) { + this.errors.push( + "O endereço fornecido está diferente do esperado. " + + "Verifique se você preencheu os campos " + + "rua, número e bairro e tente novamente." + ); + } + } + getErrors() { + return this.errors; + } } -} - -CustomerValidator.prototype.getErrors = function () { - return this.errors; -} +}); diff --git a/view/frontend/web/js/core/validators/MultibuyerValidator.js b/view/frontend/web/js/core/validators/MultibuyerValidator.js index b8fea2ff..d36ea55a 100644 --- a/view/frontend/web/js/core/validators/MultibuyerValidator.js +++ b/view/frontend/web/js/core/validators/MultibuyerValidator.js @@ -1,74 +1,75 @@ -var MultibuyerValidator = function (formObject) { - this.formObject = formObject; -}; +define([], () => { + return class MultibuyerValidator { + constructor(formObject) { + this.formObject = formObject; + } + validate() { + const formObject = this.formObject; + const inputsInvalid = []; -MultibuyerValidator.prototype.validate = function () { - var formObject = this.formObject; - var inputsInvalid = []; - - if ( - typeof formObject.multibuyer != 'undefined' && - typeof formObject.multibuyer.showMultibuyer != 'undefined' && - formObject.multibuyer.showMultibuyer.prop( "checked" ) == true - ) { + if ( + typeof formObject.multibuyer != 'undefined' && + typeof formObject.multibuyer.showMultibuyer != 'undefined' && + formObject.multibuyer.showMultibuyer.prop( "checked" ) == true + ) { - inputsInvalid.push( - this.isInputInvalid(formObject.multibuyer.firstname), - this.isInputInvalid(formObject.multibuyer.lastname), - this.isEmailInvalid(formObject.multibuyer.email), - this.isInputInvalid(formObject.multibuyer.zipcode), - this.isInputInvalid(formObject.multibuyer.document), - this.isInputInvalid(formObject.multibuyer.street), - this.isInputInvalid(formObject.multibuyer.number), - this.isInputInvalid(formObject.multibuyer.neighborhood), - this.isInputInvalid(formObject.multibuyer.city), - this.isInputInvalid(formObject.multibuyer.state), - this.isInputInvalid(formObject.multibuyer.mobilePhone) - ); - } - - var hasInputInvalid = inputsInvalid.filter(function (item) { - return item; - }); + inputsInvalid.push( + this.isInputInvalid(formObject.multibuyer.firstname), + this.isInputInvalid(formObject.multibuyer.lastname), + this.isEmailInvalid(formObject.multibuyer.email), + this.isInputInvalid(formObject.multibuyer.zipcode), + this.isInputInvalid(formObject.multibuyer.document), + this.isInputInvalid(formObject.multibuyer.street), + this.isInputInvalid(formObject.multibuyer.number), + this.isInputInvalid(formObject.multibuyer.neighborhood), + this.isInputInvalid(formObject.multibuyer.city), + this.isInputInvalid(formObject.multibuyer.state), + this.isInputInvalid(formObject.multibuyer.mobilePhone) + ); + } - if (hasInputInvalid.length > 0) { - return false; - } + const hasInputInvalid = inputsInvalid.filter(function (item) { + return item; + }); - return true; -} + if (hasInputInvalid.length > 0) { + return false; + } -MultibuyerValidator.prototype.isInputInvalid = function (element, message = "") { - var parentsElements = element.parent().parent(); + return true; + } + isInputInvalid(element, message = "") { + const parentsElements = element.parent().parent(); - if (element.val() == "") { - parentsElements.addClass("_error"); - parentsElements.find('.field-error').show(); - return true; - } + if (element.val() == "") { + parentsElements.addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } - parentsElements.removeClass('_error'); - parentsElements.find('.field-error').hide(); - return false; -} + parentsElements.removeClass('_error'); + parentsElements.find('.field-error').hide(); + return false; + } + isEmailInvalid(element, message = "") { + if (this.isInputInvalid(element)) { + return true; + } -MultibuyerValidator.prototype.isEmailInvalid = function (element, message = "") { - if (this.isInputInvalid(element)) { - return true; - } + const parentsElements = element.parent().parent(); - var parentsElements = element.parent().parent(); + const isValid = /\S+@\S+\.\S+/.test(element.val()); - var isValid = /\S+@\S+\.\S+/.test(element.val()); + if (!isValid) { + parentsElements.addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } - if (!isValid) { - parentsElements.addClass("_error"); - parentsElements.find('.field-error').show(); - return true; + parentsElements.removeClass('_error'); + parentsElements.find('.field-error').hide(); + return false; + } } - - parentsElements.removeClass('_error'); - parentsElements.find('.field-error').hide(); - return false; -} \ No newline at end of file +}); diff --git a/view/frontend/web/js/core/validators/VoucherCardValidator.js b/view/frontend/web/js/core/validators/VoucherCardValidator.js index 1c104f40..f325dcf8 100644 --- a/view/frontend/web/js/core/validators/VoucherCardValidator.js +++ b/view/frontend/web/js/core/validators/VoucherCardValidator.js @@ -1,55 +1,56 @@ -var VoucherCardValidator = function (formObject) { - this.formObject = formObject; -}; - -VoucherCardValidator.prototype.validate = function () { - if ( - typeof this.formObject.savedCreditCardSelect != 'undefined' && - this.formObject.savedCreditCardSelect.html().length > 1 && - this.formObject.savedCreditCardSelect.val() !== 'new' - ) { - return this.validateSavedCard(); +define([], () => { + return class VoucherCardValidator { + constructor(formObject) { + this.formObject = formObject; + } + validate() { + if ( + typeof this.formObject.savedCreditCardSelect != 'undefined' && + this.formObject.savedCreditCardSelect.html().length > 1 && + this.formObject.savedCreditCardSelect.val() !== 'new' + ) { + return this.validateSavedCard(); + } + + return true; + } + validateSavedCard() { + const inputsInvalid = []; + const formObject = this.formObject; + + if (formObject.savedCreditCardSelect.val() == "") { + inputsInvalid.push( + this.isInputInvalid(formObject.savedCreditCardSelect) + ); + } + + inputsInvalid.push( + this.isInputInvalid(formObject.creditCardCvv) + ); + + const hasInputInvalid = inputsInvalid.filter(function (item) { + return item; + }); + + if (hasInputInvalid.length > 0) { + return false; + } + + return true; + } + isInputInvalid(element, message = "") { + + const parentsElements = element.parent().parent(); + + if (element.val() == "") { + parentsElements.addClass("_error"); + parentsElements.find('.field-error').show(); + return true; + } + + parentsElements.removeClass('_error'); + parentsElements.find('.field-error').hide(); + return false; + } } - - return true; -} - -VoucherCardValidator.prototype.validateSavedCard = function () { - var inputsInvalid = []; - var formObject = this.formObject; - - if (formObject.savedCreditCardSelect.val() == "") { - inputsInvalid.push( - this.isInputInvalid(formObject.savedCreditCardSelect) - ); - } - - inputsInvalid.push( - this.isInputInvalid(formObject.creditCardCvv) - ); - - var hasInputInvalid = inputsInvalid.filter(function (item) { - return item; - }); - - if (hasInputInvalid.length > 0) { - return false; - } - - return true; -} - -VoucherCardValidator.prototype.isInputInvalid = function (element, message = "") { - - var parentsElements = element.parent().parent(); - - if (element.val() == "") { - parentsElements.addClass("_error"); - parentsElements.find('.field-error').show(); - return true; - } - - parentsElements.removeClass('_error'); - parentsElements.find('.field-error').hide(); - return false; -} \ No newline at end of file +}); diff --git a/view/frontend/web/js/view/payment/boleto.js b/view/frontend/web/js/view/payment/boleto.js index 7f809c59..fb672570 100644 --- a/view/frontend/web/js/view/payment/boleto.js +++ b/view/frontend/web/js/view/payment/boleto.js @@ -3,9 +3,10 @@ define( [ "Pagarme_Pagarme/js/view/payment/default", + "Pagarme_Pagarme/js/core/checkout/PaymentModuleBootstrap", "Pagarme_Pagarme/js/core/models/BoletoModel" ], - function (Component, $t) { + function (Component, PagarmeCore, $t) { return Component.extend({ defaults: { @@ -37,7 +38,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/boletocreditcard.js b/view/frontend/web/js/view/payment/boletocreditcard.js index ff4935d4..e57e7305 100644 --- a/view/frontend/web/js/view/payment/boletocreditcard.js +++ b/view/frontend/web/js/view/payment/boletocreditcard.js @@ -66,7 +66,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/creditcard.js b/view/frontend/web/js/view/payment/creditcard.js index 9a31a65e..f6c26bc3 100644 --- a/view/frontend/web/js/view/payment/creditcard.js +++ b/view/frontend/web/js/view/payment/creditcard.js @@ -67,7 +67,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/debit.js b/view/frontend/web/js/view/payment/debit.js index 8321fd87..1bc80b52 100644 --- a/view/frontend/web/js/view/payment/debit.js +++ b/view/frontend/web/js/view/payment/debit.js @@ -63,7 +63,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/default.js b/view/frontend/web/js/view/payment/default.js index 3dd943fc..0b9498d1 100644 --- a/view/frontend/web/js/view/payment/default.js +++ b/view/frontend/web/js/view/payment/default.js @@ -28,10 +28,8 @@ define( "Pagarme_Pagarme/js/core/checkout/PaymentMethodController", "Pagarme_Pagarme/js/core/checkout/PlatformPlaceOrder", "Pagarme_Pagarme/js/core/checkout/Bin", - "Pagarme_Pagarme/js/core/checkout/PlatformFormBiding", "Pagarme_Pagarme/js/core/checkout/PlatformFormHandler", "Pagarme_Pagarme/js/core/checkout/CreditCardToken", - "Pagarme_Pagarme/js/core/checkout/Installments", "Pagarme_Pagarme/js/core/validators/CreditCardValidator", "Pagarme_Pagarme/js/core/validators/CustomerValidator", "Pagarme_Pagarme/js/core/validators/MultibuyerValidator", @@ -58,17 +56,16 @@ define( PlatformPlaceOrder ) { - window.PagarmeCore.messageList = globalMessageList; return Component.extend({ initPaymentMethod: function() { var _self = this; - platFormConfig = window.checkoutConfig; + const platFormConfig = window.checkoutConfig; platFormConfig.moduleUrls = {}; - installmentsUrl = installmentsAction(); + const installmentsUrl = installmentsAction(); platFormConfig.grand_total = quote.getTotals()().grand_total; - var baseUrl = platFormConfig.payment.ccform.base_url; + const baseUrl = platFormConfig.payment.ccform.base_url; if ( quote.billingAddress() && @@ -91,8 +88,8 @@ define( /** @fixme Update total should be moved to platformFormBinging **/ platFormConfig.updateTotals = quote; - window.PagarmeCore.platFormConfig = platFormConfig; - window.PagarmeCore.initPaymentMethod( + PagarmeCore.platFormConfig = platFormConfig; + PagarmeCore.initPaymentMethod( this.getModel(), platFormConfig ); @@ -130,7 +127,7 @@ define( var _self = this; - window.PagarmeCore.platFormConfig.addresses.billingAddress = quote.billingAddress(); + PagarmeCore.platFormConfig.addresses.billingAddress = quote.billingAddress(); var PlatformPlaceOrder = { obj : _self, @@ -138,7 +135,7 @@ define( event: event }; - window.PagarmeCore.placeOrder( + PagarmeCore.placeOrder( PlatformPlaceOrder, this.getModel() ); @@ -150,8 +147,8 @@ define( selectPaymentMethod: function() { var data = this.getData(); if (data == undefined) { - var platFormConfig = window.PagarmeCore.platFormConfig; - window.PagarmeCore.init(this.getModel(), platFormConfig); + var platFormConfig = PagarmeCore.platFormConfig; + PagarmeCore.init(this.getModel(), platFormConfig); } selectPaymentMethodAction(this.getData()); checkoutData.setSelectedPaymentMethod(this.item.method); diff --git a/view/frontend/web/js/view/payment/pix.js b/view/frontend/web/js/view/payment/pix.js index 1ad62254..4229a85a 100644 --- a/view/frontend/web/js/view/payment/pix.js +++ b/view/frontend/web/js/view/payment/pix.js @@ -3,9 +3,10 @@ define( [ "Pagarme_Pagarme/js/view/payment/default", + "Pagarme_Pagarme/js/core/checkout/PaymentModuleBootstrap", "Pagarme_Pagarme/js/core/models/PixModel" ], - function (Component, $t) { + function (Component, PagarmeCore, $t) { return Component.extend({ defaults: { @@ -38,7 +39,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/twocreditcards.js b/view/frontend/web/js/view/payment/twocreditcards.js index af0b13ef..7d0821ee 100644 --- a/view/frontend/web/js/view/payment/twocreditcards.js +++ b/view/frontend/web/js/view/payment/twocreditcards.js @@ -3,9 +3,10 @@ define( [ "Pagarme_Pagarme/js/view/payment/default", + "Pagarme_Pagarme/js/core/checkout/PaymentModuleBootstrap", "Pagarme_Pagarme/js/core/models/TwoCreditcardsModel" ], - function (Component, $t) { + function (Component, PagarmeCore, $t) { return Component.extend({ defaults: { @@ -39,7 +40,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } diff --git a/view/frontend/web/js/view/payment/voucher.js b/view/frontend/web/js/view/payment/voucher.js index 0c493a8e..aba82d74 100644 --- a/view/frontend/web/js/view/payment/voucher.js +++ b/view/frontend/web/js/view/payment/voucher.js @@ -63,7 +63,7 @@ define( }, getData: function () { - var paymentMethod = window.PagarmeCore.paymentMethod[this.getModel()]; + var paymentMethod = PagarmeCore.paymentMethod[this.getModel()]; if (paymentMethod == undefined) { return paymentMethod; } From b7d8ed000391758584c65c87d96a0bb6674d9200 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Fri, 11 Aug 2023 15:21:14 -0300 Subject: [PATCH 32/83] improve: add recurence items in catalog menu (#219) --- etc/adminhtml/menu.xml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/etc/adminhtml/menu.xml b/etc/adminhtml/menu.xml index 10c4a50b..0ac1f555 100644 --- a/etc/adminhtml/menu.xml +++ b/etc/adminhtml/menu.xml @@ -14,5 +14,10 @@ + + + + + From d19cccccfb2ca41540565244a1c713635a0f5270 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:13:27 -0300 Subject: [PATCH 33/83] improve: add day cycle in recurring product (#220) --- Block/Adminhtml/Recurrence/Subscriptions/Subscription.php | 1 + Helper/ProductSubscriptionHelper.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php b/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php index 66182a80..c9430616 100644 --- a/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php +++ b/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php @@ -123,6 +123,7 @@ public function getCicleSelectOption() return [ 'interval_count' => range(1, 12), 'interval_type' => [ + IntervalValueObject::INTERVAL_TYPE_DAY => __('day'), IntervalValueObject::INTERVAL_TYPE_WEEK => __('week'), IntervalValueObject::INTERVAL_TYPE_MONTH => __('month'), IntervalValueObject::INTERVAL_TYPE_YEAR => __('year') diff --git a/Helper/ProductSubscriptionHelper.php b/Helper/ProductSubscriptionHelper.php index 9495a2dd..86006dad 100644 --- a/Helper/ProductSubscriptionHelper.php +++ b/Helper/ProductSubscriptionHelper.php @@ -53,6 +53,9 @@ public function deleteRecurrenceCustomOption(ProductSubscription $productSubscri $customOptions = []; $options = $product->getOptions(); + if (empty($options)) { + return; + } foreach ($options as $option) { if ($option->getSku() == "recurrence") { continue; From 7d1291ed4872350ed5c35566037985b9a168f2b9 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Mon, 14 Aug 2023 16:51:18 -0300 Subject: [PATCH 34/83] cd: add new images to cd (#215) --- .github/data/docker-compose.yml | 2 +- .github/data/master/Dockerfile | 6 +++ .github/data/php8/Dockerfile | 6 +++ .github/data/{ => stg}/Dockerfile | 2 +- .github/data/test/Dockerfile | 6 +++ .github/workflows/cd_master.yml | 17 +++++++ .github/workflows/{cd.yml => cd_reusable.yml} | 44 +++++++++---------- .github/workflows/cd_stg.yml | 17 +++++++ .github/workflows/cd_test.yml | 17 +++++++ 9 files changed, 92 insertions(+), 25 deletions(-) create mode 100644 .github/data/master/Dockerfile create mode 100644 .github/data/php8/Dockerfile rename .github/data/{ => stg}/Dockerfile (66%) create mode 100644 .github/data/test/Dockerfile create mode 100644 .github/workflows/cd_master.yml rename .github/workflows/{cd.yml => cd_reusable.yml} (55%) create mode 100644 .github/workflows/cd_stg.yml create mode 100644 .github/workflows/cd_test.yml diff --git a/.github/data/docker-compose.yml b/.github/data/docker-compose.yml index 7684270e..e4470411 100644 --- a/.github/data/docker-compose.yml +++ b/.github/data/docker-compose.yml @@ -1,4 +1,4 @@ -version: '2' +version: '3.4' volumes: mariadb_data: driver: local diff --git a/.github/data/master/Dockerfile b/.github/data/master/Dockerfile new file mode 100644 index 00000000..37b9bb56 --- /dev/null +++ b/.github/data/master/Dockerfile @@ -0,0 +1,6 @@ +FROM bitnami/magento:2.4.5 +MAINTAINER Open Source Team + +WORKDIR /opt/bitnami/magento +COPY auth.json /opt/bitnami/magento +RUN composer require pagarme/pagarme-magento2-module:master \ No newline at end of file diff --git a/.github/data/php8/Dockerfile b/.github/data/php8/Dockerfile new file mode 100644 index 00000000..c6c01979 --- /dev/null +++ b/.github/data/php8/Dockerfile @@ -0,0 +1,6 @@ +FROM bitnami/magento:2.4.5 +MAINTAINER Open Source Team + +WORKDIR /opt/bitnami/magento +COPY auth.json /opt/bitnami/magento +RUN composer require pagarme/pagarme-magento2-module:dev-stg \ No newline at end of file diff --git a/.github/data/Dockerfile b/.github/data/stg/Dockerfile similarity index 66% rename from .github/data/Dockerfile rename to .github/data/stg/Dockerfile index 73c89f8a..29337b5d 100644 --- a/.github/data/Dockerfile +++ b/.github/data/stg/Dockerfile @@ -3,4 +3,4 @@ MAINTAINER Open Source Team WORKDIR /opt/bitnami/magento COPY auth.json /opt/bitnami/magento -RUN composer require pagarme/pagarme-magento2-module +RUN composer require pagarme/pagarme-magento2-module:dev-stg \ No newline at end of file diff --git a/.github/data/test/Dockerfile b/.github/data/test/Dockerfile new file mode 100644 index 00000000..0d26b853 --- /dev/null +++ b/.github/data/test/Dockerfile @@ -0,0 +1,6 @@ +FROM bitnami/magento:2.4.3 +MAINTAINER Open Source Team + +WORKDIR /opt/bitnami/magento +COPY auth.json /opt/bitnami/magento +RUN composer require pagarme/pagarme-magento2-module:dev-test \ No newline at end of file diff --git a/.github/workflows/cd_master.yml b/.github/workflows/cd_master.yml new file mode 100644 index 00000000..b2a7ccef --- /dev/null +++ b/.github/workflows/cd_master.yml @@ -0,0 +1,17 @@ +name: CD Master + +on: + pull_request: + branches: ["master"] + types: closed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + call-workflow-cd: + uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master + with: + matrix_tags: "['master']" + secrets: + inherit \ No newline at end of file diff --git a/.github/workflows/cd.yml b/.github/workflows/cd_reusable.yml similarity index 55% rename from .github/workflows/cd.yml rename to .github/workflows/cd_reusable.yml index 31a80f23..528cf735 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd_reusable.yml @@ -1,19 +1,17 @@ -name: CD +name: CD REUSABLE on: - push: - branches: - - develop - - test - - stg - - master -concurrency: - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: true + workflow_call: + inputs: + matrix_tags: + required: true + type: string jobs: - publish: + strategy: + matrix: + tags: ${{ fromJson( inputs.matrix_tags ) }} name: Publish runs-on: ubuntu-latest steps: @@ -25,7 +23,7 @@ jobs: run: | cp .github/data/auth.json . cp .github/data/docker-compose.yml . - cp .github/data/Dockerfile . + cp .github/data/${{ matrix.tags }}/Dockerfile . cp .github/data/wait-for-mysql.sh . cp .github/data/magento2_module_install.sql . - @@ -55,15 +53,15 @@ jobs: with: context: . push: true - tags: ${{ steps.meta.outputs.tags }} + tags: mpdockerregistry.azurecr.io/magento2-pagarme:${{ matrix.tags }} labels: ${{ steps.meta.outputs.labels }} - # name: Commit and push Docker image - # run: | - # sleep 5 && docker stop magento2_bitnami - # docker login ${{ secrets.DOCKER_ACCOUNT }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} - # docker commit magento2_bitnami "magento2-pagarme:${{ github.ref_name }}" - # docker push "magento2-pagarme:${{ github.ref_name }}" - # name: Send deployment webhook to Rancher - # run: | - # BODY='{"push_data":{"tag":"'"${{ github.ref }}"'"},"repository":{"repo_name":"'"${{ secrets.DOCKER_ACCOUNT }}/${{ github.repository }}"'"}}' - # curl -X POST ${{ secrets.RANCHER_STG_DEPLOY_URL }} -H 'Content-Type: application/json' -d "${BODY}" + # name: Commit and push Docker image + # run: | + # sleep 5 && docker stop magento2_bitnami + # docker login ${{ secrets.DOCKER_ACCOUNT }} -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} + # docker commit magento2_bitnami "magento2-pagarme:${{ github.ref_name }}" + # docker push "magento2-pagarme:${{ github.ref_name }}" + # name: Send deployment webhook to Rancher + # run: | + # BODY='{"push_data":{"tag":"'"${{ github.ref }}"'"},"repository":{"repo_name":"'"${{ secrets.DOCKER_ACCOUNT }}/${{ github.repository }}"'"}}' + # curl -X POST ${{ secrets.RANCHER_STG_DEPLOY_URL }} -H 'Content-Type: application/json' -d "${BODY}" \ No newline at end of file diff --git a/.github/workflows/cd_stg.yml b/.github/workflows/cd_stg.yml new file mode 100644 index 00000000..b864f301 --- /dev/null +++ b/.github/workflows/cd_stg.yml @@ -0,0 +1,17 @@ +name: CD STG AND PHP8 + +on: + pull_request: + branches: ["stg"] + types: closed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + call-workflow-cd: + uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master + with: + matrix_tags: "['stg', 'php8']" + secrets: + inherit \ No newline at end of file diff --git a/.github/workflows/cd_test.yml b/.github/workflows/cd_test.yml new file mode 100644 index 00000000..9049874d --- /dev/null +++ b/.github/workflows/cd_test.yml @@ -0,0 +1,17 @@ +name: CD TEST + +on: + pull_request: + branches: ["develop"] + types: closed +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + call-workflow-cd: + uses: pagarme/magento2/.github/workflows/cd_reusable.yml@master + with: + matrix_tags: "['test']" + secrets: + inherit \ No newline at end of file From 7c55735f7f60b2f984fe15862273699f77bcaf89 Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Thu, 17 Aug 2023 11:37:03 -0300 Subject: [PATCH 35/83] Fix: Added translations admin menu items (#222) --- etc/acl.xml | 30 +++++++++++++++--------------- etc/adminhtml/menu.xml | 26 +++++++++++++------------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/etc/acl.xml b/etc/acl.xml index 6bb0a251..71d2819e 100644 --- a/etc/acl.xml +++ b/etc/acl.xml @@ -3,23 +3,23 @@ - - - - - + + + + + - - - - - + + + + + - - - - - + + + + + diff --git a/etc/adminhtml/menu.xml b/etc/adminhtml/menu.xml index 0ac1f555..84d5daef 100644 --- a/etc/adminhtml/menu.xml +++ b/etc/adminhtml/menu.xml @@ -2,22 +2,22 @@ - - - - + + + + - - + + - - - - + + + + - - - + + + From 304efeebb3873fc9cb72fc2c403e239a8b419f56 Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Thu, 17 Aug 2023 13:15:11 -0300 Subject: [PATCH 36/83] Fix: Removed domain protocol from csp_whitellist.xml (#223) --- etc/csp_whitelist.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/etc/csp_whitelist.xml b/etc/csp_whitelist.xml index 84ba97ba..768d77b4 100644 --- a/etc/csp_whitelist.xml +++ b/etc/csp_whitelist.xml @@ -5,14 +5,14 @@ - https://api.mundipagg.com - https://api.pagar.me + api.mundipagg.com + api.pagar.me - https://cdn.mundipagg.com - https://api.pagar.me + cdn.mundipagg.com + api.pagar.me From 474cba36024ae66cc3e94e29ab6b83c8ec3d4339 Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Thu, 17 Aug 2023 13:16:15 -0300 Subject: [PATCH 37/83] Refactor: Improve observers code (#224) * Improve observers code * Removinh unnecessary else * refactor: new function to remove if * added function to remove if --- Observer/CreditCardDataAssignObserver.php | 110 ++++++++++++++-------- 1 file changed, 70 insertions(+), 40 deletions(-) diff --git a/Observer/CreditCardDataAssignObserver.php b/Observer/CreditCardDataAssignObserver.php index 71ccc6ca..1768b872 100644 --- a/Observer/CreditCardDataAssignObserver.php +++ b/Observer/CreditCardDataAssignObserver.php @@ -12,17 +12,12 @@ namespace Pagarme\Pagarme\Observer; -use Magento\Framework\App\ObjectManager; use Magento\Framework\DataObject; -use Magento\Framework\Exception\NoSuchEntityException; -use Magento\Payment\Observer\AbstractDataAssignObserver; use Magento\Framework\Event\Observer; +use Magento\Payment\Observer\AbstractDataAssignObserver; use Magento\Quote\Api\Data\PaymentInterface; -use Pagarme\Core\Payment\Repositories\SavedCardRepository; -use Pagarme\Pagarme\Concrete\Magento2CoreSetup; -use Pagarme\Pagarme\Model\Cards; -use Pagarme\Pagarme\Model\CardsRepository; use Pagarme\Pagarme\Helper\MultiBuyerDataAssign; +use Pagarme\Pagarme\Model\CardsRepository; class CreditCardDataAssignObserver extends AbstractDataAssignObserver { @@ -57,49 +52,84 @@ public function execute(Observer $observer) $info->setAdditionalInformation('cc_saved_card', '0'); - if ($additionalData->getCcSavedCard()) { - $cardId = $additionalData->getCcSavedCard(); - $card = $this->cardsRepository->getById($cardId); + $this->fillCardData($additionalData, $info); - $info->setAdditionalInformation('cc_saved_card', $additionalData->getCcSavedCard()); - $info->setAdditionalInformation('cc_type', $card->getBrand()); - $info->setAdditionalInformation( - 'cc_last_4', - (string) $card->getLastFourNumbers() - ); - $info->addData([ - 'cc_type' => $card->getBrand(), - 'cc_owner' => $card->getCardHolderName(), - 'cc_last_4' => (string) $card->getLastFourNumbers() - ]); - }else{ - $info->setAdditionalInformation('cc_saved_card', $additionalData->getCcSavedCard()); - $info->setAdditionalInformation('cc_type', $additionalData->getCcType()); - if ($additionalData->getCcLast4()) { - $info->setAdditionalInformation('cc_last_4', substr($additionalData->getCcLast4(),-4)); - } - $info->setAdditionalInformation('cc_token_credit_card', $additionalData->getCcTokenCreditCard()); - $info->addData([ - 'cc_type' => $additionalData->getCcType(), - 'cc_owner' => $additionalData->getCcOwner(), - 'cc_last_4' => $additionalData->getCcLast4(), - 'cc_exp_month' => $additionalData->getCcExpMonth(), - 'cc_exp_year' => $additionalData->getCcExpYear(), - 'cc_token_credit_card' => $additionalData->getCcTokenCreditCard(), - ]); - - $info->setAdditionalInformation('cc_savecard', $additionalData->getCcSavecard()); - } $multiBuyerDataAssign = new MultiBuyerDataAssign(); $multiBuyerDataAssign->setCcMultiBuyer($info, $additionalData); $info->setAdditionalInformation('cc_installments', 1); if ($additionalData->getCcInstallments()) { - $info->setAdditionalInformation('cc_installments', (int) $additionalData->getCcInstallments()); + $info->setAdditionalInformation( + 'cc_installments', + (int) $additionalData->getCcInstallments() + ); } return $this; } + /** + * @param \Magento\Framework\DataObject $additionalData + * @param mixed $info + * @return void + */ + public function fillCardData(DataObject $additionalData, $info) + { + if ($additionalData->getCcSavedCard()) { + $this->fillSavedCardData($additionalData, $info); + return; + } + $this->fillNotSavedCardData($info, $additionalData); + } + + /** + * @param DataObject $additionalData + * @param $info + */ + private function fillSavedCardData(DataObject $additionalData, $info) + { + $cardId = $additionalData->getCcSavedCard(); + $card = $this->cardsRepository->getById($cardId); + + $info->setAdditionalInformation('cc_saved_card', $additionalData->getCcSavedCard()); + $info->setAdditionalInformation('cc_type', $card->getBrand()); + $info->setAdditionalInformation( + 'cc_last_4', + (string) $card->getLastFourNumbers() + ); + $info->addData([ + 'cc_type' => $card->getBrand(), + 'cc_owner' => $card->getCardHolderName(), + 'cc_last_4' => (string) $card->getLastFourNumbers() + ]); + } + + /** + * @param $info + * @param DataObject $additionalData + */ + private function fillNotSavedCardData($info, DataObject $additionalData) + { + $info->setAdditionalInformation('cc_saved_card', $additionalData->getCcSavedCard()); + $info->setAdditionalInformation('cc_type', $additionalData->getCcType()); + if ($additionalData->getCcLast4()) { + $info->setAdditionalInformation( + 'cc_last_4', + substr($additionalData->getCcLast4(),-4) + ); + } + $info->setAdditionalInformation('cc_token_credit_card', $additionalData->getCcTokenCreditCard()); + $info->addData([ + 'cc_type' => $additionalData->getCcType(), + 'cc_owner' => $additionalData->getCcOwner(), + 'cc_last_4' => $additionalData->getCcLast4(), + 'cc_exp_month' => $additionalData->getCcExpMonth(), + 'cc_exp_year' => $additionalData->getCcExpYear(), + 'cc_token_credit_card' => $additionalData->getCcTokenCreditCard(), + ]); + + $info->setAdditionalInformation('cc_savecard', $additionalData->getCcSavecard()); + } + } From a487c82e064c227ac9b0ed9e8d8fc3f4b2755b5b Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Thu, 17 Aug 2023 13:16:49 -0300 Subject: [PATCH 38/83] Fix: translations (#225) --- i18n/pt_BR.csv | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index f8a204d5..8e8da9ac 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -106,7 +106,7 @@ "Minimum Order Total","Total do Pedido Mínimo" "Maximum Order Total","Total máximo da ordem" "Payment Action","Ação de pagamento" -"Transaction Key\","Chave de transação \" +"Transaction Key\","Chave da transação \" "Test Mode","Modo de teste" "Gateway URL","URL do Gateway" "Transaction Details URL","URL de detalhes da transação" @@ -224,7 +224,7 @@ "Add To Pagar.me One Click","Adicionar Pagar.me One Click" "Save cards for future purchases","Salvar cartões para compras futuras" "Type","Tipo" -"Error to save Pagar.me Soft Description Credit Card, size too big max 22 character.","Erro para salvar Pagar.me Soft Descrição Cartão de Crédito, tamanho muito grande máximo 22 caracteres." +"Error to save Pagar.me Soft Description Credit Card, size too big max 22 character.","Erro ao salvar Pagar.me Soft Descriptor do Cartão de Crédito, tamanho excedeu o limite máximo de 22 caracteres." "Max size 22.","Tamanho máximo 22." "Please check your address. Street Address field (Street) is required.","Por favor, verifique seu endereço. O campo endereço é obrigatório." "Please check your address. Street Address field (Number) is required.","Por favor, verifique seu endereço. O campo número é obrigatório." @@ -359,7 +359,7 @@ "Document Number", "Número do documento" "Card Number", "Número do cartão" "Add a product with the following characteristics to create a plan product:", "Para criar um plano, adicione um produto do tipo bundle com as seguintes características:" -"- No main price", ""- Preço principal zerado" +"- No main price", "- Preço principal zerado" "- Dynamic price: no", "- Preço dinâmico: não" "- Subproducts","- Subprodutos" "See the documentation on https://github.com/pagarme/magento2/wiki/Plan-products", "Veja a documentação em https://github.com/pagarme/magento2/wiki/Plan-products" From 70c6fba8e78edd09316d5fb51f4272e3e6d84f5f Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:59:38 -0300 Subject: [PATCH 39/83] cd: add marketplace on images --- .github/data/auth.json | 8 -------- .github/data/docker-compose.yml | 12 +++++++++++- .github/data/master/Dockerfile | 22 ++++++++++++++++++++-- .github/data/php8/Dockerfile | 22 ++++++++++++++++++++-- .github/data/stg/Dockerfile | 22 ++++++++++++++++++++-- .github/data/test/Dockerfile | 4 +++- .github/workflows/cd_reusable.yml | 16 +++++++++++----- 7 files changed, 85 insertions(+), 21 deletions(-) delete mode 100644 .github/data/auth.json diff --git a/.github/data/auth.json b/.github/data/auth.json deleted file mode 100644 index 0613328f..00000000 --- a/.github/data/auth.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "http-basic": { - "repo.magento.com": { - "username": "65f44c6ca934b35057219b5e4a705c18", - "password": "8d758e29385fb2d1500421dbc4217403" - } - } -} diff --git a/.github/data/docker-compose.yml b/.github/data/docker-compose.yml index e4470411..cc7328c0 100644 --- a/.github/data/docker-compose.yml +++ b/.github/data/docker-compose.yml @@ -18,7 +18,17 @@ services: - 'mariadb_data:/bitnami/mariadb' magento: container_name: magento2_bitnami - build: . + build: + context: . + args: + - MAGENTO_KEY=${MAGENTO_KEY} + - MAGENTO_SECRET=${MAGENTO_SECRET} + - MARKETPLACE_KEY=${MARKETPLACE_KEY} + - MARKETPLACE_SECRET=${MARKETPLACE_SECRET} + - MARKETPLACE_REPO=${MARKETPLACE_REPO} + - MARKETPLACE_NAME=${MARKETPLACE_NAME} + - MARKETPLACE_VERSION=${MARKETPLACE_VERSION} + - MARKETPLACE_REPO_URL=${MARKETPLACE_REPO_URL} ports: - '80:8080' - '443:8443' diff --git a/.github/data/master/Dockerfile b/.github/data/master/Dockerfile index 37b9bb56..7d251264 100644 --- a/.github/data/master/Dockerfile +++ b/.github/data/master/Dockerfile @@ -1,6 +1,24 @@ FROM bitnami/magento:2.4.5 MAINTAINER Open Source Team +ENV COMPOSER_ALLOW_SUPERUSER=1 + WORKDIR /opt/bitnami/magento -COPY auth.json /opt/bitnami/magento -RUN composer require pagarme/pagarme-magento2-module:master \ No newline at end of file +ARG MAGENTO_KEY +ARG MAGENTO_SECRET +ARG MARKETPLACE_KEY +ARG MARKETPLACE_SECRET +ARG MARKETPLACE_REPO +ARG MARKETPLACE_NAME +ARG MARKETPLACE_VERSION +ARG MARKETPLACE_REPO_URL + +RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} +RUN composer require pagarme/pagarme-magento2-module:dev-master + +RUN apt update +RUN apt install git -y + +RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} +RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} +RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} \ No newline at end of file diff --git a/.github/data/php8/Dockerfile b/.github/data/php8/Dockerfile index c6c01979..7ae8ee9c 100644 --- a/.github/data/php8/Dockerfile +++ b/.github/data/php8/Dockerfile @@ -1,6 +1,24 @@ FROM bitnami/magento:2.4.5 MAINTAINER Open Source Team +ENV COMPOSER_ALLOW_SUPERUSER=1 + WORKDIR /opt/bitnami/magento -COPY auth.json /opt/bitnami/magento -RUN composer require pagarme/pagarme-magento2-module:dev-stg \ No newline at end of file +ARG MAGENTO_KEY +ARG MAGENTO_SECRET +ARG MARKETPLACE_KEY +ARG MARKETPLACE_SECRET +ARG MARKETPLACE_REPO +ARG MARKETPLACE_NAME +ARG MARKETPLACE_VERSION +ARG MARKETPLACE_REPO_URL + +RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} +RUN composer require pagarme/pagarme-magento2-module:dev-stg + +RUN apt update +RUN apt install git -y + +RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} +RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} +RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} \ No newline at end of file diff --git a/.github/data/stg/Dockerfile b/.github/data/stg/Dockerfile index 29337b5d..f2067b5f 100644 --- a/.github/data/stg/Dockerfile +++ b/.github/data/stg/Dockerfile @@ -1,6 +1,24 @@ FROM bitnami/magento:2.4.3 MAINTAINER Open Source Team +ENV COMPOSER_ALLOW_SUPERUSER=1 + WORKDIR /opt/bitnami/magento -COPY auth.json /opt/bitnami/magento -RUN composer require pagarme/pagarme-magento2-module:dev-stg \ No newline at end of file +ARG MAGENTO_KEY +ARG MAGENTO_SECRET +ARG MARKETPLACE_KEY +ARG MARKETPLACE_SECRET +ARG MARKETPLACE_REPO +ARG MARKETPLACE_NAME +ARG MARKETPLACE_VERSION +ARG MARKETPLACE_REPO_URL + +RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} +RUN composer require pagarme/pagarme-magento2-module:dev-stg + +RUN apt update +RUN apt install git -y + +RUN composer config -g repositories.marketplace_repo composer ${MARKETPLACE_REPO} +RUN composer config -g http-basic.${MARKETPLACE_REPO_URL} ${MARKETPLACE_KEY} ${MARKETPLACE_SECRET} +RUN composer require ${MARKETPLACE_NAME}:${MARKETPLACE_VERSION} \ No newline at end of file diff --git a/.github/data/test/Dockerfile b/.github/data/test/Dockerfile index 0d26b853..524386a4 100644 --- a/.github/data/test/Dockerfile +++ b/.github/data/test/Dockerfile @@ -2,5 +2,7 @@ FROM bitnami/magento:2.4.3 MAINTAINER Open Source Team WORKDIR /opt/bitnami/magento -COPY auth.json /opt/bitnami/magento + +RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} + RUN composer require pagarme/pagarme-magento2-module:dev-test \ No newline at end of file diff --git a/.github/workflows/cd_reusable.yml b/.github/workflows/cd_reusable.yml index 528cf735..06612cd0 100644 --- a/.github/workflows/cd_reusable.yml +++ b/.github/workflows/cd_reusable.yml @@ -21,7 +21,6 @@ jobs: - name: Copy CI files to root run: | - cp .github/data/auth.json . cp .github/data/docker-compose.yml . cp .github/data/${{ matrix.tags }}/Dockerfile . cp .github/data/wait-for-mysql.sh . @@ -29,7 +28,14 @@ jobs: - name: Build image base for modifications run: | - ls + export MAGENTO_KEY=${{ secrets.MAGENTO_KEY }} + export MAGENTO_SECRET=${{ secrets.MAGENTO_SECRET }} + export MARKETPLACE_KEY=${{ secrets.MARKETPLACE_KEY }} + export MARKETPLACE_SECRET=${{ secrets.MARKETPLACE_SECRET }} + export MARKETPLACE_REPO=${{ secrets.MARKETPLACE_REPO }} + export MARKETPLACE_NAME=${{ secrets.MARKETPLACE_NAME }} + export MARKETPLACE_VERSION=${{ secrets.MARKETPLACE_VERSION }} + export MARKETPLACE_REPO_URL=${{ secrets.MARKETPLACE_REPO_URL }} docker compose up -d - name: Activate and setup Plugin @@ -38,7 +44,7 @@ jobs: name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 with: - registry: mpdockerregistry.azurecr.io + registry: ${{ secrets.DOCKER_ACCOUNT }} username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - @@ -46,14 +52,14 @@ jobs: id: meta uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38 with: - images: mpdockerregistry.azurecr.io/magento2-pagarme + images: ${{ secrets.DOCKER_ACCOUNT }}/magento2-pagarme - name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: context: . push: true - tags: mpdockerregistry.azurecr.io/magento2-pagarme:${{ matrix.tags }} + tags: ${{ secrets.DOCKER_ACCOUNT }}/magento2-pagarme:${{ matrix.tags }} labels: ${{ steps.meta.outputs.labels }} # name: Commit and push Docker image # run: | From 611644c74db6a8a29af89402f8cdfa3196b701f5 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:12:43 -0300 Subject: [PATCH 40/83] cd: fix test image --- .github/data/test/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/data/test/Dockerfile b/.github/data/test/Dockerfile index 524386a4..c0b94f88 100644 --- a/.github/data/test/Dockerfile +++ b/.github/data/test/Dockerfile @@ -2,6 +2,8 @@ FROM bitnami/magento:2.4.3 MAINTAINER Open Source Team WORKDIR /opt/bitnami/magento +ARG MAGENTO_KEY +ARG MAGENTO_SECRET RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} From e8a698240054415504f0afc42f518e16dad4d644 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Thu, 17 Aug 2023 14:15:10 -0300 Subject: [PATCH 41/83] cd: add composer allow root --- .github/data/test/Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/data/test/Dockerfile b/.github/data/test/Dockerfile index c0b94f88..1e1ac84c 100644 --- a/.github/data/test/Dockerfile +++ b/.github/data/test/Dockerfile @@ -1,7 +1,10 @@ FROM bitnami/magento:2.4.3 MAINTAINER Open Source Team +ENV COMPOSER_ALLOW_SUPERUSER=1 + WORKDIR /opt/bitnami/magento + ARG MAGENTO_KEY ARG MAGENTO_SECRET From c47280a54b34d10c22c160599c3a6d4eab40b3c6 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 17 Aug 2023 15:00:09 -0300 Subject: [PATCH 42/83] feat: removing string extraction from recurrence (#226) --- .../Recurrence/Subscriptions/Subscription.php | 5 +- Helper/ProductHelper.php | 149 ++++-------------- Observer/DiscountCyclesObserver.php | 59 ------- .../Catalog/Helper/Product/Configuration.php | 78 --------- Setup/UpgradeData.php | 108 ++++++++++++- composer.json | 2 +- etc/events.xml | 5 - etc/frontend/di.xml | 7 - etc/module.xml | 2 +- i18n/en_US.csv | 2 + i18n/pt_BR.csv | 2 + 11 files changed, 143 insertions(+), 276 deletions(-) delete mode 100755 Observer/DiscountCyclesObserver.php delete mode 100644 Plugin/Catalog/Helper/Product/Configuration.php diff --git a/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php b/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php index c9430616..575d7ba1 100644 --- a/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php +++ b/Block/Adminhtml/Recurrence/Subscriptions/Subscription.php @@ -2,6 +2,7 @@ namespace Pagarme\Pagarme\Block\Adminhtml\Recurrence\Subscriptions; +use Exception; use Magento\Catalog\Api\ProductRepositoryInterfaceFactory; use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory; use Magento\Cms\Block\Adminhtml\Page\Grid\Renderer\Action\UrlBuilder; @@ -19,8 +20,6 @@ use Pagarme\Core\Recurrence\ValueObjects\IntervalValueObject; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Pagarme\Ui\Component\Column\Invoices\Actions; -use Pagarme\Pagarme\Ui\Component\Recurrence\Column\TotalCyclesByProduct; use Magento\Catalog\Model\ResourceModel\Product\Collection as ProductCollection; use Magento\Catalog\Model\Product\Interceptor as ProductInterceptor; @@ -47,7 +46,7 @@ class Subscription extends Template * @param Context $context * @param CollectionFactory $productCollectionFactory * @param Registry $registry - * @param ProductHelper $productHelper + * @throws Exception */ public function __construct( Context $context, diff --git a/Helper/ProductHelper.php b/Helper/ProductHelper.php index d4c0724e..b1cdad79 100644 --- a/Helper/ProductHelper.php +++ b/Helper/ProductHelper.php @@ -2,143 +2,56 @@ namespace Pagarme\Pagarme\Helper; +use Magento\Catalog\Api\ProductRepositoryInterface; use Magento\Catalog\Helper\Image; -use Magento\Framework\App\ObjectManager; +use Magento\Framework\App\Helper\AbstractHelper; +use Magento\Framework\App\Helper\Context; +use Magento\Framework\Exception\NoSuchEntityException; use Magento\Framework\UrlInterface; -use Pagarme\Pagarme\Concrete\Magento2PlatformProductDecorator; +use Magento\Store\Model\StoreManagerInterface; -class ProductHelper +class ProductHelper extends AbstractHelper { - public function getProductImage($id) - { - $_objectManager = ObjectManager::getInstance(); - $product = $_objectManager->create('Magento\Catalog\Model\Product')->load($id); - - $imageHelper = $_objectManager->get(Image::class); - - $store = $_objectManager->get('Magento\Store\Model\StoreManagerInterface')->getStore(); - $imageUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage(); - - if (empty($product->getImage())) { - $imageUrl = $imageHelper->getDefaultPlaceholderUrl('image'); - } - - return $imageUrl; - } - /** - * @param int[] $productIdList - * @return array|null + * @var ProductRepositoryInterface */ - public function getProductList(array $productIdList) - { - $objectManager = ObjectManager::getInstance(); - - $productList = []; - foreach ($productIdList as $productId) { - $product = $objectManager - ->create('Magento\Catalog\Model\Product') - ->load($productId); - - $platformProduct = new Magento2PlatformProductDecorator($product); - $productList[] = $product; - } - - return $productList; - } - - + private $productRepository; /** - * @param string $title - * @return string + * @var Image */ - public static function applyDiscount($title, $product) - { - $value = ProductHelper::extractValueFromTitle($title); - if (!$value) { - return $title; - } - $price = ProductHelper::applyMoneyFormat( - ProductHelper::calculateDiscount( - $value, - ProductHelper::getDiscountAmount($product) - ) - ); - - return strtok($title, '-') . ' - ' . $price; - } - + private $imageHelper; /** - * @param Product $product - * @return int + * @var StoreManagerInterface */ - public static function getDiscountAmount($product) - { - return abs(number_format($product->getPrice(), 2) - number_format($product->getFinalPrice(), 2)); - } + private $storeManager; - /** - * @param string $title - * @return float - */ - public static function extractValueFromTitle($title) - { - return (float)str_replace(',', '.', - preg_replace('/[^0-9,.]/', '', - ProductHelper::getStringBetween($title, '(', ')')) - ); + public function __construct( + Context $context, + ProductRepositoryInterface $productRepository, + Image $imageHelper, + StoreManagerInterface $storeManager + ) { + parent::__construct($context); + $this->productRepository = $productRepository; + $this->imageHelper = $imageHelper; + $this->storeManager = $storeManager; } /** - * @param int $value - * @param int $discountAmount - * @return int + * @return string + * @throws NoSuchEntityException */ - public static function calculateDiscount($value, $discountAmount) + public function getProductImage($id) { - $result = ProductHelper::convertDecimalMoney($value - $discountAmount); - if ($result > 0) { - $value = (float) $result; - } - return $value; - } + $product = $this->productRepository->getById($id); - /** - * @param int $amount - * @return float - */ - public static function convertDecimalMoney($amount) - { - return number_format($amount, 2); - } + $store = $this->storeManager->getStore(); + $imageUrl = $store->getBaseUrl(UrlInterface::URL_TYPE_MEDIA) . 'catalog/product' . $product->getImage(); - /** - * @param string|array $title - * @param string $starting_word - * @param string $ending_word - * @return string - */ - public static function getStringBetween($title, $first_string, $second_string) - { - $str = json_encode($title); - $arr = explode($first_string, $str ?? ''); - if (isset($arr[1])) { - $arr = explode($second_string, $arr[1]); - return $arr[0]; + if (empty($product->getImage())) { + $imageUrl = $this->imageHelper->getDefaultPlaceholderUrl('image'); } - return ''; - } - /** - * @param int $number - * @return float - */ - public static function applyMoneyFormat($number) - { - $numberFormatter = new \NumberFormatter( - 'pt-BR', - \NumberFormatter::CURRENCY - ); - return $numberFormatter->format($number); + return $imageUrl; } } diff --git a/Observer/DiscountCyclesObserver.php b/Observer/DiscountCyclesObserver.php deleted file mode 100755 index 6da9dc26..00000000 --- a/Observer/DiscountCyclesObserver.php +++ /dev/null @@ -1,59 +0,0 @@ -productHelper = $productHelper; - } - - /** - * @param Observer $observer - */ - public function execute(Observer $observer) - { - if (isset($observer->getProduct()->getOptions()[0])) { - $this->applyDiscountCycles( - $observer->getProduct()->getOptions()[0]->getValues(), - $observer->getProduct() - ); - } - } - - /** - * @param Cycles $cycles - * @param Product $product - */ - private function applyDiscountCycles($cycles, $product) - { - foreach ($cycles as $cycle) { - $cycle->setTitle(ProductHelper::applyDiscount($cycle->getTitle(), $product)); - } - } -} \ No newline at end of file diff --git a/Plugin/Catalog/Helper/Product/Configuration.php b/Plugin/Catalog/Helper/Product/Configuration.php deleted file mode 100644 index d63b6b45..00000000 --- a/Plugin/Catalog/Helper/Product/Configuration.php +++ /dev/null @@ -1,78 +0,0 @@ -pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); - $this->recurrenceService = $recurrenceService; - } - - /** - * @param ConfigurationOriginal $subject - * @param callable $proceed - * @param ItemInterface $item - * @return array - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function aroundGetCustomOptions( - ConfigurationOriginal $subject, - callable $proceed, - ItemInterface $item - ) { - $result = $proceed($item); - - $product = $item->getProduct(); - $hasNoRecurrence = !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() || - empty($this->recurrenceService->getRecurrenceProductByProductId($product->getId())); - if ($hasNoRecurrence) { - return $result; - } - - $updateCycleValueCallback = function ($item) use ($product) { - if (ucfirst(RecurrenceSubscriptionRepetitionsInterface::CYCLES) !== $item['label']) { - return $item; - } - - $item['value'] = ProductHelper::applyDiscount($item['value'], $product); - return $item; - }; - - return array_map($updateCycleValueCallback, $result); - } -} diff --git a/Setup/UpgradeData.php b/Setup/UpgradeData.php index a952feba..06c588d7 100644 --- a/Setup/UpgradeData.php +++ b/Setup/UpgradeData.php @@ -3,28 +3,128 @@ namespace Pagarme\Pagarme\Setup; +use Magento\Catalog\Api\ProductRepositoryInterface; +use Magento\Framework\App\Area; +use Magento\Framework\App\State; +use Magento\Framework\Exception\CouldNotSaveException; +use Magento\Framework\Exception\InputException; +use Magento\Framework\Exception\LocalizedException; +use Magento\Framework\Exception\NoSuchEntityException; +use Magento\Framework\Exception\StateException; use Magento\Framework\Setup\UpgradeDataInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\ModuleDataSetupInterface; -use Magento\Framework\DB\Ddl\Table; use Magento\Customer\Setup\CustomerSetupFactory; - - -use Magento\Eav\Setup\EavSetup; use Magento\Eav\Setup\EavSetupFactory; +use Pagarme\Core\Recurrence\Aggregates\ProductSubscription; +use Pagarme\Core\Recurrence\Services\ProductSubscriptionService; +use Pagarme\Pagarme\Api\Data\RecurrenceSubscriptionRepetitionsInterface; +use Pagarme\Pagarme\Concrete\Magento2CoreSetup; +use Psr\Log\LoggerInterface; class UpgradeData implements UpgradeDataInterface { + /** + * @var ProductSubscriptionService + */ + private $productSubscriptionService; + + /** + * @var ProductRepositoryInterface + */ + private $productRepository; + + /** + * @var State + */ + private $state; + + /** + * @var LoggerInterface + */ + private $logger; + + public function __construct(ProductRepositoryInterface $productRepository, State $state, LoggerInterface $logger) + { + Magento2CoreSetup::bootstrap(); + $this->productSubscriptionService = new ProductSubscriptionService(); + $this->productRepository = $productRepository; + $this->state = $state; + $this->logger = $logger; + } /** * @param ModuleDataSetupInterface $setup * @param ModuleContextInterface $context + * @throws LocalizedException */ public function upgrade( ModuleDataSetupInterface $setup, ModuleContextInterface $context ) { $setup->startSetup(); + + if (version_compare($context->getVersion(), '2.2.5', '<')) { + $this->updateProductSubscriptionOptionsTitle(); + } + $setup->endSetup(); } + + /** + * @throws LocalizedException + */ + private function updateProductSubscriptionOptionsTitle() + { + $this->state->setAreaCode(Area::AREA_ADMINHTML); + $productSubscriptions = $this->productSubscriptionService->findAll(); + foreach ($productSubscriptions as $productSubscription) { + $this->applyTitleWithoutParentheses($productSubscription); + } + } + + + /** + * @param ProductSubscription $productSubscription + * @return void + */ + private function applyTitleWithoutParentheses($productSubscription) + { + $productId = $productSubscription->getProductId(); + try { + $product = $this->productRepository->getById($productId); + $productOptions = $product->getOptions(); + foreach ($productOptions as $productOption) { + $isCyclesOption = $productOption->getTitle() === ucfirst( + RecurrenceSubscriptionRepetitionsInterface::CYCLES + ); + if ($isCyclesOption) { + $productOptionValues = $productOption->getValues(); + foreach ($productOptionValues as $productOptionValue) { + $titleWithoutParentheses = str_replace( + ['(', ')'], + '', + $productOptionValue->getTitle() + ); + $productOptionValue->setTitle($titleWithoutParentheses); + } + + try { + $this->productRepository->save($product); + } catch (CouldNotSaveException | InputException | StateException $e) { + $this->logger->error( + __( + 'Error updating cycles options for product with id %s. Error message: %s', + $product->getId(), + $e->getMessage() + ) + ); + } + break; + } + } + } catch (NoSuchEntityException $e) { + $this->logger->error(__('Subscription product with id %s not founded', $productId)); + } + } } diff --git a/composer.json b/composer.json index 88b75d75..338db8fd 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.4", + "version": "2.2.5", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", "require": { diff --git a/etc/events.xml b/etc/events.xml index 03d40233..91cc58e3 100644 --- a/etc/events.xml +++ b/etc/events.xml @@ -61,11 +61,6 @@ instance="Pagarme\Pagarme\Observer\UpdateProductPlanObserver" /> - - - - diff --git a/etc/frontend/di.xml b/etc/frontend/di.xml index 21b3a5c5..eed647e8 100755 --- a/etc/frontend/di.xml +++ b/etc/frontend/di.xml @@ -76,11 +76,4 @@ - - - - diff --git a/etc/module.xml b/etc/module.xml index ccfd0e55..8d4024ec 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 8e8c4000..bc41059f 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -308,3 +308,5 @@ "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" diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 8e8da9ac..83467a42 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -487,3 +487,5 @@ "Scan the QR Code","Escaneie o QR Code" "Confirm the payment","Confirme o pagamento" "View Billet","Visualizar Boleto" +"Error updating cycles options for product with id %s. Error message: %s","Erro ao atualizar as opções de ciclos para o produto com o id %s. Mensagem de erro: %s" +"Subscription product with id %s not founded","Produto de assinatura com id %s não encontrado" From ac0bf3a5cb6f0f0201b134e6f68c8d4862c1652f Mon Sep 17 00:00:00 2001 From: Rafael Seiffer Melazzo Date: Thu, 17 Aug 2023 15:38:43 -0300 Subject: [PATCH 43/83] feat: added pix informations to graphql (#227) * Added pix informations to graphql * Remove the unused function parameter "$subject" * fix: adding subject parameter in plugin --------- Co-authored-by: Mateus Picoloto --- Model/Graphql/PixDataProvider.php | 29 ++++++++++++++ Plugin/GraphQl/PlaceOrder.php | 63 +++++++++++++++++++++++++++++++ etc/graphql/di.xml | 13 +++++++ etc/schema.graphqls | 8 ++++ 4 files changed, 113 insertions(+) create mode 100644 Model/Graphql/PixDataProvider.php create mode 100644 Plugin/GraphQl/PlaceOrder.php create mode 100644 etc/graphql/di.xml create mode 100644 etc/schema.graphqls diff --git a/Model/Graphql/PixDataProvider.php b/Model/Graphql/PixDataProvider.php new file mode 100644 index 00000000..b02926fe --- /dev/null +++ b/Model/Graphql/PixDataProvider.php @@ -0,0 +1,29 @@ +orderRepository = $orderRepository; + $this->orderFactory = $orderFactory; + } + + /** + * @param \Magento\QuoteGraphQl\Model\Resolver\PlaceOrder $subject + * @param mixed $result + * @return mixed + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + public function afterResolve( + \Magento\QuoteGraphQl\Model\Resolver\PlaceOrder $subject, + $result + ) { + $order = $this->orderFactory->create()->loadByIncrementId($result['order']['order_number']); + $payment = $order->getPayment(); + + + if (strpos($payment->getMethod(), "pagarme_pix") === false) { + return $result; + } + + $lastTransId = $payment->getLastTransId(); + $orderId = substr($lastTransId, 0, 19); + + Magento2CoreSetup::bootstrap(); + $orderService= new \Pagarme\Core\Payment\Services\OrderService(); + $result['pagarme_pix'] = $orderService->getPixQrCodeInfoFromOrder(new OrderId($orderId)); + + return $result; + } +} diff --git a/etc/graphql/di.xml b/etc/graphql/di.xml new file mode 100644 index 00000000..5cc41018 --- /dev/null +++ b/etc/graphql/di.xml @@ -0,0 +1,13 @@ + + + + + + + + + Pagarme\Pagarme\Model\Graphql\PixDataProvider + + + + \ No newline at end of file diff --git a/etc/schema.graphqls b/etc/schema.graphqls new file mode 100644 index 00000000..62af28f2 --- /dev/null +++ b/etc/schema.graphqls @@ -0,0 +1,8 @@ +type PlaceOrderOutput { + pagarme_pix: PagarmePix +} + +type PagarmePix { + qr_code: String, + qr_code_url: String +} \ No newline at end of file From 4c4d817710a3106cfdebb3baea7bbba4da632899 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Fri, 18 Aug 2023 16:52:28 -0300 Subject: [PATCH 44/83] refactor: moving inline css to css file (#230) --- view/frontend/web/css/pagarme_style.css | 16 ++++++++++- .../web/template/payment/boleto-form.html | 8 +----- .../web/template/payment/creditcard-form.html | 22 ++++++--------- .../web/template/payment/multibuyer-form.html | 28 +++++++++---------- .../web/template/payment/pix-form.html | 3 +- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/view/frontend/web/css/pagarme_style.css b/view/frontend/web/css/pagarme_style.css index 877b457e..64340703 100644 --- a/view/frontend/web/css/pagarme_style.css +++ b/view/frontend/web/css/pagarme_style.css @@ -21,4 +21,18 @@ .multibuyer { width: 335px; display: none; -} \ No newline at end of file +} + +.hidden-element { + display: none; +} + +.field .control .fields .field .control .cc_saved_creditcards, +.field .control .fields .field .control .cc_installments { + width: 335px; +} + +.field .control .cc_amount, +.field .control .cc_owner { + width: 225px; +} diff --git a/view/frontend/web/template/payment/boleto-form.html b/view/frontend/web/template/payment/boleto-form.html index ee03afae..da37dec5 100644 --- a/view/frontend/web/template/payment/boleto-form.html +++ b/view/frontend/web/template/payment/boleto-form.html @@ -1,11 +1,10 @@ -
    +
    - \ No newline at end of file diff --git a/view/frontend/web/template/payment/creditcard-form.html b/view/frontend/web/template/payment/creditcard-form.html index 386b96c3..346a9df0 100644 --- a/view/frontend/web/template/payment/creditcard-form.html +++ b/view/frontend/web/template/payment/creditcard-form.html @@ -1,4 +1,4 @@ -
    - @@ -154,7 +151,6 @@
    @@ -163,7 +159,7 @@
    - diff --git a/view/frontend/web/template/payment/multibuyer-form.html b/view/frontend/web/template/payment/multibuyer-form.html index 59e3d55d..ea5fa5b4 100644 --- a/view/frontend/web/template/payment/multibuyer-form.html +++ b/view/frontend/web/template/payment/multibuyer-form.html @@ -14,7 +14,7 @@

    <
    - @@ -26,7 +26,7 @@

    <
    - @@ -38,7 +38,7 @@

    <
    - @@ -50,7 +50,7 @@

    <
    - @@ -62,7 +62,7 @@

    <
    - @@ -74,7 +74,7 @@

    <
    - @@ -86,7 +86,7 @@

    <
    - @@ -98,7 +98,7 @@

    <
    - @@ -110,7 +110,7 @@

    <
    - @@ -122,7 +122,7 @@

    <
    - @@ -134,7 +134,7 @@

    <
    - @@ -146,7 +146,7 @@

    <
    - @@ -159,10 +159,10 @@

    <

    - -
    \ No newline at end of file +
    diff --git a/view/frontend/web/template/payment/pix-form.html b/view/frontend/web/template/payment/pix-form.html index 15fb226f..ea16b1eb 100644 --- a/view/frontend/web/template/payment/pix-form.html +++ b/view/frontend/web/template/payment/pix-form.html @@ -5,7 +5,6 @@
    -
    \ No newline at end of file +
    From 35a74b21ab71fff08f57c38d494d64598f411e6f Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:06:46 -0300 Subject: [PATCH 45/83] build: changing module core version (#231) --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 338db8fd..d262999e 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "description": "Magento 2 Module Pagar.me", "require": { "php": ">=7.1", - "pagarme/ecommerce-module-core": "2.2.*" + "pagarme/ecommerce-module-core": "dev-develop" }, "require-dev": { "phpunit/phpunit": "4.1.0", From 9e894e62bac3107159af69d2c8fb6acceecff62a Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 21 Aug 2023 12:19:39 -0300 Subject: [PATCH 46/83] build: changing module core version (#232) * build: changing module core version * build: changing minimum stability --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index d262999e..6cbe0f5a 100755 --- a/composer.json +++ b/composer.json @@ -41,5 +41,6 @@ }, "config":{ "secure-http":false - } + }, + "minimum-stability": "dev" } From 681d80a166ed11258c72db3b656ab50a63520889 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 21 Aug 2023 14:51:33 -0300 Subject: [PATCH 47/83] fix: set area code only if is not setted (#233) --- Setup/UpgradeData.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Setup/UpgradeData.php b/Setup/UpgradeData.php index 06c588d7..ae82e801 100644 --- a/Setup/UpgradeData.php +++ b/Setup/UpgradeData.php @@ -76,7 +76,9 @@ public function upgrade( */ private function updateProductSubscriptionOptionsTitle() { - $this->state->setAreaCode(Area::AREA_ADMINHTML); + if (empty($this->state->getAreaCode())) { + $this->state->setAreaCode(Area::AREA_ADMINHTML); + } $productSubscriptions = $this->productSubscriptionService->findAll(); foreach ($productSubscriptions as $productSubscription) { $this->applyTitleWithoutParentheses($productSubscription); From a5bf5b2d814f1e7830bc1bde82bc1e1c2d6b2b10 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Mon, 21 Aug 2023 16:03:48 -0300 Subject: [PATCH 48/83] cd: refactory cd (#235) --- .github/data/docker-compose.yml | 54 ------------------------ .github/data/magento2_module_install.sql | 40 ------------------ .github/data/php8/Dockerfile | 2 +- .github/data/stg/Dockerfile | 2 +- .github/data/wait-for-mysql.sh | 4 -- .github/workflows/cd_reusable.yml | 27 ++++-------- 6 files changed, 11 insertions(+), 118 deletions(-) delete mode 100644 .github/data/docker-compose.yml delete mode 100644 .github/data/magento2_module_install.sql delete mode 100644 .github/data/wait-for-mysql.sh diff --git a/.github/data/docker-compose.yml b/.github/data/docker-compose.yml deleted file mode 100644 index cc7328c0..00000000 --- a/.github/data/docker-compose.yml +++ /dev/null @@ -1,54 +0,0 @@ -version: '3.4' -volumes: - mariadb_data: - driver: local - magento_data: - driver: local - elasticsearch_data: - driver: local -services: - mariadb: - image: docker.io/bitnami/mariadb:10.4 - environment: - - ALLOW_EMPTY_PASSWORD=yes - - MARIADB_USER=bn_magento - - MARIADB_PASSWORD=MX01]UI9(1@p*dUQ - - MARIADB_DATABASE=bitnami_magento - volumes: - - 'mariadb_data:/bitnami/mariadb' - magento: - container_name: magento2_bitnami - build: - context: . - args: - - MAGENTO_KEY=${MAGENTO_KEY} - - MAGENTO_SECRET=${MAGENTO_SECRET} - - MARKETPLACE_KEY=${MARKETPLACE_KEY} - - MARKETPLACE_SECRET=${MARKETPLACE_SECRET} - - MARKETPLACE_REPO=${MARKETPLACE_REPO} - - MARKETPLACE_NAME=${MARKETPLACE_NAME} - - MARKETPLACE_VERSION=${MARKETPLACE_VERSION} - - MARKETPLACE_REPO_URL=${MARKETPLACE_REPO_URL} - ports: - - '80:8080' - - '443:8443' - environment: - - MAGENTO_HOST=localhost - - MAGENTO_DATABASE_HOST=mariadb - - MAGENTO_DATABASE_PORT_NUMBER=3306 - - MAGENTO_DATABASE_USER=bn_magento - - MAGENTO_DATABASE_PASSWORD=MX01]UI9(1@p*dUQ - - MAGENTO_DATABASE_NAME=bitnami_magento - - ELASTICSEARCH_HOST=elasticsearch - - ELASTICSEARCH_PORT_NUMBER=9200 - - ALLOW_EMPTY_PASSWORD=yes - volumes: - - 'magento_data:/bitnami/magento' - depends_on: - - mariadb - - elasticsearch - elasticsearch: - image: docker.io/bitnami/elasticsearch:7 - volumes: - - 'elasticsearch_data:/bitnami/elasticsearch/data' - diff --git a/.github/data/magento2_module_install.sql b/.github/data/magento2_module_install.sql deleted file mode 100644 index f7bfc88d..00000000 --- a/.github/data/magento2_module_install.sql +++ /dev/null @@ -1,40 +0,0 @@ -INSERT INTO magento2.core_config_data (scope, scope_id, path, value) -VALUES ('default', 0, 'pagarme_pagarme/global/test_mode', '1'), -('default', 0, 'payment/pagarme_customer_address/street_attribute', 'street_1'), -('default', 0, 'payment/pagarme_customer_address/number_attribute', 'street_2'), -('default', 0, 'payment/pagarme_customer_address/complement_attribute', 'street_3'), -('default', 0, 'payment/pagarme_customer_address/district_attribute', 'street_4'), -('default', 0, 'payment/pagarme_pix/active', '1'), -('default', 0, 'payment/pagarme_pix/title', 'Pagar.me Pix'), -('default', 0, 'payment/pagarme_pix/expiration_qrcode', '3600'), -('default', 0, 'payment/pagarme_creditcard/active', '1'), -('default', 0, 'payment/pagarme_creditcard/title', 'Pagar.me Cartao'), -('default', 0, 'payment/pagarme_creditcard/soft_description', 'Magento 2 stg'), -('default', 0, 'payment/pagarme_creditcard/payment_action', 'authorize_capture'), -('default', 0, 'payment/pagarme_creditcard/sort_order', '1'), -('default', 0, 'payment/pagarme_creditcard/cctypes', 'Visa,Mastercard,Amex,Hipercard,Diners,Elo,Discover,Aura'), -('default', 0, 'payment/pagarme_creditcard/installments_active', '1'), -('default', 0, 'payment/pagarme_creditcard/installments_type', '1'), -('default', 0, 'payment/pagarme_creditcard/installments_number', '12'), -('default', 0, 'payment/pagarme_creditcard/installment_min_amount', '10.00'), -('default', 0, 'payment/pagarme_creditcard/installments_interest_by_issuer', '1'), -('default', 0, 'payment/pagarme_creditcard/installments_interest_rate_initial', '10'), -('default', 0, 'payment/pagarme_creditcard/installments_interest_rate_incremental', '1'), -('default', 0, 'payment/pagarme_creditcard/installments_max_without_interest', '6'), -('default', 0, 'payment/pagarme_creditcard/antifraud_active', '0'), -('default', 0, 'payment/pagarme_billet/active', '1'), -('default', 0, 'payment/pagarme_billet/title', 'Pagar.me Boleto'), -('default', 0, 'payment/pagarme_billet/text', 'Voce podera imprimir seu boleto apos finalizar a compra'), -('default', 0, 'payment/pagarme_billet/types', 'Itau'), -('default', 0, 'payment/pagarme_billet/instructions', 'Pagar ate o vencimento'), -('default', 0, 'payment/pagarme_billet/expiration_days', '5'), -('default', 0, 'payment/pagarme_billet/sort_order', '1'), -('default', 0, 'payment/pagarme_two_creditcard/active', '1'), -('default', 0, 'payment/pagarme_two_creditcard/title', 'Pagar.me 2 cartoes'), -('default', 0, 'payment/pagarme_two_creditcard/sort_order', '1'), -('default', 0, 'payment/pagarme_billet_creditcard/active', '1'), -('default', 0, 'payment/pagarme_billet_creditcard/title', 'Pagar.me Boleto e Cartao'), -('default', 0, 'payment/pagarme_billet_creditcard/sort_order', '1'), -('default', 0, 'payment/pagarme_multibuyer/active', '1'); -('default', 0, 'payment/pagarme_voucher/title', 'Pagar.me Voucher'), -('default', 0, 'payment/pagarme_debit/title', 'Pagar.me Cartao de Debito'), diff --git a/.github/data/php8/Dockerfile b/.github/data/php8/Dockerfile index 7ae8ee9c..e65b350f 100644 --- a/.github/data/php8/Dockerfile +++ b/.github/data/php8/Dockerfile @@ -12,7 +12,7 @@ ARG MARKETPLACE_REPO ARG MARKETPLACE_NAME ARG MARKETPLACE_VERSION ARG MARKETPLACE_REPO_URL - +RUN composer config minimum-stability dev RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} RUN composer require pagarme/pagarme-magento2-module:dev-stg diff --git a/.github/data/stg/Dockerfile b/.github/data/stg/Dockerfile index f2067b5f..d97cadaa 100644 --- a/.github/data/stg/Dockerfile +++ b/.github/data/stg/Dockerfile @@ -12,7 +12,7 @@ ARG MARKETPLACE_REPO ARG MARKETPLACE_NAME ARG MARKETPLACE_VERSION ARG MARKETPLACE_REPO_URL - +RUN composer config minimum-stability dev RUN composer config -g http-basic.repo.magento.com ${MAGENTO_KEY} ${MAGENTO_SECRET} RUN composer require pagarme/pagarme-magento2-module:dev-stg diff --git a/.github/data/wait-for-mysql.sh b/.github/data/wait-for-mysql.sh deleted file mode 100644 index 50361060..00000000 --- a/.github/data/wait-for-mysql.sh +++ /dev/null @@ -1,4 +0,0 @@ -while ! /etc/init.d/mysql status | grep -m1 'is running'; do - sleep 1 - echo "Waiting for mysql service..." -done \ No newline at end of file diff --git a/.github/workflows/cd_reusable.yml b/.github/workflows/cd_reusable.yml index 06612cd0..ad1b2ccb 100644 --- a/.github/workflows/cd_reusable.yml +++ b/.github/workflows/cd_reusable.yml @@ -21,25 +21,7 @@ jobs: - name: Copy CI files to root run: | - cp .github/data/docker-compose.yml . cp .github/data/${{ matrix.tags }}/Dockerfile . - cp .github/data/wait-for-mysql.sh . - cp .github/data/magento2_module_install.sql . - - - name: Build image base for modifications - run: | - export MAGENTO_KEY=${{ secrets.MAGENTO_KEY }} - export MAGENTO_SECRET=${{ secrets.MAGENTO_SECRET }} - export MARKETPLACE_KEY=${{ secrets.MARKETPLACE_KEY }} - export MARKETPLACE_SECRET=${{ secrets.MARKETPLACE_SECRET }} - export MARKETPLACE_REPO=${{ secrets.MARKETPLACE_REPO }} - export MARKETPLACE_NAME=${{ secrets.MARKETPLACE_NAME }} - export MARKETPLACE_VERSION=${{ secrets.MARKETPLACE_VERSION }} - export MARKETPLACE_REPO_URL=${{ secrets.MARKETPLACE_REPO_URL }} - docker compose up -d - - - name: Activate and setup Plugin - run: docker ps - name: Log in to Docker Hub uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9 @@ -57,6 +39,15 @@ jobs: name: Build and push Docker image uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc with: + build-args: | + MAGENTO_KEY=${{ secrets.MAGENTO_KEY }} + MAGENTO_SECRET=${{ secrets.MAGENTO_SECRET }} + MARKETPLACE_KEY=${{ secrets.MARKETPLACE_KEY }} + MARKETPLACE_SECRET=${{ secrets.MARKETPLACE_SECRET }} + MARKETPLACE_REPO=${{ secrets.MARKETPLACE_REPO }} + MARKETPLACE_NAME=${{ secrets.MARKETPLACE_NAME }} + MARKETPLACE_VERSION=${{ secrets.MARKETPLACE_VERSION }} + MARKETPLACE_REPO_URL=${{ secrets.MARKETPLACE_REPO_URL }} context: . push: true tags: ${{ secrets.DOCKER_ACCOUNT }}/magento2-pagarme:${{ matrix.tags }} From 0c50fe7ef211689977cd36a8c2871592574e49f0 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 29 Aug 2023 15:49:00 -0300 Subject: [PATCH 49/83] refactor: admin creditCard block and template (#236) --- Block/Form/CreditCard.php | 78 ++++++ etc/di.xml | 2 +- i18n/en_US.csv | 7 + i18n/pt_BR.csv | 7 + .../layout/sales_order_create_index.xml | 1 + view/adminhtml/requirejs-config.js | 3 +- .../adminhtml/templates/form/creditcard.phtml | 233 ++++++++---------- .../web/css/pagarme_order_create.css | 15 ++ .../web/js/core/models/creditCardModel.js | 2 +- view/adminhtml/web/js/view/form/creditCard.js | 22 ++ 10 files changed, 238 insertions(+), 132 deletions(-) create mode 100644 Block/Form/CreditCard.php create mode 100644 view/adminhtml/web/css/pagarme_order_create.css create mode 100644 view/adminhtml/web/js/view/form/creditCard.js diff --git a/Block/Form/CreditCard.php b/Block/Form/CreditCard.php new file mode 100644 index 00000000..59fbf4aa --- /dev/null +++ b/Block/Form/CreditCard.php @@ -0,0 +1,78 @@ +checkoutHelper = $checkoutHelper; + } + + public function getMethodCode() + { + return $this->escapeHtml(parent::getMethodCode()); + } + + /** + * @return string|null + */ + public function getPublicKey() + { + return $this->checkoutHelper->getPublicKey(); + } + + /** + * @param Quote $quote + * @return string + */ + public function getGrandTotal($quote) + { + return $this->checkoutHelper->formatGrandTotal($quote->getBaseGrandTotal()); + } + + /** + * @return string[] + */ + public function getMonths() + { + return $this->checkoutHelper->getMonths(); + } + + /** + * @return string[] + */ + public function getYears() + { + return $this->checkoutHelper->getYears(); + } + + /** + * @return array + */ + public function getAvailableBrands() + { + return $this->checkoutHelper->getBrandsAvailables( + $this->escapeHtml($this->getMethodCode()) + ); + } + + public function getInstallmentsUrl() + { + return $this->checkoutHelper->getInstallmentsUrl($this->getBaseUrl()); + } +} diff --git a/etc/di.xml b/etc/di.xml index 6a70e44c..7ca5cd7e 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -487,7 +487,7 @@ Pagarme\Pagarme\Model\Ui\CreditCard\ConfigProvider::CODE PagarmeCreditCardValueHandlerPool PagarmeCreditCardCommandPool - Magento\Payment\Block\Form + Pagarme\Pagarme\Block\Form\CreditCard Pagarme\Pagarme\Block\Payment\Info\CreditCard diff --git a/i18n/en_US.csv b/i18n/en_US.csv index bc41059f..e1a07c3a 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -310,3 +310,10 @@ "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." diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index 83467a42..ff0d0ce0 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -489,3 +489,10 @@ "View Billet","Visualizar Boleto" "Error updating cycles options for product with id %s. Error message: %s","Erro ao atualizar as opções de ciclos para o produto com o id %s. Mensagem de erro: %s" "Subscription product with id %s not founded","Produto de assinatura com id %s não encontrado" +"Brands","Bandeiras" +"Select a brand","Selecione uma bandeira" +"Please, select a brand","Por favor, selecione uma bandeira" +"Please, enter valid Credit Card Number","Por favor, digite um Número de Cartão de Crédito válido" +"Please, enter valid Name on Card","Por favor, digite um Nome no Cartão válido" +"Please, enter valid Expiration Date","Por favor, digite um Data de Validade válida" +"The cvv field must be a minimum length of 3 and a maximum length of 4.","O campo de cvv deve ter um tamanho mínimo de 3 e um tamanho máximo de 4." diff --git a/view/adminhtml/layout/sales_order_create_index.xml b/view/adminhtml/layout/sales_order_create_index.xml index 9bfc2734..123f63e3 100644 --- a/view/adminhtml/layout/sales_order_create_index.xml +++ b/view/adminhtml/layout/sales_order_create_index.xml @@ -8,6 +8,7 @@ +
    +
    + diff --git a/view/adminhtml/web/css/pagarme_order_create.css b/view/adminhtml/web/css/pagarme_order_create.css new file mode 100644 index 00000000..b2b5370d --- /dev/null +++ b/view/adminhtml/web/css/pagarme_order_create.css @@ -0,0 +1,15 @@ +.fieldset-credit-card-pagarme { + margin-top:15px; +} + +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_type, +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_number, +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_owner, +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_installments { + width: 335px; +} + +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_exp_month, +.fieldset-credit-card-pagarme .admin__field .admin__field-control .cc_exp_year { + width: auto; +} diff --git a/view/adminhtml/web/js/core/models/creditCardModel.js b/view/adminhtml/web/js/core/models/creditCardModel.js index 704edc3f..8f9acf0c 100644 --- a/view/adminhtml/web/js/core/models/creditCardModel.js +++ b/view/adminhtml/web/js/core/models/creditCardModel.js @@ -56,7 +56,7 @@ define([ CreditCardModel.addListeners = function(config) { Listeners.addCreditCardNumberListener(this.formObject); Listeners.addCreditCardHolderNameListener(this.formObject); - Listeners.addCreditCardBrandListener(this.formObject, config.installmenUrl); + Listeners.addCreditCardBrandListener(this.formObject, config.installmentUrl); Listeners.addCreditCardInstallmentsListener(this.formObject); }; diff --git a/view/adminhtml/web/js/view/form/creditCard.js b/view/adminhtml/web/js/view/form/creditCard.js new file mode 100644 index 00000000..d5f898a6 --- /dev/null +++ b/view/adminhtml/web/js/view/form/creditCard.js @@ -0,0 +1,22 @@ +define([ + "jquery", + 'Pagarme_Pagarme/js/core/models/creditCardModel', + "jquery/ui" +], function ( + $, + CreditCardModel +) { + 'use strict'; + return (initializationConfig) => { + $(document).ready(function(){ + const config = { + isMultibuyerEnabled: false, + order : window.order, + payment : window.payment, + installmentUrl: initializationConfig.installmentUrl + }; + + CreditCardModel.init(initializationConfig.code, config); + }); + }; +}); From 6de54615baee01e9929096138ab9814fca0853f3 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 30 Aug 2023 17:33:51 -0300 Subject: [PATCH 50/83] fix: changing to use emulateAreaCode (#238) --- Setup/UpgradeData.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Setup/UpgradeData.php b/Setup/UpgradeData.php index ae82e801..fdff7d71 100644 --- a/Setup/UpgradeData.php +++ b/Setup/UpgradeData.php @@ -65,7 +65,10 @@ public function upgrade( $setup->startSetup(); if (version_compare($context->getVersion(), '2.2.5', '<')) { - $this->updateProductSubscriptionOptionsTitle(); + $this->state->emulateAreaCode(Area::AREA_ADMINHTML, [ + $this, + 'updateProductSubscriptionOptionsTitle' + ]); } $setup->endSetup(); @@ -74,11 +77,8 @@ public function upgrade( /** * @throws LocalizedException */ - private function updateProductSubscriptionOptionsTitle() + public function updateProductSubscriptionOptionsTitle() { - if (empty($this->state->getAreaCode())) { - $this->state->setAreaCode(Area::AREA_ADMINHTML); - } $productSubscriptions = $this->productSubscriptionService->findAll(); foreach ($productSubscriptions as $productSubscription) { $this->applyTitleWithoutParentheses($productSubscription); From dc6e3a2781b99bd844367cc52fa899fd3bd28cc2 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Wed, 30 Aug 2023 18:15:59 -0300 Subject: [PATCH 51/83] feat: adding enabled recurrence config validation to recurrences features --- Model/PagarmeConfigProvider.php | 20 ++++++++ Observer/CartAddProductAfterObserver.php | 20 ++++---- Observer/PaymentMethodAvailable.php | 34 +++++++------ Observer/UpdateProductPlanObserver.php | 21 ++++++-- {Model => Plugin}/Cart/CartConflict.php | 49 +++++++------------ .../Block/Product/ProductsList.php | 32 ++++++++---- .../AdminOrder/Product/Quote}/Initializer.php | 4 +- etc/adminhtml/di.xml | 2 +- etc/di.xml | 2 +- view/frontend/layout/catalog_product_view.xml | 2 +- view/frontend/layout/customer_account.xml | 2 +- .../layout/pagarme_customer_invoice.xml | 2 +- .../layout/pagarme_customer_subscription.xml | 2 +- .../layout/pagarme_pagarme_product_list.xml | 2 +- 14 files changed, 114 insertions(+), 80 deletions(-) rename {Model => Plugin}/Cart/CartConflict.php (90%) rename {Model/Sales/AdminOrder/Product/Quote/Plugin => Plugin/Sales/AdminOrder/Product/Quote}/Initializer.php (89%) diff --git a/Model/PagarmeConfigProvider.php b/Model/PagarmeConfigProvider.php index 4ccc0f1f..63bab8f7 100644 --- a/Model/PagarmeConfigProvider.php +++ b/Model/PagarmeConfigProvider.php @@ -194,6 +194,26 @@ public function getCustomerAddressConfiguration() ]; } + /** + * @return mixed + */ + public function isRecurrenceEnabled() + { + return $this->scopeConfig->getValue( + self::XML_PATH_RECURRENCE_ACTIVE, + ScopeInterface::SCOPE_STORE + ); + } + + /** + * @return bool + */ + public function isModuleOrRecurrenceDisabled() + { + return !$this->getModuleStatus() + || !$this->isRecurrenceEnabled(); + } + public function disableVoucher() { $this->config->saveConfig( diff --git a/Observer/CartAddProductAfterObserver.php b/Observer/CartAddProductAfterObserver.php index ac2607c8..7b6092a5 100644 --- a/Observer/CartAddProductAfterObserver.php +++ b/Observer/CartAddProductAfterObserver.php @@ -15,13 +15,15 @@ use Pagarme\Core\Recurrence\Services\ProductSubscriptionService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Core\Kernel\Aggregates\Configuration; use Magento\Quote\Model\Quote\Item; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Core\Recurrence\Aggregates\ProductSubscription; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class CartAddProductAfterObserver implements ObserverInterface { + const RULE_CATALOG_DISCOUNT_FIXED = 'to_fixed'; + /** * @var RecurrenceProductHelper */ @@ -33,9 +35,9 @@ class CartAddProductAfterObserver implements ObserverInterface protected $moneyService; /** - * @var Configuration + * @var PagarmeConfigProvider */ - protected $pagarmeConfig; + protected $pagarmeConfigProvider; /** * @var TimezoneInterface @@ -62,8 +64,6 @@ class CartAddProductAfterObserver implements ObserverInterface */ private $ruleModel; - const RULE_CATALOG_DISCOUNT_FIXED = 'to_fixed'; - /** * CartAddProductAfterObserver constructor. * @param RecurrenceProductHelper $recurrenceProductHelper @@ -80,12 +80,13 @@ public function __construct( StoreManagerInterface $storeManager, Session $customerSession, Rule $catalogRule, - RuleModel $ruleModel + RuleModel $ruleModel, + PagarmeConfigProvider $pagarmeConfigProvider ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; $this->moneyService = new MoneyService(); - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; $this->timeZone = $timeZone; $this->storeManager = $storeManager; $this->customerSession = $customerSession; @@ -99,10 +100,7 @@ public function __construct( */ public function execute(Observer $observer) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return; } diff --git a/Observer/PaymentMethodAvailable.php b/Observer/PaymentMethodAvailable.php index a761ab92..7addf730 100644 --- a/Observer/PaymentMethodAvailable.php +++ b/Observer/PaymentMethodAvailable.php @@ -8,24 +8,27 @@ use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class PaymentMethodAvailable implements ObserverInterface { /** - * @var \Pagarme\Core\Kernel\Aggregates\Configuration + * @var PagarmeConfigProvider */ - protected $pagarmeConfig; + protected $pagarmeConfigProvider; + /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; public function __construct( - RecurrenceProductHelper $recurrenceProductHelper + RecurrenceProductHelper $recurrenceProductHelper, + PagarmeConfigProvider $pagarmeConfigProvider ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -37,8 +40,10 @@ public function execute(Observer $observer) { $quote = $observer->getQuote(); - if (!$quote) { - return; + $cannotExecuteObserver = !$quote + || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); + if ($cannotExecuteObserver) { + return $this; } $recurrenceProduct = $this->getRecurrenceProducts($quote); @@ -47,23 +52,22 @@ public function execute(Observer $observer) $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); $isPagarmeMethod = strpos($currentMethod, "pagarme"); - if ( - !$this->pagarmeConfig->isEnabled() || - $isPagarmeMethod === false - ) { + $isNotPagarmeMethodOrModuleDisabled = !$this->pagarmeConfigProvider->getModuleStatus() + || $isPagarmeMethod === false; + if ($isNotPagarmeMethodOrModuleDisabled) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); - return; + return $this; } $this->switchPaymentMethodsForRecurrence($observer, $recurrenceProduct); } - if (!$this->pagarmeConfig->isEnabled()) { + if (!$this->pagarmeConfigProvider->getModuleStatus()) { $this->disablePagarmePaymentMethods($observer); } - return; + return $this; } /** @@ -73,9 +77,9 @@ private function disablePagarmePaymentMethods(Observer $observer) { $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); - $paymentMethodAvaliable = $this->getAvailableConfigMethods(); + $availablePaymentMethod = $this->getAvailableConfigMethods(); - if (in_array($currentMethod, $paymentMethodAvaliable)) { + if (in_array($currentMethod, $availablePaymentMethod)) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); } diff --git a/Observer/UpdateProductPlanObserver.php b/Observer/UpdateProductPlanObserver.php index ff9e005d..dda1f785 100644 --- a/Observer/UpdateProductPlanObserver.php +++ b/Observer/UpdateProductPlanObserver.php @@ -11,6 +11,7 @@ use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\ProductPlanHelper; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class UpdateProductPlanObserver implements ObserverInterface { @@ -19,10 +20,18 @@ class UpdateProductPlanObserver implements ObserverInterface */ protected $recurrenceProductHelper; - public function __construct(RecurrenceProductHelper $recurrenceProductHelper) - { + /** + * @var PagarmeConfigProvider + */ + protected $pagarmeConfigProvider; + + public function __construct( + RecurrenceProductHelper $recurrenceProductHelper, + PagarmeConfigProvider $pagarmeConfigProvider + ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } public function execute(Observer $observer) @@ -30,7 +39,9 @@ public function execute(Observer $observer) $event = $observer->getEvent(); $product = $event->getProduct(); - if (!$product) { + $cannotExecuteObserver = !$product + || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); + if ($cannotExecuteObserver) { return $this; } @@ -42,12 +53,12 @@ public function execute(Observer $observer) return $this; } - return $this->updatePlan($recurrence, $product); + return $this->updatePlan($recurrence); } protected function updatePlan(RecurrenceEntityInterface $recurrence) { - try{ + try { ProductPlanHelper::mapperProductPlan($recurrence); $service = new PlanService(); $service->updatePlanAtPagarme($recurrence); diff --git a/Model/Cart/CartConflict.php b/Plugin/Cart/CartConflict.php similarity index 90% rename from Model/Cart/CartConflict.php rename to Plugin/Cart/CartConflict.php index e71d7dbb..4efe1e2e 100644 --- a/Model/Cart/CartConflict.php +++ b/Plugin/Cart/CartConflict.php @@ -1,34 +1,34 @@ repetitionService = new RepetitionService(); @@ -77,7 +72,7 @@ public function __construct() $this->productSubscriptionService = new ProductSubscriptionService(); $this->planService = new PlanService(); $this->rulesCartRun = new RulesCartRun(); - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -87,10 +82,7 @@ public function __construct() */ public function beforeUpdateItems(Cart $cart, $dataQty) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return; } @@ -127,10 +119,7 @@ public function beforeAddProduct( Interceptor $productInfo, $requestInfo = null ) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return [$productInfo, $requestInfo]; } diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index dac7f29f..2532b335 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -17,6 +17,9 @@ use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\ScopeInterface; +use Pagarme\Core\Kernel\Aggregates\Configuration; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; /** * Class ProductsList @@ -35,13 +38,20 @@ class ProductsList */ protected $rendererListBlock; + /** + * @var PagarmeConfigProvider + */ + protected $pagarmeConfigProvider; + /** * @param LayoutFactory $layoutFactory */ public function __construct( - LayoutFactory $layoutFactory + LayoutFactory $layoutFactory, + PagarmeConfigProvider $pagarmeConfigProvider ) { $this->_layoutFactory = $layoutFactory; + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -55,18 +65,20 @@ public function afterGetProductDetailsHtml( $result, ProductInterface $product ) { - $this->product = $product; - return $this->getProductRecurrenceHtml($product) . $result; + if ($this->pagarmeConfigProvider->isRecurrenceEnabled()) { + return $this->getProductRecurrenceHtml($product) . $result; + } + return $result; } /** - * @param ProductInterface $product + * @param ProductInterface|null $product * @return string */ protected function getProductRecurrenceHtml(ProductInterface $product = null) { $typeId = $product ? $product->getTypeId() : null; - $renderer = $this->getRecurrenceRenderer($typeId); + $renderer = $this->getRecurrenceRenderer($product, $typeId); if ($renderer) { $renderer->setProduct($product); return $renderer->toHtml(); @@ -79,12 +91,12 @@ protected function getProductRecurrenceHtml(ProductInterface $product = null) * @param string|null $type * @return bool|\Magento\Framework\View\Element\AbstractBlock */ - protected function getRecurrenceRenderer($type = null) + protected function getRecurrenceRenderer($product, $type = null) { if ($type === null) { $type = 'default'; } - $rendererList = $this->getRecurrenceRendererList(); + $rendererList = $this->getRecurrenceRendererList($product); if ($rendererList) { return $rendererList->getRenderer($type, 'default'); } @@ -94,7 +106,7 @@ protected function getRecurrenceRenderer($type = null) /** * @inheritdoc */ - protected function getRecurrenceRendererList() + protected function getRecurrenceRendererList($product) { if (empty($this->rendererListBlock)) { /** @var $layout LayoutInterface */ @@ -103,8 +115,8 @@ protected function getRecurrenceRendererList() $layout->generateXml(); $layout->generateElements(); $this->rendererListBlock = $layout->getBlock('category.product.type.widget.pagarme.recurrence.renderers'); - if ($this->product) { - $this->rendererListBlock->setData('product', $this->product); + if ($product) { + $this->rendererListBlock->setData('product', $product); } } return $this->rendererListBlock; diff --git a/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php b/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php similarity index 89% rename from Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php rename to Plugin/Sales/AdminOrder/Product/Quote/Initializer.php index 8be0fbbc..85abfcb1 100644 --- a/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php +++ b/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php @@ -1,8 +1,8 @@ - + diff --git a/etc/di.xml b/etc/di.xml index 7ca5cd7e..740078f9 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -53,7 +53,7 @@ - + diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index 5e156ae0..ab0bd179 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -2,7 +2,7 @@ - + diff --git a/view/frontend/layout/customer_account.xml b/view/frontend/layout/customer_account.xml index 030dd8ef..e2767f5f 100755 --- a/view/frontend/layout/customer_account.xml +++ b/view/frontend/layout/customer_account.xml @@ -17,7 +17,7 @@ My Cards - + pagarme/customer/subscription Subscription diff --git a/view/frontend/layout/pagarme_customer_invoice.xml b/view/frontend/layout/pagarme_customer_invoice.xml index 045ae5ad..b2ab089c 100755 --- a/view/frontend/layout/pagarme_customer_invoice.xml +++ b/view/frontend/layout/pagarme_customer_invoice.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_customer_subscription.xml b/view/frontend/layout/pagarme_customer_subscription.xml index 5f1fc449..b7571f90 100755 --- a/view/frontend/layout/pagarme_customer_subscription.xml +++ b/view/frontend/layout/pagarme_customer_subscription.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_pagarme_product_list.xml b/view/frontend/layout/pagarme_pagarme_product_list.xml index 3247000f..8637f912 100644 --- a/view/frontend/layout/pagarme_pagarme_product_list.xml +++ b/view/frontend/layout/pagarme_pagarme_product_list.xml @@ -10,7 +10,7 @@ --> - + From 6af2781a9ec7781ca75f932f85f29f4782cf44c4 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Wed, 30 Aug 2023 18:16:52 -0300 Subject: [PATCH 52/83] Revert "feat: adding enabled recurrence config validation to recurrences features" This reverts commit dc6e3a2781b99bd844367cc52fa899fd3bd28cc2. --- {Plugin => Model}/Cart/CartConflict.php | 49 ++++++++++++------- Model/PagarmeConfigProvider.php | 20 -------- .../Product/Quote/Plugin}/Initializer.php | 4 +- Observer/CartAddProductAfterObserver.php | 20 ++++---- Observer/PaymentMethodAvailable.php | 34 ++++++------- Observer/UpdateProductPlanObserver.php | 21 ++------ .../Block/Product/ProductsList.php | 32 ++++-------- etc/adminhtml/di.xml | 2 +- etc/di.xml | 2 +- view/frontend/layout/catalog_product_view.xml | 2 +- view/frontend/layout/customer_account.xml | 2 +- .../layout/pagarme_customer_invoice.xml | 2 +- .../layout/pagarme_customer_subscription.xml | 2 +- .../layout/pagarme_pagarme_product_list.xml | 2 +- 14 files changed, 80 insertions(+), 114 deletions(-) rename {Plugin => Model}/Cart/CartConflict.php (90%) rename {Plugin/Sales/AdminOrder/Product/Quote => Model/Sales/AdminOrder/Product/Quote/Plugin}/Initializer.php (89%) diff --git a/Plugin/Cart/CartConflict.php b/Model/Cart/CartConflict.php similarity index 90% rename from Plugin/Cart/CartConflict.php rename to Model/Cart/CartConflict.php index 4efe1e2e..e71d7dbb 100644 --- a/Plugin/Cart/CartConflict.php +++ b/Model/Cart/CartConflict.php @@ -1,34 +1,34 @@ repetitionService = new RepetitionService(); @@ -72,7 +77,7 @@ public function __construct(PagarmeConfigProvider $pagarmeConfigProvider) $this->productSubscriptionService = new ProductSubscriptionService(); $this->planService = new PlanService(); $this->rulesCartRun = new RulesCartRun(); - $this->pagarmeConfigProvider = $pagarmeConfigProvider; + $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); } /** @@ -82,7 +87,10 @@ public function __construct(PagarmeConfigProvider $pagarmeConfigProvider) */ public function beforeUpdateItems(Cart $cart, $dataQty) { - if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { + if ( + !$this->pagarmeConfig->isEnabled() || + !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() + ) { return; } @@ -119,7 +127,10 @@ public function beforeAddProduct( Interceptor $productInfo, $requestInfo = null ) { - if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { + if ( + !$this->pagarmeConfig->isEnabled() || + !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() + ) { return [$productInfo, $requestInfo]; } diff --git a/Model/PagarmeConfigProvider.php b/Model/PagarmeConfigProvider.php index 63bab8f7..4ccc0f1f 100644 --- a/Model/PagarmeConfigProvider.php +++ b/Model/PagarmeConfigProvider.php @@ -194,26 +194,6 @@ public function getCustomerAddressConfiguration() ]; } - /** - * @return mixed - */ - public function isRecurrenceEnabled() - { - return $this->scopeConfig->getValue( - self::XML_PATH_RECURRENCE_ACTIVE, - ScopeInterface::SCOPE_STORE - ); - } - - /** - * @return bool - */ - public function isModuleOrRecurrenceDisabled() - { - return !$this->getModuleStatus() - || !$this->isRecurrenceEnabled(); - } - public function disableVoucher() { $this->config->saveConfig( diff --git a/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php b/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php similarity index 89% rename from Plugin/Sales/AdminOrder/Product/Quote/Initializer.php rename to Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php index 85abfcb1..8be0fbbc 100644 --- a/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php +++ b/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php @@ -1,8 +1,8 @@ recurrenceProductHelper = $recurrenceProductHelper; $this->moneyService = new MoneyService(); - $this->pagarmeConfigProvider = $pagarmeConfigProvider; + $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); $this->timeZone = $timeZone; $this->storeManager = $storeManager; $this->customerSession = $customerSession; @@ -100,7 +99,10 @@ public function __construct( */ public function execute(Observer $observer) { - if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { + if ( + !$this->pagarmeConfig->isEnabled() || + !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() + ) { return; } diff --git a/Observer/PaymentMethodAvailable.php b/Observer/PaymentMethodAvailable.php index 7addf730..a761ab92 100644 --- a/Observer/PaymentMethodAvailable.php +++ b/Observer/PaymentMethodAvailable.php @@ -8,27 +8,24 @@ use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Pagarme\Model\PagarmeConfigProvider; class PaymentMethodAvailable implements ObserverInterface { /** - * @var PagarmeConfigProvider + * @var \Pagarme\Core\Kernel\Aggregates\Configuration */ - protected $pagarmeConfigProvider; - + protected $pagarmeConfig; /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; public function __construct( - RecurrenceProductHelper $recurrenceProductHelper, - PagarmeConfigProvider $pagarmeConfigProvider + RecurrenceProductHelper $recurrenceProductHelper ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; - $this->pagarmeConfigProvider = $pagarmeConfigProvider; + $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); } /** @@ -40,10 +37,8 @@ public function execute(Observer $observer) { $quote = $observer->getQuote(); - $cannotExecuteObserver = !$quote - || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); - if ($cannotExecuteObserver) { - return $this; + if (!$quote) { + return; } $recurrenceProduct = $this->getRecurrenceProducts($quote); @@ -52,22 +47,23 @@ public function execute(Observer $observer) $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); $isPagarmeMethod = strpos($currentMethod, "pagarme"); - $isNotPagarmeMethodOrModuleDisabled = !$this->pagarmeConfigProvider->getModuleStatus() - || $isPagarmeMethod === false; - if ($isNotPagarmeMethodOrModuleDisabled) { + if ( + !$this->pagarmeConfig->isEnabled() || + $isPagarmeMethod === false + ) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); - return $this; + return; } $this->switchPaymentMethodsForRecurrence($observer, $recurrenceProduct); } - if (!$this->pagarmeConfigProvider->getModuleStatus()) { + if (!$this->pagarmeConfig->isEnabled()) { $this->disablePagarmePaymentMethods($observer); } - return $this; + return; } /** @@ -77,9 +73,9 @@ private function disablePagarmePaymentMethods(Observer $observer) { $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); - $availablePaymentMethod = $this->getAvailableConfigMethods(); + $paymentMethodAvaliable = $this->getAvailableConfigMethods(); - if (in_array($currentMethod, $availablePaymentMethod)) { + if (in_array($currentMethod, $paymentMethodAvaliable)) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); } diff --git a/Observer/UpdateProductPlanObserver.php b/Observer/UpdateProductPlanObserver.php index dda1f785..ff9e005d 100644 --- a/Observer/UpdateProductPlanObserver.php +++ b/Observer/UpdateProductPlanObserver.php @@ -11,7 +11,6 @@ use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\ProductPlanHelper; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Pagarme\Model\PagarmeConfigProvider; class UpdateProductPlanObserver implements ObserverInterface { @@ -20,18 +19,10 @@ class UpdateProductPlanObserver implements ObserverInterface */ protected $recurrenceProductHelper; - /** - * @var PagarmeConfigProvider - */ - protected $pagarmeConfigProvider; - - public function __construct( - RecurrenceProductHelper $recurrenceProductHelper, - PagarmeConfigProvider $pagarmeConfigProvider - ) { + public function __construct(RecurrenceProductHelper $recurrenceProductHelper) + { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; - $this->pagarmeConfigProvider = $pagarmeConfigProvider; } public function execute(Observer $observer) @@ -39,9 +30,7 @@ public function execute(Observer $observer) $event = $observer->getEvent(); $product = $event->getProduct(); - $cannotExecuteObserver = !$product - || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); - if ($cannotExecuteObserver) { + if (!$product) { return $this; } @@ -53,12 +42,12 @@ public function execute(Observer $observer) return $this; } - return $this->updatePlan($recurrence); + return $this->updatePlan($recurrence, $product); } protected function updatePlan(RecurrenceEntityInterface $recurrence) { - try { + try{ ProductPlanHelper::mapperProductPlan($recurrence); $service = new PlanService(); $service->updatePlanAtPagarme($recurrence); diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index 2532b335..dac7f29f 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -17,9 +17,6 @@ use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; -use Magento\Store\Model\ScopeInterface; -use Pagarme\Core\Kernel\Aggregates\Configuration; -use Pagarme\Pagarme\Model\PagarmeConfigProvider; /** * Class ProductsList @@ -38,20 +35,13 @@ class ProductsList */ protected $rendererListBlock; - /** - * @var PagarmeConfigProvider - */ - protected $pagarmeConfigProvider; - /** * @param LayoutFactory $layoutFactory */ public function __construct( - LayoutFactory $layoutFactory, - PagarmeConfigProvider $pagarmeConfigProvider + LayoutFactory $layoutFactory ) { $this->_layoutFactory = $layoutFactory; - $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -65,20 +55,18 @@ public function afterGetProductDetailsHtml( $result, ProductInterface $product ) { - if ($this->pagarmeConfigProvider->isRecurrenceEnabled()) { - return $this->getProductRecurrenceHtml($product) . $result; - } - return $result; + $this->product = $product; + return $this->getProductRecurrenceHtml($product) . $result; } /** - * @param ProductInterface|null $product + * @param ProductInterface $product * @return string */ protected function getProductRecurrenceHtml(ProductInterface $product = null) { $typeId = $product ? $product->getTypeId() : null; - $renderer = $this->getRecurrenceRenderer($product, $typeId); + $renderer = $this->getRecurrenceRenderer($typeId); if ($renderer) { $renderer->setProduct($product); return $renderer->toHtml(); @@ -91,12 +79,12 @@ protected function getProductRecurrenceHtml(ProductInterface $product = null) * @param string|null $type * @return bool|\Magento\Framework\View\Element\AbstractBlock */ - protected function getRecurrenceRenderer($product, $type = null) + protected function getRecurrenceRenderer($type = null) { if ($type === null) { $type = 'default'; } - $rendererList = $this->getRecurrenceRendererList($product); + $rendererList = $this->getRecurrenceRendererList(); if ($rendererList) { return $rendererList->getRenderer($type, 'default'); } @@ -106,7 +94,7 @@ protected function getRecurrenceRenderer($product, $type = null) /** * @inheritdoc */ - protected function getRecurrenceRendererList($product) + protected function getRecurrenceRendererList() { if (empty($this->rendererListBlock)) { /** @var $layout LayoutInterface */ @@ -115,8 +103,8 @@ protected function getRecurrenceRendererList($product) $layout->generateXml(); $layout->generateElements(); $this->rendererListBlock = $layout->getBlock('category.product.type.widget.pagarme.recurrence.renderers'); - if ($product) { - $this->rendererListBlock->setData('product', $product); + if ($this->product) { + $this->rendererListBlock->setData('product', $this->product); } } return $this->rendererListBlock; diff --git a/etc/adminhtml/di.xml b/etc/adminhtml/di.xml index d2a45e36..afc3d7a5 100644 --- a/etc/adminhtml/di.xml +++ b/etc/adminhtml/di.xml @@ -21,7 +21,7 @@ - + diff --git a/etc/di.xml b/etc/di.xml index 740078f9..7ca5cd7e 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -53,7 +53,7 @@ - + diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index ab0bd179..5e156ae0 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -2,7 +2,7 @@ - + diff --git a/view/frontend/layout/customer_account.xml b/view/frontend/layout/customer_account.xml index e2767f5f..030dd8ef 100755 --- a/view/frontend/layout/customer_account.xml +++ b/view/frontend/layout/customer_account.xml @@ -17,7 +17,7 @@ My Cards - + pagarme/customer/subscription Subscription diff --git a/view/frontend/layout/pagarme_customer_invoice.xml b/view/frontend/layout/pagarme_customer_invoice.xml index b2ab089c..045ae5ad 100755 --- a/view/frontend/layout/pagarme_customer_invoice.xml +++ b/view/frontend/layout/pagarme_customer_invoice.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_customer_subscription.xml b/view/frontend/layout/pagarme_customer_subscription.xml index b7571f90..5f1fc449 100755 --- a/view/frontend/layout/pagarme_customer_subscription.xml +++ b/view/frontend/layout/pagarme_customer_subscription.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_pagarme_product_list.xml b/view/frontend/layout/pagarme_pagarme_product_list.xml index 8637f912..3247000f 100644 --- a/view/frontend/layout/pagarme_pagarme_product_list.xml +++ b/view/frontend/layout/pagarme_pagarme_product_list.xml @@ -10,7 +10,7 @@ --> - + From 0fe3062630dbe90d2829d31e3a5c9f68f8188774 Mon Sep 17 00:00:00 2001 From: robsoned Date: Wed, 30 Aug 2023 22:50:33 +0000 Subject: [PATCH 53/83] Fix Webapi\Exception __construct arguments --- Gateway/Transaction/Base/Command/InitializeCommand.php | 2 +- Model/Api/ProductsPlan.php | 10 +++++----- Model/WebhookManagement.php | 2 +- Observer/OrderCancelAfter.php | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Gateway/Transaction/Base/Command/InitializeCommand.php b/Gateway/Transaction/Base/Command/InitializeCommand.php index 2e7a1412..107f7027 100755 --- a/Gateway/Transaction/Base/Command/InitializeCommand.php +++ b/Gateway/Transaction/Base/Command/InitializeCommand.php @@ -166,7 +166,7 @@ private function doCoreDetour($payment) throw new M2WebApiException( new Phrase($e->getMessage()), 0, - $e->getCode() + M2WebApiException::HTTP_BAD_REQUEST ); } } diff --git a/Model/Api/ProductsPlan.php b/Model/Api/ProductsPlan.php index d69113b5..285cf740 100644 --- a/Model/Api/ProductsPlan.php +++ b/Model/Api/ProductsPlan.php @@ -116,7 +116,7 @@ public function save($productPlan, $id = null) throw new MagentoException( __($exception->getMessage()), 0, - $exception->getCode() + MagentoException::HTTP_BAD_REQUEST ); } @@ -141,7 +141,7 @@ public function list() throw new MagentoException( __($exception->getMessage()), 0, - $exception->getCode() + MagentoException::HTTP_BAD_REQUEST ); } } @@ -168,7 +168,7 @@ public function update($id, $productPlan) throw new MagentoException( __($exception->getMessage()), 0, - $exception->getCode() + MagentoException::HTTP_BAD_REQUEST ); } @@ -194,7 +194,7 @@ public function find($id) throw new MagentoException( __($exception->getMessage()), 0, - $exception->getCode() + MagentoException::HTTP_BAD_REQUEST ); } } @@ -220,7 +220,7 @@ public function delete($id) throw new MagentoException( __($exception->getMessage()), 0, - $exception->getCode() + MagentoException::HTTP_BAD_REQUEST ); } } diff --git a/Model/WebhookManagement.php b/Model/WebhookManagement.php index 24b3202f..936e03ca 100644 --- a/Model/WebhookManagement.php +++ b/Model/WebhookManagement.php @@ -54,7 +54,7 @@ public function save($id, $type, $data) throw new M2WebApiException( new Phrase($e->getMessage()), 0, - $e->getCode() + M2WebApiException::HTTP_BAD_REQUEST ); } } diff --git a/Observer/OrderCancelAfter.php b/Observer/OrderCancelAfter.php index 81c9c213..8eca38d9 100644 --- a/Observer/OrderCancelAfter.php +++ b/Observer/OrderCancelAfter.php @@ -68,7 +68,7 @@ public function execute(EventObserver $observer) throw new M2WebApiException( new Phrase($e->getMessage()), 0, - $e->getCode() + M2WebApiException::HTTP_BAD_REQUEST ); } } From 914ef4f7883a01db6799e287831763087dc61d50 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 31 Aug 2023 09:34:17 -0300 Subject: [PATCH 54/83] feat: adding enabled recurrence config validation to recurrences features (#239) --- Model/PagarmeConfigProvider.php | 20 ++++++ Observer/CartAddProductAfterObserver.php | 20 +++--- Observer/PaymentMethodAvailable.php | 34 +++++----- Observer/UpdateProductPlanObserver.php | 21 ++++-- {Model => Plugin}/Cart/CartConflict.php | 65 +++++++++---------- .../Block/Product/ProductsList.php | 39 +++++++---- .../AdminOrder/Product/Quote}/Initializer.php | 4 +- etc/adminhtml/di.xml | 2 +- etc/di.xml | 2 +- view/frontend/layout/catalog_product_view.xml | 2 +- view/frontend/layout/customer_account.xml | 2 +- .../layout/pagarme_customer_invoice.xml | 2 +- .../layout/pagarme_customer_subscription.xml | 2 +- .../layout/pagarme_pagarme_product_list.xml | 2 +- 14 files changed, 131 insertions(+), 86 deletions(-) rename {Model => Plugin}/Cart/CartConflict.php (89%) rename {Model/Sales/AdminOrder/Product/Quote/Plugin => Plugin/Sales/AdminOrder/Product/Quote}/Initializer.php (89%) diff --git a/Model/PagarmeConfigProvider.php b/Model/PagarmeConfigProvider.php index 4ccc0f1f..63bab8f7 100644 --- a/Model/PagarmeConfigProvider.php +++ b/Model/PagarmeConfigProvider.php @@ -194,6 +194,26 @@ public function getCustomerAddressConfiguration() ]; } + /** + * @return mixed + */ + public function isRecurrenceEnabled() + { + return $this->scopeConfig->getValue( + self::XML_PATH_RECURRENCE_ACTIVE, + ScopeInterface::SCOPE_STORE + ); + } + + /** + * @return bool + */ + public function isModuleOrRecurrenceDisabled() + { + return !$this->getModuleStatus() + || !$this->isRecurrenceEnabled(); + } + public function disableVoucher() { $this->config->saveConfig( diff --git a/Observer/CartAddProductAfterObserver.php b/Observer/CartAddProductAfterObserver.php index ac2607c8..7b6092a5 100644 --- a/Observer/CartAddProductAfterObserver.php +++ b/Observer/CartAddProductAfterObserver.php @@ -15,13 +15,15 @@ use Pagarme\Core\Recurrence\Services\ProductSubscriptionService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Core\Kernel\Aggregates\Configuration; use Magento\Quote\Model\Quote\Item; use Pagarme\Core\Kernel\Exceptions\InvalidParamException; use Pagarme\Core\Recurrence\Aggregates\ProductSubscription; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class CartAddProductAfterObserver implements ObserverInterface { + const RULE_CATALOG_DISCOUNT_FIXED = 'to_fixed'; + /** * @var RecurrenceProductHelper */ @@ -33,9 +35,9 @@ class CartAddProductAfterObserver implements ObserverInterface protected $moneyService; /** - * @var Configuration + * @var PagarmeConfigProvider */ - protected $pagarmeConfig; + protected $pagarmeConfigProvider; /** * @var TimezoneInterface @@ -62,8 +64,6 @@ class CartAddProductAfterObserver implements ObserverInterface */ private $ruleModel; - const RULE_CATALOG_DISCOUNT_FIXED = 'to_fixed'; - /** * CartAddProductAfterObserver constructor. * @param RecurrenceProductHelper $recurrenceProductHelper @@ -80,12 +80,13 @@ public function __construct( StoreManagerInterface $storeManager, Session $customerSession, Rule $catalogRule, - RuleModel $ruleModel + RuleModel $ruleModel, + PagarmeConfigProvider $pagarmeConfigProvider ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; $this->moneyService = new MoneyService(); - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; $this->timeZone = $timeZone; $this->storeManager = $storeManager; $this->customerSession = $customerSession; @@ -99,10 +100,7 @@ public function __construct( */ public function execute(Observer $observer) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return; } diff --git a/Observer/PaymentMethodAvailable.php b/Observer/PaymentMethodAvailable.php index a761ab92..7addf730 100644 --- a/Observer/PaymentMethodAvailable.php +++ b/Observer/PaymentMethodAvailable.php @@ -8,24 +8,27 @@ use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class PaymentMethodAvailable implements ObserverInterface { /** - * @var \Pagarme\Core\Kernel\Aggregates\Configuration + * @var PagarmeConfigProvider */ - protected $pagarmeConfig; + protected $pagarmeConfigProvider; + /** * @var RecurrenceProductHelper */ protected $recurrenceProductHelper; public function __construct( - RecurrenceProductHelper $recurrenceProductHelper + RecurrenceProductHelper $recurrenceProductHelper, + PagarmeConfigProvider $pagarmeConfigProvider ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -37,8 +40,10 @@ public function execute(Observer $observer) { $quote = $observer->getQuote(); - if (!$quote) { - return; + $cannotExecuteObserver = !$quote + || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); + if ($cannotExecuteObserver) { + return $this; } $recurrenceProduct = $this->getRecurrenceProducts($quote); @@ -47,23 +52,22 @@ public function execute(Observer $observer) $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); $isPagarmeMethod = strpos($currentMethod, "pagarme"); - if ( - !$this->pagarmeConfig->isEnabled() || - $isPagarmeMethod === false - ) { + $isNotPagarmeMethodOrModuleDisabled = !$this->pagarmeConfigProvider->getModuleStatus() + || $isPagarmeMethod === false; + if ($isNotPagarmeMethodOrModuleDisabled) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); - return; + return $this; } $this->switchPaymentMethodsForRecurrence($observer, $recurrenceProduct); } - if (!$this->pagarmeConfig->isEnabled()) { + if (!$this->pagarmeConfigProvider->getModuleStatus()) { $this->disablePagarmePaymentMethods($observer); } - return; + return $this; } /** @@ -73,9 +77,9 @@ private function disablePagarmePaymentMethods(Observer $observer) { $currentMethod = $observer->getEvent()->getMethodInstance()->getCode(); - $paymentMethodAvaliable = $this->getAvailableConfigMethods(); + $availablePaymentMethod = $this->getAvailableConfigMethods(); - if (in_array($currentMethod, $paymentMethodAvaliable)) { + if (in_array($currentMethod, $availablePaymentMethod)) { $checkResult = $observer->getEvent()->getResult(); $checkResult->setData('is_available', false); } diff --git a/Observer/UpdateProductPlanObserver.php b/Observer/UpdateProductPlanObserver.php index ff9e005d..dda1f785 100644 --- a/Observer/UpdateProductPlanObserver.php +++ b/Observer/UpdateProductPlanObserver.php @@ -11,6 +11,7 @@ use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\ProductPlanHelper; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class UpdateProductPlanObserver implements ObserverInterface { @@ -19,10 +20,18 @@ class UpdateProductPlanObserver implements ObserverInterface */ protected $recurrenceProductHelper; - public function __construct(RecurrenceProductHelper $recurrenceProductHelper) - { + /** + * @var PagarmeConfigProvider + */ + protected $pagarmeConfigProvider; + + public function __construct( + RecurrenceProductHelper $recurrenceProductHelper, + PagarmeConfigProvider $pagarmeConfigProvider + ) { Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } public function execute(Observer $observer) @@ -30,7 +39,9 @@ public function execute(Observer $observer) $event = $observer->getEvent(); $product = $event->getProduct(); - if (!$product) { + $cannotExecuteObserver = !$product + || !$this->pagarmeConfigProvider->isRecurrenceEnabled(); + if ($cannotExecuteObserver) { return $this; } @@ -42,12 +53,12 @@ public function execute(Observer $observer) return $this; } - return $this->updatePlan($recurrence, $product); + return $this->updatePlan($recurrence); } protected function updatePlan(RecurrenceEntityInterface $recurrence) { - try{ + try { ProductPlanHelper::mapperProductPlan($recurrence); $service = new PlanService(); $service->updatePlanAtPagarme($recurrence); diff --git a/Model/Cart/CartConflict.php b/Plugin/Cart/CartConflict.php similarity index 89% rename from Model/Cart/CartConflict.php rename to Plugin/Cart/CartConflict.php index e71d7dbb..91ffc05d 100644 --- a/Model/Cart/CartConflict.php +++ b/Plugin/Cart/CartConflict.php @@ -1,34 +1,34 @@ repetitionService = new RepetitionService(); @@ -77,7 +72,7 @@ public function __construct() $this->productSubscriptionService = new ProductSubscriptionService(); $this->planService = new PlanService(); $this->rulesCartRun = new RulesCartRun(); - $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -87,10 +82,7 @@ public function __construct() */ public function beforeUpdateItems(Cart $cart, $dataQty) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return; } @@ -127,10 +119,7 @@ public function beforeAddProduct( Interceptor $productInfo, $requestInfo = null ) { - if ( - !$this->pagarmeConfig->isEnabled() || - !$this->pagarmeConfig->getRecurrenceConfig()->isEnabled() - ) { + if ($this->pagarmeConfigProvider->isModuleOrRecurrenceDisabled()) { return [$productInfo, $requestInfo]; } @@ -174,16 +163,18 @@ protected function buildCurrentProduct( $currentProduct->setQuantity($quantity); + $changedCurrentProduct = false; if ($productPlan !== null) { $currentProduct->setIsNormalProduct(false); $currentProduct->setProductPlanSelected($productPlan); - return $currentProduct; + $changedCurrentProduct = true; } - $isNormalProduct = $this->checkIsNormalProduct($requestInfo); + $isNormalProduct = $this->checkIsNormalProduct($requestInfo) + && $productPlan === null; if ($isNormalProduct) { $currentProduct->setIsNormalProduct($isNormalProduct); - return $currentProduct; + $changedCurrentProduct = true; } $repetitionSelected = $this->getOptionRecurrenceSelected( @@ -191,8 +182,14 @@ protected function buildCurrentProduct( $requestInfo['options'] ); - if (!$repetitionSelected) { + $hasNotRepetitionSelected = !$repetitionSelected && !$isNormalProduct; + + if ($hasNotRepetitionSelected) { $currentProduct->setIsNormalProduct(true); + $changedCurrentProduct = true; + } + + if ($changedCurrentProduct) { return $currentProduct; } diff --git a/Plugin/CatalogWidget/Block/Product/ProductsList.php b/Plugin/CatalogWidget/Block/Product/ProductsList.php index dac7f29f..67c8ed70 100644 --- a/Plugin/CatalogWidget/Block/Product/ProductsList.php +++ b/Plugin/CatalogWidget/Block/Product/ProductsList.php @@ -14,9 +14,13 @@ use Magento\Catalog\Api\Data\ProductInterface; use Magento\Catalog\Model\Product; use Magento\CatalogWidget\Block\Product\ProductsList as BaseProductsList; +use Magento\Framework\View\Element\AbstractBlock; use Magento\Framework\View\Element\BlockInterface; use Magento\Framework\View\LayoutFactory; use Magento\Framework\View\LayoutInterface; +use Magento\Store\Model\ScopeInterface; +use Pagarme\Core\Kernel\Aggregates\Configuration; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; /** * Class ProductsList @@ -35,13 +39,20 @@ class ProductsList */ protected $rendererListBlock; + /** + * @var PagarmeConfigProvider + */ + protected $pagarmeConfigProvider; + /** * @param LayoutFactory $layoutFactory */ public function __construct( - LayoutFactory $layoutFactory + LayoutFactory $layoutFactory, + PagarmeConfigProvider $pagarmeConfigProvider ) { $this->_layoutFactory = $layoutFactory; + $this->pagarmeConfigProvider = $pagarmeConfigProvider; } /** @@ -55,18 +66,20 @@ public function afterGetProductDetailsHtml( $result, ProductInterface $product ) { - $this->product = $product; - return $this->getProductRecurrenceHtml($product) . $result; + if ($this->pagarmeConfigProvider->isRecurrenceEnabled()) { + return $this->getProductRecurrenceHtml($product) . $result; + } + return $result; } /** - * @param ProductInterface $product + * @param ProductInterface|null $product * @return string */ protected function getProductRecurrenceHtml(ProductInterface $product = null) { $typeId = $product ? $product->getTypeId() : null; - $renderer = $this->getRecurrenceRenderer($typeId); + $renderer = $this->getRecurrenceRenderer($product, $typeId); if ($renderer) { $renderer->setProduct($product); return $renderer->toHtml(); @@ -76,15 +89,16 @@ protected function getProductRecurrenceHtml(ProductInterface $product = null) /** * Get the renderer that will be used to render the recurrence block + * @param ProductInterface|null $product * @param string|null $type - * @return bool|\Magento\Framework\View\Element\AbstractBlock + * @return bool|AbstractBlock */ - protected function getRecurrenceRenderer($type = null) + protected function getRecurrenceRenderer($product, $type = null) { if ($type === null) { $type = 'default'; } - $rendererList = $this->getRecurrenceRendererList(); + $rendererList = $this->getRecurrenceRendererList($product); if ($rendererList) { return $rendererList->getRenderer($type, 'default'); } @@ -92,9 +106,10 @@ protected function getRecurrenceRenderer($type = null) } /** - * @inheritdoc + * @param ProductInterface|null $product + * @return bool|BlockInterface */ - protected function getRecurrenceRendererList() + protected function getRecurrenceRendererList($product) { if (empty($this->rendererListBlock)) { /** @var $layout LayoutInterface */ @@ -103,8 +118,8 @@ protected function getRecurrenceRendererList() $layout->generateXml(); $layout->generateElements(); $this->rendererListBlock = $layout->getBlock('category.product.type.widget.pagarme.recurrence.renderers'); - if ($this->product) { - $this->rendererListBlock->setData('product', $this->product); + if ($product) { + $this->rendererListBlock->setData('product', $product); } } return $this->rendererListBlock; diff --git a/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php b/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php similarity index 89% rename from Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php rename to Plugin/Sales/AdminOrder/Product/Quote/Initializer.php index 8be0fbbc..85abfcb1 100644 --- a/Model/Sales/AdminOrder/Product/Quote/Plugin/Initializer.php +++ b/Plugin/Sales/AdminOrder/Product/Quote/Initializer.php @@ -1,8 +1,8 @@ - + diff --git a/etc/di.xml b/etc/di.xml index 7ca5cd7e..740078f9 100755 --- a/etc/di.xml +++ b/etc/di.xml @@ -53,7 +53,7 @@ - + diff --git a/view/frontend/layout/catalog_product_view.xml b/view/frontend/layout/catalog_product_view.xml index 5e156ae0..ab0bd179 100644 --- a/view/frontend/layout/catalog_product_view.xml +++ b/view/frontend/layout/catalog_product_view.xml @@ -2,7 +2,7 @@ - + diff --git a/view/frontend/layout/customer_account.xml b/view/frontend/layout/customer_account.xml index 030dd8ef..e2767f5f 100755 --- a/view/frontend/layout/customer_account.xml +++ b/view/frontend/layout/customer_account.xml @@ -17,7 +17,7 @@ My Cards - + pagarme/customer/subscription Subscription diff --git a/view/frontend/layout/pagarme_customer_invoice.xml b/view/frontend/layout/pagarme_customer_invoice.xml index 045ae5ad..b2ab089c 100755 --- a/view/frontend/layout/pagarme_customer_invoice.xml +++ b/view/frontend/layout/pagarme_customer_invoice.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_customer_subscription.xml b/view/frontend/layout/pagarme_customer_subscription.xml index 5f1fc449..b7571f90 100755 --- a/view/frontend/layout/pagarme_customer_subscription.xml +++ b/view/frontend/layout/pagarme_customer_subscription.xml @@ -9,7 +9,7 @@ - + diff --git a/view/frontend/layout/pagarme_pagarme_product_list.xml b/view/frontend/layout/pagarme_pagarme_product_list.xml index 3247000f..8637f912 100644 --- a/view/frontend/layout/pagarme_pagarme_product_list.xml +++ b/view/frontend/layout/pagarme_pagarme_product_list.xml @@ -10,7 +10,7 @@ --> - + From a40a05a8a36150a21e320c8827d85597a9eb3754 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 31 Aug 2023 16:57:05 -0300 Subject: [PATCH 55/83] fix: adding pagarmeConfig property (#241) --- Observer/PaymentMethodAvailable.php | 7 +++++++ Plugin/Cart/CartConflict.php | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Observer/PaymentMethodAvailable.php b/Observer/PaymentMethodAvailable.php index 7addf730..a4bd73e3 100644 --- a/Observer/PaymentMethodAvailable.php +++ b/Observer/PaymentMethodAvailable.php @@ -4,6 +4,7 @@ use Magento\Framework\Event\Observer; use Magento\Framework\Event\ObserverInterface; +use Pagarme\Core\Kernel\Aggregates\Configuration; use Pagarme\Core\Recurrence\Aggregates\Plan; use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; @@ -22,6 +23,11 @@ class PaymentMethodAvailable implements ObserverInterface */ protected $recurrenceProductHelper; + /** + * @var Configuration + */ + protected $pagarmeConfig; + public function __construct( RecurrenceProductHelper $recurrenceProductHelper, PagarmeConfigProvider $pagarmeConfigProvider @@ -29,6 +35,7 @@ public function __construct( Magento2CoreSetup::bootstrap(); $this->recurrenceProductHelper = $recurrenceProductHelper; $this->pagarmeConfigProvider = $pagarmeConfigProvider; + $this->pagarmeConfig = Magento2CoreSetup::getModuleConfiguration(); } /** diff --git a/Plugin/Cart/CartConflict.php b/Plugin/Cart/CartConflict.php index 91ffc05d..0094549c 100644 --- a/Plugin/Cart/CartConflict.php +++ b/Plugin/Cart/CartConflict.php @@ -179,7 +179,7 @@ protected function buildCurrentProduct( $repetitionSelected = $this->getOptionRecurrenceSelected( $productInfo->getOptions(), - $requestInfo['options'] + $requestInfo['options'] ?? [] ); $hasNotRepetitionSelected = !$repetitionSelected && !$isNormalProduct; From 00fb28942936065f92588f59955ce0e94ee83dce Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:44:16 -0300 Subject: [PATCH 56/83] fix: error wih default brand or null (#244) --- view/frontend/web/js/core/checkout/PaymentMethodController.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index 1b302c7d..2b557a54 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -770,10 +770,9 @@ define([ PlatformConfig.PlatformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { brands.push(item.title.toUpperCase()); }); - if ( !brands.includes(element.val().toUpperCase()) - || element.val === '' + && element.val() != 'default' ) { requiredElement.addClass(errorClass); requiredElementError.show(); From 0d97e9e0a130d69608b48ea0fcfd88faf73a85cc Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:45:47 -0300 Subject: [PATCH 57/83] fix: add conditional when wallet fields don't exist (#243) --- view/frontend/web/js/core/models/TwoCreditcardsModel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/view/frontend/web/js/core/models/TwoCreditcardsModel.js b/view/frontend/web/js/core/models/TwoCreditcardsModel.js index 459dbdb3..72500e98 100644 --- a/view/frontend/web/js/core/models/TwoCreditcardsModel.js +++ b/view/frontend/web/js/core/models/TwoCreditcardsModel.js @@ -151,11 +151,11 @@ define([ let saveFirstCard = 0; let saveSecondCard = 0; - if (this.formObject[0].saveThisCard.prop('checked') == true) { + if (this.formObject[0].saveThisCard?.prop('checked') == true) { saveFirstCard = 1; } - if (this.formObject[1].saveThisCard.prop('checked') == true) { + if (this.formObject[1].saveThisCard?.prop('checked') == true) { saveSecondCard = 1; } From 05a83ddc41c69b699a58c80ab5eb71f3eceabac2 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Tue, 5 Sep 2023 10:47:25 -0300 Subject: [PATCH 58/83] PAOPN-576: add shipping and taxs in subs (#242 ) --- Concrete/Magento2PlatformOrderDecorator.php | 86 +++++++++++++++------ Model/PagarmeConfigProvider.php | 19 ++++- etc/adminhtml/system/marketplace.xml | 3 - etc/adminhtml/system/recurrence.xml | 41 +++++++++- i18n/pt_BR.csv | 5 +- 5 files changed, 122 insertions(+), 32 deletions(-) diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index 5d2bb217..dfead032 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -41,6 +41,7 @@ use Pagarme\Core\Payment\ValueObjects\CustomerType; use Pagarme\Core\Payment\ValueObjects\Phone; use Pagarme\Core\Recurrence\Aggregates\Plan; +use Pagarme\Core\Recurrence\Aggregates\Repetition; use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Helper\BuildChargeAddtionalInformationHelper; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; @@ -55,6 +56,7 @@ use Pagarme\Core\Kernel\ValueObjects\TransactionType; use Magento\Quote\Model\Quote; use Pagarme\Pagarme\Helper\Marketplace\WebkulHelper; +use Pagarme\Pagarme\Model\PagarmeConfigProvider; class Magento2PlatformOrderDecorator extends AbstractPlatformOrderDecorator { @@ -72,12 +74,21 @@ class Magento2PlatformOrderDecorator extends AbstractPlatformOrderDecorator * @var OrderService */ private $orderService; + /** + * @var PagarmeConfigProvider + */ + private $config; + /** + * @var MoneyService + */ + private $moneyService; public function __construct() { $this->i18n = new LocalizationService(); $objectManager = ObjectManager::getInstance(); - + $this->moneyService = new MoneyService(); + $this->config = $objectManager->get('Pagarme\Pagarme\Model\PagarmeConfigProvider'); $this->orderFactory = $objectManager->get('Magento\Sales\Model\Order'); $this->orderService = new OrderService(); parent::__construct(); @@ -624,9 +635,9 @@ private function getGuestCustomer($quote) /** @return Item[] */ public function getItemCollection() { - $moneyService = new MoneyService(); $quote = $this->getQuote(); $itemCollection = $quote->getItemsCollection(); + $hasSubscriptionItem = false; $items = []; foreach ($itemCollection as $quoteItem) { //adjusting price. @@ -649,7 +660,7 @@ public function getItemCollection() $item = new Item; $item->setAmount( - $moneyService->floatToCents($price) + $this->moneyService->floatToCents($price) ); if ($quoteItem->getProductId()) { @@ -663,18 +674,53 @@ public function getItemCollection() ); $item->setName($quoteItem->getName()); - - $helper = new RecurrenceProductHelper(); - $selectedRepetition = $helper->getSelectedRepetition($quoteItem); - $item->setSelectedOption($selectedRepetition); - - $this->setRecurrenceInfo($item, $quoteItem); - + if ($this->getRecurrenceService()->getRecurrenceProductByProductId($quoteItem->getProductId())) { + $hasSubscriptionItem = true; + $helper = new RecurrenceProductHelper(); + $selectedRepetition = $helper->getSelectedRepetition($quoteItem); + $item->setSelectedOption($selectedRepetition); + $this->setRecurrenceInfo($item, $quoteItem); + } $items[] = $item; } + + if($hasSubscriptionItem) { + if($this->getPlatformOrder()->getShippingAmount() && $this->config->canAddShippingInItemsOnRecurrence()) { + $items[] = $this->addCustomItem( + $this->getPlatformOrder()->getShippingAmount(), + $this->getPlatformOrder()->getShippingDescription(), + $selectedRepetition + ); + } + if($this->getPlatformOrder()->getBaseTaxAmount() && $this->config->canAddTaxInItemsOnRecurrence()) { + $items[] = $this->addCustomItem( + $this->getPlatformOrder()->getBaseTaxAmount(), + __("Taxs"), + $selectedRepetition + ); + } + } return $items; } + private function addCustomItem($value, $name, $selectedRepetition) + { + $product = new Item(); + $product->setName($name); + $product->setDescription($name); + $product->setQuantity(1); + $product->setCode(0); + $product->setSelectedOption($this->mountRepetition($value, $selectedRepetition)); + $product->setType("subscription"); + $product->setAmount($this->moneyService->floatToCents($value)); + return $product; + } + private function mountRepetition($value, $selectedRepetition) + { + $selectedRepetition->setRecurrencePrice($this->moneyService->floatToCents($value)); + return $selectedRepetition; + } + public function setRecurrenceInfo($item, $quoteItem) { $recurrenceService = $this->getRecurrenceService(); @@ -809,7 +855,6 @@ private function extractPaymentDataFromPagarmeDebit( private function extractBasePaymentData($additionalInformation) { - $moneyService = new MoneyService(); $identifier = null; $customerId = null; $brand = null; @@ -874,7 +919,6 @@ private function extractBasePaymentData($additionalInformation) private function extractPaymentDataFromPagarmeTwoCreditCard($additionalInformation, &$paymentData, $payment) { - $moneyService = new MoneyService(); $indexes = ['first', 'second']; foreach ($indexes as $index) { $identifier = null; @@ -918,11 +962,11 @@ private function extractPaymentDataFromPagarmeTwoCreditCard($additionalInformati $index ); - $amount = $moneyService->removeSeparators( + $amount = $this->moneyService->removeSeparators( $additionalInformation["cc_{$index}_card_amount"] ); - $newPaymentData->amount = $moneyService->floatToCents($amount / 100); + $newPaymentData->amount = $this->moneyService->floatToCents($amount / 100); $newPaymentData->saveOnSuccess = isset($additionalInformation["cc_savecard_{$index}"]) && $additionalInformation["cc_savecard_{$index}"] === '1'; @@ -988,7 +1032,6 @@ private function extractPaymentDataFromPagarmeBilletCreditcard( &$paymentData, $payment ) { - $moneyService = new MoneyService(); $identifier = null; $customerId = null; @@ -1034,7 +1077,7 @@ private function extractPaymentDataFromPagarmeBilletCreditcard( "", $additionalInformation["cc_cc_amount"] ?? '' ); - $newPaymentData->amount = $moneyService->floatToCents($amount / 100); + $newPaymentData->amount = $this->moneyService->floatToCents($amount / 100); $creditCardDataIndex = AbstractCreditCardPayment::getBaseCode(); if (!isset($paymentData[$creditCardDataIndex])) { @@ -1059,7 +1102,7 @@ private function extractPaymentDataFromPagarmeBilletCreditcard( ); $newPaymentData->amount = - $moneyService->floatToCents($amount / 100); + $this->moneyService->floatToCents($amount / 100); $boletoDataIndex = BoletoPayment::getBaseCode(); if (!isset($paymentData[$boletoDataIndex])) { @@ -1079,10 +1122,9 @@ private function extractPaymentDataFromPagarmeBillet( &$paymentData, $payment ) { - $moneyService = new MoneyService(); $newPaymentData = new \stdClass(); $newPaymentData->amount = - $moneyService->floatToCents($this->platformOrder->getGrandTotal()); + $this->moneyService->floatToCents($this->platformOrder->getGrandTotal()); $boletoDataIndex = BoletoPayment::getBaseCode(); if (!isset($paymentData[$boletoDataIndex])) { @@ -1104,10 +1146,9 @@ private function extractPaymentDataFromPagarmePix( &$paymentData, $payment ) { - $moneyService = new MoneyService(); $newPaymentData = new \stdClass(); $newPaymentData->amount = - $moneyService->floatToCents($this->platformOrder->getGrandTotal()); + $this->moneyService->floatToCents($this->platformOrder->getGrandTotal()); $pixDataIndex = PixPayment::getBaseCode(); if (!isset($paymentData[$pixDataIndex])) { @@ -1126,7 +1167,6 @@ private function extractPaymentDataFromPagarmePix( public function getShipping() { - $moneyService = new MoneyService(); /** @var Shipping $shipping */ $shipping = null; $quote = $this->getQuote(); @@ -1141,7 +1181,7 @@ public function getShipping() $shipping = new Shipping(); $shipping->setAmount( - $moneyService->floatToCents($platformShipping->getShippingAmount()) + $this->moneyService->floatToCents($platformShipping->getShippingAmount()) ); $shipping->setDescription($platformShipping->getShippingDescription()); $shipping->setRecipientName($platformShipping->getName()); diff --git a/Model/PagarmeConfigProvider.php b/Model/PagarmeConfigProvider.php index 63bab8f7..7fba0886 100644 --- a/Model/PagarmeConfigProvider.php +++ b/Model/PagarmeConfigProvider.php @@ -18,7 +18,9 @@ class PagarmeConfigProvider implements ConfigProviderInterface /** * Contains if the module is active or not */ - const XML_PATH_IS_GATEWAY_INTEGRATION_TYPE = 'pagarme_pagarme/global/is_gateway_integration_type'; + const XML_PATH_IS_GATEWAY_INTEGRATION_TYPE = 'pagarme_pagarme/global/is_gateway_integration_type'; + const XML_PATH_RECURRENCE_ADD_SHIPPING_IN_ITEMS = 'pagarme_pagarme/recurrence/add_shipping_in_items'; + const XML_PATH_RECURRENCE_ADD_TAX_IN_ITEMS = 'pagarme_pagarme/recurrence/add_tax_in_items'; const XML_PATH_IS_ENABLE_SAVED_CARDS = 'payment/pagarme_creditcard/enabled_saved_cards'; const XML_PATH_SOFT_DESCRIPTION = 'payment/pagarme_creditcard/soft_description'; const XML_PATH_MAX_INSTALLMENT = 'payment/pagarme_creditcard/installments_number'; @@ -93,6 +95,21 @@ public function isGatewayIntegrationType() ); } + public function canAddShippingInItemsOnRecurrence() + { + return $this->scopeConfig->getValue( + self::XML_PATH_RECURRENCE_ADD_SHIPPING_IN_ITEMS, + ScopeInterface::SCOPE_STORE + ) ?? false; + } + public function canAddTaxInItemsOnRecurrence() + { + return $this->scopeConfig->getValue( + self::XML_PATH_RECURRENCE_ADD_TAX_IN_ITEMS, + ScopeInterface::SCOPE_STORE + ) ?? false; + } + public function validateSoftDescription() { $isGatewayIntegrationType = $this->isGatewayIntegrationType(); diff --git a/etc/adminhtml/system/marketplace.xml b/etc/adminhtml/system/marketplace.xml index 7704c321..7eaba6fe 100644 --- a/etc/adminhtml/system/marketplace.xml +++ b/etc/adminhtml/system/marketplace.xml @@ -96,8 +96,5 @@ 1 - - 1 - diff --git a/etc/adminhtml/system/recurrence.xml b/etc/adminhtml/system/recurrence.xml index 92b1eaa5..8aca4bf1 100644 --- a/etc/adminhtml/system/recurrence.xml +++ b/etc/adminhtml/system/recurrence.xml @@ -2,7 +2,7 @@ - + @@ -14,6 +14,9 @@ Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/show_recurrence_currency_widget + + 1 + @@ -21,11 +24,17 @@ Allow to purchase recurrence products with simple products on the same shopping cart Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/purchase_recurrence_product_with_normal_product + + 1 + pagarme_pagarme/recurrence/conflict_recurrence_product_with_normal_product + + 1 + @@ -33,11 +42,17 @@ Allow to purchase more than one recurrence product on the same shopping cart Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/purchase_recurrence_product_with_recurrence_product + + 1 + pagarme_pagarme/recurrence/conflict_recurrence_product_with_recurrence_product + + 1 + @@ -45,9 +60,27 @@ With this option enabled, the module will decrease product stock with each recurrence cycle Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/decrease_stock + + 1 + + + + + + Magento\Config\Model\Config\Source\Yesno + pagarme_pagarme/recurrence/add_shipping_in_items + + 1 + + + + + + Magento\Config\Model\Config\Source\Yesno + pagarme_pagarme/recurrence/add_tax_in_items + + 1 + - - 1 - diff --git a/i18n/pt_BR.csv b/i18n/pt_BR.csv index ff0d0ce0..bae4d001 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -15,7 +15,7 @@ "Multi-means Double Credit Card","Multimeios Dois Cartões de Crédito" "Multi-means Credit Card and Boleto","Multimeios Cartão de Crédito e Boleto" "Debit Card","Cartão de Débito" -"Recurrence Settings (Beta)","Configurações de Recorrência (Beta)" +"Recurrence Settings","Configurações de Recorrência" "Show Recurrence Currency Widget","Mostrar Widget de Moeda de Recorrência" "Conflict checkout message","Mensagem de Conflito do Checkout" "Print Billet","Imprimir Boleto" @@ -496,3 +496,6 @@ "Please, enter valid Name on Card","Por favor, digite um Nome no Cartão válido" "Please, enter valid Expiration Date","Por favor, digite um Data de Validade válida" "The cvv field must be a minimum length of 3 and a maximum length of 4.","O campo de cvv deve ter um tamanho mínimo de 3 e um tamanho máximo de 4." +"Add shipping values in items","Realizar a cobrança do frete" +"Add tax values in items","Realizar a cobrança das taxas" +"Taxs","Taxas" From 85820f5fe6a825d2b3a3b646bfc5afc31323895c Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Fri, 15 Sep 2023 14:35:27 -0300 Subject: [PATCH 59/83] fix: brand validation call (#245) --- view/frontend/web/js/core/checkout/Bin.js | 6 +++--- .../core/checkout/PaymentMethodController.js | 21 +++---------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/view/frontend/web/js/core/checkout/Bin.js b/view/frontend/web/js/core/checkout/Bin.js index 65925f5b..209cc127 100644 --- a/view/frontend/web/js/core/checkout/Bin.js +++ b/view/frontend/web/js/core/checkout/Bin.js @@ -21,7 +21,7 @@ define(['jquery'], ($) => { if (this.validate(formattedNewValue)) { this.binValue = formattedNewValue; - this.getBrand().done(function (data) { + this.getBrand().always(function (data) { this.saveBinInformation(data); }.bind(this)); @@ -57,8 +57,8 @@ define(['jquery'], ($) => { this.checkedBins = []; } - this.checkedBins[this.binValue] = data.brand; - this.selectedBrand = data.brand; + this.checkedBins[this.binValue] = data.status !== 404 ? data.brand : ''; + this.selectedBrand = data.status !== 404 ? data.brand : ''; } }; }); diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index 2b557a54..af24a3d0 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -399,7 +399,6 @@ define([ paymentMethodController.validateCcExpDateField(formObject); return; } - paymentMethodController.validateDefaultField(element); }); } addCreditCardNumberListener(formObject) { @@ -720,8 +719,6 @@ define([ formHandler.init(formObject); formHandler.switchBrand(''); } - this.validateDefaultField(element); - this.validateBrandField(formObject); } validateCcExpDateField(formObject) { const cardExpirationMonth = formObject.creditCardExpMonth; @@ -747,20 +744,7 @@ define([ parentsElementsError.hide(); return false; } - validateDefaultField(element) { - const requiredElement = element.parent().parent(); - const requiredElementError = requiredElement.children(fieldError); - - if (element.val() === '') { - requiredElement.addClass(errorClass); - requiredElementError.show(); - return true; - } - - requiredElement.removeClass(errorClass); - requiredElementError.hide(); - return false; - } + validateBrandField(formObject) { const element = formObject.creditCardBrand; const requiredElement = element.parent().parent(); @@ -772,7 +756,7 @@ define([ }); if ( !brands.includes(element.val().toUpperCase()) - && element.val() != 'default' + && element.val() !== 'default' || element.val() === '' ) { requiredElement.addClass(errorClass); requiredElementError.show(); @@ -802,6 +786,7 @@ define([ formHandler.init(formObject); formHandler.switchBrand(bin.selectedBrand); if (isNewBrand) { + this.validateBrandField(formObject); this.fillInstallments(formObject); } From 155d9ad5167f7dbd7d3b7da73abc08ec1851fef8 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 19 Sep 2023 15:52:51 -0300 Subject: [PATCH 60/83] feat: changing cycles to discount in subscriptions and plans (#246) --- Concrete/Magento2PlatformOrderDecorator.php | 65 ++++--- Model/Api/ProductsPlan.php | 50 ++++-- Model/Api/ProductsSubscription.php | 47 ++--- Setup/UpgradeSchema.php | 26 +++ composer.json | 2 +- etc/adminhtml/system/recurrence.xml | 8 +- etc/db_schema.xml | 22 +++ etc/db_schema_whitelist.json | 28 ++- etc/module.xml | 2 +- i18n/en_US.csv | 19 ++ i18n/pt_BR.csv | 21 ++- .../templates/recurrence/plans/create.phtml | 115 +++++++++--- .../recurrence/subscriptions/create.phtml | 111 +++++++++--- view/adminhtml/web/js/recurrence.js | 165 +++++++++--------- .../frontend/web/css/pagarme_success_page.css | 1 + 15 files changed, 484 insertions(+), 198 deletions(-) diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index dfead032..963f461d 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -6,7 +6,6 @@ use Magento\Framework\Api\FilterBuilder; use Magento\Framework\Api\SearchCriteriaBuilder; use Magento\Framework\App\ObjectManager; -use Magento\Framework\Exception\NoSuchEntityException; use Magento\Quote\Model\QuoteFactory; use Magento\Sales\Model\Order; use Magento\Sales\Model\Order\Payment\Transaction\Repository as TransactionRepository; @@ -15,14 +14,12 @@ use Pagarme\Core\Kernel\Abstractions\AbstractPlatformOrderDecorator; use Pagarme\Core\Kernel\Aggregates\Charge; use Pagarme\Core\Kernel\Interfaces\PlatformInvoiceInterface; -use Pagarme\Core\Kernel\Interfaces\PlatformOrderInterface; use Pagarme\Core\Kernel\Services\MoneyService; use Pagarme\Core\Kernel\Services\OrderService; use Pagarme\Core\Kernel\ValueObjects\Id\CustomerId; use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; use Pagarme\Core\Kernel\ValueObjects\OrderState; use Pagarme\Core\Kernel\ValueObjects\OrderStatus; -use Pagarme\Core\Kernel\ValueObjects\PaymentMethod; use Pagarme\Core\Marketplace\Aggregates\Split; use Pagarme\Core\Payment\Aggregates\Address; use Pagarme\Core\Payment\Aggregates\Customer; @@ -36,7 +33,6 @@ use Pagarme\Core\Payment\Aggregates\Shipping; use Pagarme\Core\Payment\Factories\PaymentFactory; use Pagarme\Core\Payment\Repositories\CustomerRepository as CoreCustomerRepository; -use Pagarme\Core\Payment\Repositories\SavedCardRepository; use Pagarme\Core\Payment\ValueObjects\CustomerPhones; use Pagarme\Core\Payment\ValueObjects\CustomerType; use Pagarme\Core\Payment\ValueObjects\Phone; @@ -45,15 +41,11 @@ use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Pagarme\Helper\BuildChargeAddtionalInformationHelper; use Pagarme\Pagarme\Helper\RecurrenceProductHelper; -use Pagarme\Pagarme\Gateway\Transaction\Base\Config\Config; -use Pagarme\Pagarme\Model\Cards; use Pagarme\Pagarme\Model\CardsRepository; use Pagarme\Core\Kernel\Services\LocalizationService; use Pagarme\Core\Kernel\Services\LogService; use Magento\Sales\Model\Order\Email\Sender\OrderCommentSender; use Magento\Sales\Model\ResourceModel\Order\Status\Collection; -use Pagarme\Core\Kernel\Aggregates\Transaction; -use Pagarme\Core\Kernel\ValueObjects\TransactionType; use Magento\Quote\Model\Quote; use Pagarme\Pagarme\Helper\Marketplace\WebkulHelper; use Pagarme\Pagarme\Model\PagarmeConfigProvider; @@ -639,6 +631,7 @@ public function getItemCollection() $itemCollection = $quote->getItemsCollection(); $hasSubscriptionItem = false; $items = []; + $selectedRepetition = null; foreach ($itemCollection as $quoteItem) { //adjusting price. $price = $quoteItem->getPrice(); @@ -674,32 +667,51 @@ public function getItemCollection() ); $item->setName($quoteItem->getName()); - if ($this->getRecurrenceService()->getRecurrenceProductByProductId($quoteItem->getProductId())) { - $hasSubscriptionItem = true; + $recurrenceItem = $this->getRecurrenceService() + ->getRecurrenceProductByProductId($quoteItem->getProductId()); + if ($recurrenceItem) { $helper = new RecurrenceProductHelper(); $selectedRepetition = $helper->getSelectedRepetition($quoteItem); $item->setSelectedOption($selectedRepetition); $this->setRecurrenceInfo($item, $quoteItem); + + $hasSubscriptionItem = $hasSubscriptionItem || !empty($item->getType()); + + if ($item->getType() === Plan::RECURRENCE_TYPE) { + $planItems = $recurrenceItem->getItems(); + $cycles = $this->getRecurrenceService() + ->getGreatestCyclesFromItems($planItems); + $selectedRepetition = new Repetition(); + $selectedRepetition->setCycles($cycles); + } } $items[] = $item; } - if($hasSubscriptionItem) { - if($this->getPlatformOrder()->getShippingAmount() && $this->config->canAddShippingInItemsOnRecurrence()) { - $items[] = $this->addCustomItem( - $this->getPlatformOrder()->getShippingAmount(), - $this->getPlatformOrder()->getShippingDescription(), - $selectedRepetition - ); - } - if($this->getPlatformOrder()->getBaseTaxAmount() && $this->config->canAddTaxInItemsOnRecurrence()) { - $items[] = $this->addCustomItem( - $this->getPlatformOrder()->getBaseTaxAmount(), - __("Taxs"), - $selectedRepetition - ); - } + return $this->addShippingAndTaxToSubscription($hasSubscriptionItem, $selectedRepetition, $items); + } + + private function addShippingAndTaxToSubscription($hasSubscriptionItem, $selectedRepetition, $items) + { + if (!$hasSubscriptionItem) { + return $items; } + + if ($this->getPlatformOrder()->getShippingAmount() && $this->config->canAddShippingInItemsOnRecurrence()) { + $items[] = $this->addCustomItem( + $this->getPlatformOrder()->getShippingAmount(), + $this->getPlatformOrder()->getShippingDescription(), + $selectedRepetition + ); + } + if ($this->getPlatformOrder()->getBaseTaxAmount() && $this->config->canAddTaxInItemsOnRecurrence()) { + $items[] = $this->addCustomItem( + $this->getPlatformOrder()->getBaseTaxAmount(), + __("Taxs"), + $selectedRepetition + ); + } + return $items; } @@ -717,6 +729,9 @@ private function addCustomItem($value, $name, $selectedRepetition) } private function mountRepetition($value, $selectedRepetition) { + if (empty($selectedRepetition)) { + return $selectedRepetition; + } $selectedRepetition->setRecurrencePrice($this->moneyService->floatToCents($value)); return $selectedRepetition; } diff --git a/Model/Api/ProductsPlan.php b/Model/Api/ProductsPlan.php index 285cf740..addcf52d 100644 --- a/Model/Api/ProductsPlan.php +++ b/Model/Api/ProductsPlan.php @@ -6,7 +6,6 @@ use Magento\Framework\Webapi\Rest\Request; use Pagarme\Core\Recurrence\Services\PlanService; use Pagarme\Core\Recurrence\Aggregates\Plan; -use Pagarme\Core\Recurrence\Interfaces\ProductPlanInterface; use Pagarme\Core\Recurrence\Factories\PlanFactory; use Pagarme\Pagarme\Api\ProductPlanApiInterface; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; @@ -45,17 +44,13 @@ public function saveFormData() $form = $this->gerFormattedForm($params['form']); $form['status'] = 'ACTIVE'; - if (empty($form)) { - return json_encode([ - 'code' => 404, - 'message' => 'Erro ao tentar criar um produto do tipo plano' - ]); - } + $validationErrorMessages = $this->validateData($form); - if (!$form['items']) { + if (!empty($validationErrorMessages)) { + $message = implode(' | ', $validationErrorMessages); return json_encode([ - 'code' => 404, - 'message' => 'Please add subproducts before product saving' + 'code' => 400, + 'message' => $message ]); } @@ -67,13 +62,13 @@ public function saveFormData() } catch (\Exception $exception) { return json_encode([ 'code' => 404, - 'message' => 'Erro ao tentar criar um produto do tipo plano' + 'message' => __('Error in trying to create a plan type product') ]); } return json_encode([ 'code' => 200, - 'message' => 'Product Plan saved' + 'message' => __('Plan Product saved') ]); } @@ -95,6 +90,10 @@ public function gerFormattedForm($form) $form['installments'] = (bool)$form['installments']; } + if (isset($form['apply_discount_in_all_product_cycles'])) { + $form['apply_discount_in_all_product_cycles'] = (bool)$form['apply_discount_in_all_product_cycles']; + } + return $form; } @@ -133,7 +132,7 @@ public function list() $products = $this->planService->findAll(); if (empty($products)) { - throw new \Exception('List Product plan not found', 404); + throw new \Exception(__('List of plan products not found'), 404); } return $products; @@ -158,7 +157,7 @@ public function update($id, $productPlan) $planOriginal = $this->planService->findById($id); if (empty($planOriginal)) { - throw new \Exception('Plan not found', 404); + throw new \Exception(__('Plan not found'), 404); } ProductPlanHelper::mapperProductPlanUpdate($planOriginal, $productPlan); @@ -186,7 +185,7 @@ public function find($id) $plan = $this->planService->findById($id); if (empty($plan)) { - throw new \Exception('Product plan not found', 400); + throw new \Exception(__('Plan product not found'), 400); } return $plan; @@ -210,7 +209,7 @@ public function delete($id) $productData = $this->planService->findById($id); if (!$productData || !$productData->getId()) { - throw new \Exception('Product plan not found', 404); + throw new \Exception(__('Plan product not found'), 404); } $this->planService->delete($id); @@ -224,4 +223,23 @@ public function delete($id) ); } } + + /** + * @param mixed $data + * @return array + */ + private function validateData($data) + { + $errorMessages = []; + + if (empty($data)) { + $errorMessages[] = __('Error in trying to create a plan type product'); + } + + if (empty($errorMessages) && !$data['items']) { + $errorMessages[] = __('Please add subproducts before saving the plan'); + } + + return $errorMessages; + } } diff --git a/Model/Api/ProductsSubscription.php b/Model/Api/ProductsSubscription.php index fcd4631e..749db3b8 100644 --- a/Model/Api/ProductsSubscription.php +++ b/Model/Api/ProductsSubscription.php @@ -2,20 +2,19 @@ namespace Pagarme\Pagarme\Model\Api; -use Magento\Framework\App\ObjectManager; use Pagarme\Core\Kernel\Services\LocalizationService; use Pagarme\Core\Kernel\Services\MoneyService; -use Pagarme\Core\Recurrence\Aggregates\ProductSubscription; -use Pagarme\Core\Recurrence\Aggregates\Repetition; use Pagarme\Core\Recurrence\Services\ProductSubscriptionService; use Pagarme\Pagarme\Api\ProductSubscriptionApiInterface; use Magento\Framework\Webapi\Rest\Request; use Pagarme\Pagarme\Concrete\Magento2CoreSetup; use Pagarme\Pagarme\Helper\ProductSubscriptionHelper; use Pagarme\Pagarme\Api\ObjectMapper\ProductSubscription\ProductSubscriptionMapperInterface; +use Throwable; class ProductsSubscription implements ProductSubscriptionApiInterface { + const SUBSCRIPTION_NOT_FOUND_MESSAGE = "Subscription Product not found"; /** * @var Request */ @@ -56,7 +55,7 @@ public function __construct(Request $request) * * @param ProductSubscriptionInterface $productSubscription * @param int $id - * @return ProductSubscriptionMapperInterface|array + * @return array|\Pagarme\Core\Recurrence\Aggregates\ProductSubscription|string */ public function save($productSubscription, $id = null) { @@ -64,7 +63,7 @@ public function save($productSubscription, $id = null) if (!empty($id)) { $product = $this->productSubscriptionService->findById($id); if (empty($product)) { - return "Subscription Product not found"; + return __(self::SUBSCRIPTION_NOT_FOUND_MESSAGE); } $productSubscription->setId($id); @@ -80,12 +79,7 @@ public function save($productSubscription, $id = null) $this->productSubscriptionHelper ->setCustomOption($productSubscription); - } catch (\Exception $exception) { - return [ - 'code' => 404, - 'message' => $exception->getMessage() - ]; - } catch (\Throwable $exception) { + } catch (Throwable $exception) { return [ 'code' => 404, 'message' => $exception->getMessage() @@ -98,13 +92,13 @@ public function save($productSubscription, $id = null) /** * List products subscription * - * @return ProductSubscriptionMapperInterface[]|array + * @return ProductSubscriptionMapperInterface[]|array|string */ public function list() { $products = $this->productSubscriptionService->findAll(); if (empty($products)) { - return "Subscription Products not found"; + return __("Subscription Products not found"); } return $products; @@ -114,13 +108,13 @@ public function list() * Get a product subscription * * @param int $id - * @return ProductSubscriptionMapperInterface|null + * @return ProductSubscriptionMapperInterface|null|string */ public function getProductSubscription($id) { $product = $this->productSubscriptionService->findById($id); if (empty($product)) { - return "Subscription Product not found"; + return __(self::SUBSCRIPTION_NOT_FOUND_MESSAGE); } return $product; @@ -150,7 +144,7 @@ public function delete($id) $productSubscription = $this->productSubscriptionService->findById($id); if ($productSubscription === null) { - return "Subscription Product not found"; + return __(self::SUBSCRIPTION_NOT_FOUND_MESSAGE); } $this->productSubscriptionHelper->deleteRecurrenceCustomOption( @@ -158,13 +152,11 @@ public function delete($id) ); $this->productSubscriptionService->delete($id); - } catch (\Exception $exception) { - return [$exception->getMessage()]; - } catch (\Throwable $exception) { + } catch (Throwable $exception) { return [$exception->getMessage()]; } - return "Subscription Product deleted with success"; + return __("Subscription Product deleted with success"); } /** @@ -185,7 +177,7 @@ public function saveFormData() if (empty($form)) { return json_encode([ 'code' => 404, - 'message' => 'Error on save product subscription' + 'message' => __('Error saving the subscription product') ]); } @@ -198,15 +190,10 @@ public function saveFormData() return json_encode([ 'code' => 200, - 'message' => 'Product subscription saved' + 'message' => __('Subscription product saved') ]); - } catch (\Exception $exception) { - return json_encode([ - 'code' => 404, - 'message' => $exception->getMessage() - ]); - } catch (\Throwable $exception) { + } catch (Throwable $exception) { return json_encode([ 'code' => 404, 'message' => $exception->getMessage() @@ -240,6 +227,10 @@ public function gerFormattedForm($form) ); } + if (isset($form['apply_discount_in_all_product_cycles'])) { + $form['apply_discount_in_all_product_cycles'] = (bool)$form['apply_discount_in_all_product_cycles']; + } + return $form; } } diff --git a/Setup/UpgradeSchema.php b/Setup/UpgradeSchema.php index 831b61e8..150c0636 100644 --- a/Setup/UpgradeSchema.php +++ b/Setup/UpgradeSchema.php @@ -2,6 +2,7 @@ namespace Pagarme\Pagarme\Setup; +use Magento\Framework\DB\Ddl\Table; use Magento\Framework\Setup\UpgradeSchemaInterface; use Magento\Framework\Setup\ModuleContextInterface; use Magento\Framework\Setup\SchemaSetupInterface; @@ -28,6 +29,31 @@ public function upgrade( $setup = $installSchema->installRecipients($setup); } + if (version_compare($version, '2.2.6', '<')) { + $connection = $setup->getConnection(); + $connection->addColumn( + $setup->getTable('pagarme_module_core_recurrence_products_plan'), + 'apply_discount_in_all_product_cycles', + [ + 'type' => Table::TYPE_SMALLINT, + 'length' => 1, + 'nullable' => true, + 'comment' => 'Apply products cycle to discount' + ] + ); + + $connection->addColumn( + $setup->getTable('pagarme_module_core_recurrence_products_subscription'), + 'apply_discount_in_all_product_cycles', + [ + 'type' => Table::TYPE_SMALLINT, + 'length' => 1, + 'nullable' => true, + 'comment' => 'Apply products cycle to discount' + ] + ); + } + $setup->endSetup(); } } diff --git a/composer.json b/composer.json index 6cbe0f5a..0462722b 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.5", + "version": "2.2.6", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", "require": { diff --git a/etc/adminhtml/system/recurrence.xml b/etc/adminhtml/system/recurrence.xml index 8aca4bf1..fe8cf91b 100644 --- a/etc/adminhtml/system/recurrence.xml +++ b/etc/adminhtml/system/recurrence.xml @@ -2,7 +2,7 @@ - + @@ -64,20 +64,22 @@ 1 - + Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/add_shipping_in_items + For plans, when enabling this options, the shipping will be applied to all charges, even when the products have different cycles. 1 - + Magento\Config\Model\Config\Source\Yesno pagarme_pagarme/recurrence/add_tax_in_items + For plans, when enabling this options, the taxes will be applied to all charges, even when the products have different cycles. 1 diff --git a/etc/db_schema.xml b/etc/db_schema.xml index 03ada067..40393d5d 100644 --- a/etc/db_schema.xml +++ b/etc/db_schema.xml @@ -45,6 +45,28 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/etc/db_schema_whitelist.json b/etc/db_schema_whitelist.json index 12b1d664..a4eeac8a 100644 --- a/etc/db_schema_whitelist.json +++ b/etc/db_schema_whitelist.json @@ -50,10 +50,34 @@ "recurrence_price": true, "cycles": true, "created_at": true, - "updated_at": true + "updated_at": true, + "apply_discount_in_all_product_cycles": true + }, + "constraint": { + "PRIMARY": true + } + }, + "pagarme_module_core_recurrence_products_plan": { + "column": { + "id": true, + "interval_type": true, + "interval_count": true, + "name": true, + "description": true, + "plan_id": true, + "product_id": true, + "credit_card": true, + "installments": true, + "boleto": true, + "billing_type": true, + "status": true, + "trial_period_days": true, + "created_at": true, + "updated_at": true, + "apply_discount_in_all_product_cycles": true }, "constraint": { "PRIMARY": true } } -} \ No newline at end of file +} diff --git a/etc/module.xml b/etc/module.xml index 8d4024ec..7c90bc43 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 e1a07c3a..a31f36a3 100644 --- a/i18n/en_US.csv +++ b/i18n/en_US.csv @@ -317,3 +317,22 @@ "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 bae4d001..6cadb357 100644 --- a/i18n/pt_BR.csv +++ b/i18n/pt_BR.csv @@ -15,7 +15,7 @@ "Multi-means Double Credit Card","Multimeios Dois Cartões de Crédito" "Multi-means Credit Card and Boleto","Multimeios Cartão de Crédito e Boleto" "Debit Card","Cartão de Débito" -"Recurrence Settings","Configurações de Recorrência" +"Recurrence Settings (Beta)","Configurações de Recorrência (Beta)" "Show Recurrence Currency Widget","Mostrar Widget de Moeda de Recorrência" "Conflict checkout message","Mensagem de Conflito do Checkout" "Print Billet","Imprimir Boleto" @@ -499,3 +499,22 @@ "Add shipping values in items","Realizar a cobrança do frete" "Add tax values in items","Realizar a cobrança das taxas" "Taxs","Taxas" +"Error in trying to create a plan type product","Erro ao tentar criar um produto do tipo plano" +"Please add subproducts before saving the plan","Por favor adicione subprodutos antes de salvar o plano" +"Plan product not found","Produto do plano não encontrado" +"List of plan products not found","Lista de produtos do plano não encontrado" +"Plan Product saved","Produto do Plano salvo" +"Subscription Product not found","Produto de assinatura não encontrado" +"Subscription Products not found","Produtos de assinatura não encontrados" +"Error saving the subscription product","Erro ao salvar o produto de assinatura" +"Subscription product saved","Produto de assinatura salvo" +"No product founded with name: %1","Nenhum produto encontrado com nome: %1" +"Bundle product not selected","Produto bundle não selecionado" +"Select at last one payment method","Selecione pelo menos um método de pagamento" +"Fill at last one cycle option","Preencha pelo menos uma opção de pagamento" +"It was not possible to find the subproducts for this bundle. Check your configuration and try again","Não foi possível encontrar os subprodutos deste bundle. Verifique sua configuração e tente novamente" +"Cart Discount","Desconto de Carrinho" +"Apply cart discount to all subscription charges","Aplicar desconto de carrinho para todas as cobranças da assinatura" +"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." diff --git a/view/adminhtml/templates/recurrence/plans/create.phtml b/view/adminhtml/templates/recurrence/plans/create.phtml index b9a17723..9cc93973 100644 --- a/view/adminhtml/templates/recurrence/plans/create.phtml +++ b/view/adminhtml/templates/recurrence/plans/create.phtml @@ -1,4 +1,8 @@ - +
    @@ -8,7 +12,12 @@ -
    @@ -20,7 +29,10 @@ - + @@ -38,7 +50,9 @@ - + @@ -49,31 +63,41 @@
    + -
    +

    -

    - - - - + + + +
    + @@ -108,8 +133,13 @@
    - - + +
    @@ -120,19 +150,56 @@
    - - + + +
    +
    + + +
    + +
    +
    + + +
    + +
    + +
    +
    +
    - +
    @@ -143,7 +210,9 @@
    - @@ -156,7 +225,9 @@
    - diff --git a/view/adminhtml/templates/recurrence/subscriptions/create.phtml b/view/adminhtml/templates/recurrence/subscriptions/create.phtml index 3feb75b1..a94db0be 100644 --- a/view/adminhtml/templates/recurrence/subscriptions/create.phtml +++ b/view/adminhtml/templates/recurrence/subscriptions/create.phtml @@ -1,4 +1,7 @@ getCicleSelectOption(); $quantityOptionCicle = 4; ?> @@ -15,7 +18,9 @@ $quantityOptionCicle = 4; @@ -28,7 +33,10 @@ $quantityOptionCicle = 4; - + @@ -40,7 +48,9 @@ $quantityOptionCicle = 4; - + @@ -51,13 +61,17 @@ $quantityOptionCicle = 4;
    - -
    + +

    - + @@ -74,6 +88,7 @@ $quantityOptionCicle = 4;
    + @@ -93,8 +108,14 @@ $quantityOptionCicle = 4;
    - - + +
    @@ -105,8 +126,13 @@ $quantityOptionCicle = 4;
    - - + +
    @@ -117,7 +143,10 @@ $quantityOptionCicle = 4;
    - +
    @@ -129,18 +158,40 @@ $quantityOptionCicle = 4;
    - +
    +
    + +
    +
    + + +
    +
    +
    +
    + @@ -150,29 +201,49 @@ $quantityOptionCicle = 4; - +
    - - + - - $intervalType) : ?> - + $intervalType + ) : ?> + - + - +
    diff --git a/view/adminhtml/web/js/recurrence.js b/view/adminhtml/web/js/recurrence.js index 6d85f647..2bb3deef 100644 --- a/view/adminhtml/web/js/recurrence.js +++ b/view/adminhtml/web/js/recurrence.js @@ -1,18 +1,22 @@ require([ 'jquery', - 'jquery/ui' + 'jquery/ui', + 'mage/translate' ], function ($) { 'use strict'; + let productBundleMaxIndex = -1; + const saveButtonElement = "#save-button"; + const recurrenceTypeElement = "#recurrence-type"; $(document).ready(function(){ $("#allow_installments_div").hide(); - var editProduct = $("#edit-product").val(); + const editProduct = $("#edit-product").val(); if (editProduct.length > 0) { $(".select-product").hide(); loadProduct(JSON.parse(editProduct)); } - var products = Object.values( + const products = Object.values( JSON.parse($("#products-bundle").val()) ); @@ -23,11 +27,11 @@ require([ $("#product_id").val(ui.item.id); }, search: function(event, oUi) { - var currentValue = $(event.target).val().toLowerCase(); - var arraySearch = []; - for (var index in products) { + const currentValue = $(event.target).val().toLowerCase(); + const arraySearch = []; + for (const index in products) { - var productName = products[index].value.toLowerCase(); + const productName = products[index].value.toLowerCase(); if (productName.indexOf(currentValue) >= 0) { arraySearch.push(products[index]); @@ -36,15 +40,15 @@ require([ $(this).autocomplete('option', 'source', arraySearch); - if (arraySearch.length == 0) { - var message = 'Nenhum produto encontrado com nome: ' + currentValue; + if (arraySearch.length === 0) { + const message = $.mage.__('No product founded with name: %1').replace('%1', currentValue); showErrorMessage(message); } } }); $("#add-product").on('click', function() { - if ($("#product_id").val() == "") { + if ($("#product_id").val() === "") { return; } updateTableProduct($(this)); @@ -57,8 +61,8 @@ require([ }); function formatPriceValue(e) { - var value = $(this).val(); - value = value.replace(/[^0-9]/g, ''); + let value = $(this).val(); + value = value.replace(/\D]/g, ''); value = (value / 100).toFixed(2); $(this).val(value.toString().replace('.',",")); } @@ -73,15 +77,15 @@ require([ function formSubmit(e) { e.preventDefault(); - var errors = validateForm(e); + const errors = validateForm(e); if (errors.length > 0) { alert(errors.join("\r\n")); return; } - toogleSaveButton(); + toggleSaveButton(); - var dataSerialize = jQuery(this).serialize(); - var url = $("#url-post").val(); + const dataSerialize = jQuery(this).serialize(); + const url = $("#url-post").val(); jQuery.ajax({ method: "POST", @@ -97,60 +101,60 @@ require([ alert(data.message); }, complete: function () { - toogleSaveButton() + toggleSaveButton() } }); } - function toogleSaveButton() + function toggleSaveButton() { - var disabled = $("#save-button").prop('disabled'); + const disabled = $(saveButtonElement).prop('disabled'); if (disabled) { - $("#save-button").attr('disabled', false); - $("#save-button span").html("Save"); + $(saveButtonElement).attr('disabled', false); + $(`${saveButtonElement} span`).html("Save"); return; } - $("#save-button").attr('disabled', true); - $("#save-button span").html("Saving"); + $(saveButtonElement).attr('disabled', true); + $(`${saveButtonElement} span`).html("Saving"); } function validateForm(e) { - var errors = []; + const errors = []; - var type = $("#recurrence-type").val(); + const type = $(recurrenceTypeElement).val(); - var productId = $("#product_id").val(); + const productId = $("#product_id").val(); if (productId.length <= 0) { - errors.push("Bundle product not selected"); + errors.push($.mage.__("Bundle product not selected")); } - var paymentMethod = [ + const paymentMethod = [ $("#boleto").prop("checked"), $("#credit-card").prop("checked") ]; - var paymentsSelecteds = paymentMethod.filter(function (item) { + const selectedPayments = paymentMethod.filter(function (item) { return item !== false; }); - if (paymentsSelecteds.length <= 0) { - errors.push("Select at last one payment method"); + if (selectedPayments.length <= 0) { + errors.push($.mage.__("Select at last one payment method")); } - if (type == 'subscription') { - var cycles = [ + if (type === 'subscription') { + const cycles = [ $("#interval_count_1").val(), $("#interval_count_2").val(), $("#interval_count_3").val(), $("#interval_count_4").val() ]; - var cyclesSelecteds = cycles.filter(function (item) { + const selectedCycles = cycles.filter(function (item) { return item !== ""; }); - if (cyclesSelecteds.length <= 0) { - errors.push("Fill at last one cycle option"); + if (selectedCycles.length <= 0) { + errors.push($.mage.__("Fill at last one cycle option")); } } @@ -158,19 +162,19 @@ require([ } function updateTableProduct(element) { - var data = { + const data = { productId: $("#product_id").val(), - recurrenceType: $("#recurrence-type").val(), + recurrenceType: $(recurrenceTypeElement).val(), recurrenceProductId: $("#product-recurrence-id").val() } - if (data.productId.length == 0) { + if (data.productId.length === 0) { return; } element.attr('disabled', true); - if (element.data('action') == 'add') { - var url = $("#url-search").val(); + if (element.data('action') === 'add') { + const url = $("#url-search").val(); $.getJSON(url, data, showData); return; } @@ -179,20 +183,18 @@ require([ $("#table-products tbody").empty(); $("#product-search").val(""); changeButton(); - return; } function showData(data) { if (!data || data.length == 0) { - var msg = - 'Não foi possível encontrar os subprodutos deste bundle. ' + - 'Verifique sua configuração e tente novamente'; + const msg = $.mage.__('It was not possible to find the subproducts for this bundle. ' + + 'Check your configuration and try again'); changeButton(); showErrorMessage(msg); return; } $("#table-products").show(); - for (var index in data) { + for (const index in data) { addRow(data[index], index); } fillProductBundle(data['productBundle']); @@ -212,48 +214,54 @@ require([ return; } - var id = data.id == undefined ? "" : data.id; - var cycles = data.cycles == undefined ? "" : data.cycles; - var quantity = data.quantity == undefined ? 1 : data.quantity; - var pagarme_id = data.pagarme_id == undefined ? "" : data.pagarme_id; + if (index > productBundleMaxIndex) { + productBundleMaxIndex = index; + } + + const id = data.id === undefined ? "" : data.id; + const cycles = data.cycles === undefined ? "" : data.cycles; + const quantity = data.quantity === undefined ? 1 : data.quantity; + const pagarmeId = data.pagarme_id === undefined ? "" : data.pagarme_id; + const inputFormItem = `"; - var inputsHidden = "" + - "" + - "" + - "" + - "" + - ""; + const inputsHidden = `${inputFormItem}][product_id]' value='${data.code}${closeTag} + ${inputFormItem}][name]' value='${data.name}${closeTag} + ${inputFormItem}][price]' value='${data.price}${closeTag} + ${inputFormItem}][quantity]' value='${quantity}${closeTag} + ${inputFormItem}][pagarme_id]' value='${pagarmeId}${closeTag} + ${inputFormItem}][id]' value='${id}${closeTag}`; - var quantityColumn = ""; - var priceColumn = "" + - ""; + const quantityColumn = ``; + const priceColumn = ` + `; - var type = $("#recurrence-type").val(); + const type = $(recurrenceTypeElement).val(); - var lastColumn = quantityColumn; - if (type == 'subscription') { + let lastColumn = quantityColumn; + if (type === 'subscription') { lastColumn = priceColumn; } - var tr = $('').append( - $('').html(""), + const tr = $('').append( + $('').html(``), $('').text(data.name), $('').html(lastColumn + inputsHidden), ); - var cycleColumn = ""; + const cycleColumn = ``; if (type !== 'subscription') { tr.append($('').html(cycleColumn)) } - var table = $('#table-products tbody'); + const table = $('#table-products tbody'); table.append(tr); } function changeButton() { - var button = $("#add-product"); + const button = $("#add-product"); button.attr('disabled', false); - if (button.data('action') == 'add') { + if (button.data('action') === 'add') { $('#product-search').attr('disabled', true); button.data('action', 'remove'); button.find('span').html("Remove Product"); @@ -262,7 +270,6 @@ require([ $('#product-search').attr('disabled', false); button.data('action', 'add'); button.find('span').html("Add Product"); - return; } function loadProduct(product) { @@ -274,6 +281,7 @@ require([ $("#plan-id").val(product.pagarmeId); $("#status").val(product.status); $("#trial_period_days").val(product.trialPeriodDays); + $("#apply-discount-in-all-product-cycles").prop('checked', product.applyDiscountInAllProductCycles) if (product.creditCard) { @@ -287,26 +295,25 @@ require([ } function fillRepetitionTable(reptitions) { - if (reptitions == undefined) { + if (reptitions === undefined) { return; } - for (var index in reptitions) { - var count = parseInt(index) + 1; - var recurrencePrice = reptitions[index].recurrencePrice; + for (const index in reptitions) { + const count = parseInt(index) + 1; + let recurrencePrice = reptitions[index].recurrencePrice; recurrencePrice = (recurrencePrice / 100).toFixed(2); recurrencePrice = recurrencePrice.toString().replace('.',','); - $("#interval_count_" + count).val(reptitions[index].intervalCount); - $("#interval_" + count).val(reptitions[index].interval); - $("#recurrence_price_" + count).val(recurrencePrice); - $("#cycles_" + count).val(reptitions[index].cycles || 0); - $("#repetition_id_" + count).val(reptitions[index].id); + $(`#interval_count_${count}`).val(reptitions[index].intervalCount); + $(`#interval_${count}`).val(reptitions[index].interval); + $(`#recurrence_price_${count}`).val(recurrencePrice); + $(`#cycles_${count}`).val(reptitions[index].cycles || 0); + $(`#repetition_id_${count}`).val(reptitions[index].id); } } function showErrorMessage(message) { - var message = message; $('#error-message').html(message).show(); setTimeout(function(){ $('#error-message').fadeOut() }, 3000); diff --git a/view/frontend/web/css/pagarme_success_page.css b/view/frontend/web/css/pagarme_success_page.css index efdcfc0c..5a44a7ad 100644 --- a/view/frontend/web/css/pagarme_success_page.css +++ b/view/frontend/web/css/pagarme_success_page.css @@ -29,6 +29,7 @@ vertical-align: middle; margin: 0 5px 0 0; width: 20px; + cursor: pointer; } .pix-wrapper .copy-qr-code-wrapper .copy-inline a { From 3ee6c834935474479346f0e429696ce07a5add18 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 20 Sep 2023 10:19:10 -0300 Subject: [PATCH 61/83] fix: recurrence price mask showing NaN for all values (#248) --- view/adminhtml/web/js/recurrence.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/adminhtml/web/js/recurrence.js b/view/adminhtml/web/js/recurrence.js index 2bb3deef..4305941f 100644 --- a/view/adminhtml/web/js/recurrence.js +++ b/view/adminhtml/web/js/recurrence.js @@ -62,7 +62,7 @@ require([ function formatPriceValue(e) { let value = $(this).val(); - value = value.replace(/\D]/g, ''); + value = value.replace(/[^0-9]/g, ''); value = (value / 100).toFixed(2); $(this).val(value.toString().replace('.',",")); } From 5bbbe5d9553efe4381cbd8920c253f73e568f81a Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 20 Sep 2023 15:44:55 -0300 Subject: [PATCH 62/83] fix: changing to use messageList from magento (#249) --- .../web/js/core/checkout/PaymentModuleBootstrap.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js b/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js index 65e8bae1..879d8fbb 100644 --- a/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js +++ b/view/frontend/web/js/core/checkout/PaymentModuleBootstrap.js @@ -4,8 +4,9 @@ define([ 'Pagarme_Pagarme/js/core/checkout/PaymentMethodController', - 'Pagarme_Pagarme/js/core/checkout/PlatformPlaceOrder' -], (PaymentMethodController, PlatformPlaceOrder) => { + 'Pagarme_Pagarme/js/core/checkout/PlatformPlaceOrder', + 'Magento_Ui/js/model/messageList' +], (PaymentMethodController, PlatformPlaceOrder, messageList) => { const PagarmeCore = { paymentMethod : [] }; @@ -50,10 +51,9 @@ define([ const errors = PagarmeCore.paymentMethod[model].model.errors; if (errors.length > 0) { for (let index in errors) { - this.messageList.addErrorMessage(errors[index]); + messageList.addErrorMessage(errors[index]); } jQuery("html, body").animate({scrollTop: 0}, 600); - console.log(errors); } }; From 80e22cf0fc91908a78672bd39ea60be0d7bd9e1e Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 21 Sep 2023 14:28:02 -0300 Subject: [PATCH 63/83] fix: strlen on null value for php 8.2 (#250) --- Model/InstallmentsByBrandAndAmountManagement.php | 1 + Model/InstallmentsByBrandManagement.php | 1 + view/adminhtml/templates/info/billetCreditCard.phtml | 12 +++++++++--- view/frontend/templates/info/twoCreditCard.phtml | 4 ++-- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/Model/InstallmentsByBrandAndAmountManagement.php b/Model/InstallmentsByBrandAndAmountManagement.php index d687f7db..c9713f92 100644 --- a/Model/InstallmentsByBrandAndAmountManagement.php +++ b/Model/InstallmentsByBrandAndAmountManagement.php @@ -72,6 +72,7 @@ public function getInstallmentsByBrandAndAmount($brand = null, $amount = null) { $baseBrand = 'nobrand'; if ( + !empty($brand) && strlen($brand) > 0 && $brand !== "null" && method_exists(CardBrand::class, $brand) diff --git a/Model/InstallmentsByBrandManagement.php b/Model/InstallmentsByBrandManagement.php index 136cf27f..dbe459ad 100644 --- a/Model/InstallmentsByBrandManagement.php +++ b/Model/InstallmentsByBrandManagement.php @@ -60,6 +60,7 @@ public function getInstallmentsByBrand($brand = null) { $baseBrand = 'nobrand'; if ( + !empty($brand) && strlen($brand) > 0 && $brand !== "null" && method_exists(CardBrand::class, $brand) diff --git a/view/adminhtml/templates/info/billetCreditCard.phtml b/view/adminhtml/templates/info/billetCreditCard.phtml index 0ee20f0e..3ff30825 100644 --- a/view/adminhtml/templates/info/billetCreditCard.phtml +++ b/view/adminhtml/templates/info/billetCreditCard.phtml @@ -17,7 +17,10 @@ if (array_key_exists('billet', $lastTransactions)) {
    - : getCcAmountWithTax(), 2, ',', '.'); ?> + + : + getCcAmountWithTax()), 2, ',', '.'); ?> +
    : getCcBrand(); ?>
    @@ -63,9 +66,12 @@ if (array_key_exists('billet', $lastTransactions)) { getBilletUrl() && $this->getInfo()->getOrder()->getState() == 'new'): ?> - : getBilletAmount(), 2, ',', '.'); ?> + + : + getBilletAmount()), 2, ',', '.'); ?> +

    - \ No newline at end of file + diff --git a/view/frontend/templates/info/twoCreditCard.phtml b/view/frontend/templates/info/twoCreditCard.phtml index 09e00de7..155cb72e 100644 --- a/view/frontend/templates/info/twoCreditCard.phtml +++ b/view/frontend/templates/info/twoCreditCard.phtml @@ -15,12 +15,12 @@ : getCcTypeFirst()); ?>
    : getFirstCardLast4(); ?>
    : getInstallmentsFirstCard(); ?>
    - : getFirstCardAmount(),2,',','.'); ?> + : getFirstCardAmount()),2,',','.'); ?>

    : getCcTypeSecond()); ?>
    : getSecondCardLast4(); ?>
    : getInstallmentsSecondCard(); ?>
    - : getSecondCardAmount(),2,',','.'); ?> + : getSecondCardAmount()),2,',','.'); ?>

    From 8545af52d6db233e4dcf6510333bbd82010b4dc2 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:14:24 -0300 Subject: [PATCH 64/83] fix: release number version (#251) --- Setup/UpgradeSchema.php | 2 +- composer.json | 2 +- etc/module.xml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Setup/UpgradeSchema.php b/Setup/UpgradeSchema.php index 150c0636..53e51d0a 100644 --- a/Setup/UpgradeSchema.php +++ b/Setup/UpgradeSchema.php @@ -29,7 +29,7 @@ public function upgrade( $setup = $installSchema->installRecipients($setup); } - if (version_compare($version, '2.2.6', '<')) { + if (version_compare($version, '2.2.5', '<')) { $connection = $setup->getConnection(); $connection->addColumn( $setup->getTable('pagarme_module_core_recurrence_products_plan'), diff --git a/composer.json b/composer.json index 0462722b..6cbe0f5a 100755 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.6", + "version": "2.2.5", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", "require": { diff --git a/etc/module.xml b/etc/module.xml index 7c90bc43..8d4024ec 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -9,7 +9,7 @@ */ --> - + From e4d9fc3ac26d82a7e497a16e32a6b164cffbea7a Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Fri, 22 Sep 2023 14:15:01 -0300 Subject: [PATCH 65/83] Release/2.2.5 (#252) --- Concrete/Magento2PlatformOrderDecorator.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index 963f461d..13ff0123 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -660,7 +660,7 @@ public function getItemCollection() $item->setCode($quoteItem->getProductId()); } - $item->setQuantity($quoteItem->getQty()); + $item->setQuantity(intval($quoteItem->getQty())); $item->setDescription( $quoteItem->getName() . ' : ' . $quoteItem->getDescription() From ec3bb44eb6f309bfe031dbce132e79b9578da10d Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 26 Sep 2023 15:31:32 -0300 Subject: [PATCH 66/83] feat: adding subscriptions to sales menu and re-adding enabled gateway dependency to show recurrence settings (#253) --- etc/adminhtml/menu.xml | 8 ++++++-- etc/adminhtml/system/recurrence.xml | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/etc/adminhtml/menu.xml b/etc/adminhtml/menu.xml index 84d5daef..93b8525b 100644 --- a/etc/adminhtml/menu.xml +++ b/etc/adminhtml/menu.xml @@ -6,7 +6,7 @@ - + @@ -15,9 +15,13 @@ - + + + + + diff --git a/etc/adminhtml/system/recurrence.xml b/etc/adminhtml/system/recurrence.xml index fe8cf91b..c6ef5c2e 100644 --- a/etc/adminhtml/system/recurrence.xml +++ b/etc/adminhtml/system/recurrence.xml @@ -84,5 +84,8 @@ 1
    + + 1 +
    From e361339a9bfbc999f9e1b53c0461da18a4d7ba3b Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 28 Sep 2023 09:16:06 -0300 Subject: [PATCH 67/83] fix: change to only update installments for valid brands (#255) --- .../core/checkout/PaymentMethodController.js | 26 +++++++++++++------ .../js/core/checkout/PlatformFormHandler.js | 8 +++++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/view/frontend/web/js/core/checkout/PaymentMethodController.js b/view/frontend/web/js/core/checkout/PaymentMethodController.js index af24a3d0..04fcc195 100644 --- a/view/frontend/web/js/core/checkout/PaymentMethodController.js +++ b/view/frontend/web/js/core/checkout/PaymentMethodController.js @@ -32,6 +32,7 @@ define([ const fieldError = '.field-error'; const errorClass = '_error'; + const optionSelectedSelector = 'option:selected'; return class PaymentMethodController { constructor(methodCode, platformConfig) { this.methodCode = methodCode; @@ -502,7 +503,9 @@ define([ addSavedCreditCardsListener(formObject) { const paymentMethodController = this; - let brand = $('option:selected').attr('brand'); + let brand = formObject.savedCreditCardSelect + .find(optionSelectedSelector) + .attr('brand'); if (brand == undefined) { brand = formObject.creditCardBrand.val(); @@ -510,12 +513,15 @@ define([ formObject.creditCardBrand.val(brand); + const formHandler = new FormHandler(); + formHandler.init(formObject); + formObject.savedCreditCardSelect.on('change', function() { const value = $(this).val(); - const brand = $('option:selected').attr('brand'); + const currentSavedCardBrand = $(this).find(optionSelectedSelector).attr('brand'); - formObject.creditCardBrand.val(brand); + formHandler.switchBrand(currentSavedCardBrand); if (value === 'new') { $(formObject.containerSelector + ' .new').show(); @@ -525,7 +531,8 @@ define([ ) { formObject.multibuyer.showMultibuyer.parent().show(); } - return; + paymentMethodController.fillInstallments(formObject); + return } paymentMethodController.fillInstallments(formObject); @@ -653,8 +660,9 @@ define([ let selectedBrand = form.creditCardBrand.val(); let amount = form.inputAmount.val(); - if (typeof selectedBrand == "undefined") { - selectedBrand = 'default'; + if (!selectedBrand || selectedBrand === 'default') { + formHandler.updateInstallmentSelect([], form.creditCardInstallments); + return } if (typeof amount == "undefined") { @@ -744,7 +752,7 @@ define([ parentsElementsError.hide(); return false; } - + validateBrandField(formObject) { const element = formObject.creditCardBrand; const requiredElement = element.parent().parent(); @@ -841,7 +849,9 @@ define([ if (typeof formObject.savedCreditCardSelect[0] != 'undefined') { - let brand = $('option:selected').attr('brand'); + let brand = formObject.savedCreditCardSelect + .find(optionSelectedSelector) + .attr('brand'); if (brand == undefined) { brand = formObject.creditCardBrand.val(); diff --git a/view/frontend/web/js/core/checkout/PlatformFormHandler.js b/view/frontend/web/js/core/checkout/PlatformFormHandler.js index 91273cfa..df4c8da1 100644 --- a/view/frontend/web/js/core/checkout/PlatformFormHandler.js +++ b/view/frontend/web/js/core/checkout/PlatformFormHandler.js @@ -133,6 +133,7 @@ define(['jquery'], ($) => { fillSavedCreditCardsSelect = function (platformConfig, formObject) { let html = ''; const cards = platformConfig.savedAllCards[formObject.savedCardSelectUsed] + let firstOptionValue = null; const brands = []; platformConfig.avaliableBrands[formObject.savedCardSelectUsed].forEach(function (item) { @@ -151,11 +152,15 @@ define(['jquery'], ($) => { continue; } + if (!firstOptionValue) { + firstOptionValue = cards[i].id; + } + html += ""; $(formObject.savedCreditCardSelect).html(html); + $(formObject.savedCreditCardSelect).val(firstOptionValue); } } fillMultibuyerStateSelect(platformConfig, formObject) { From 1b5ed96170afbc7ad24fd668b23f5f763fff7be5 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Thu, 28 Sep 2023 10:33:35 -0300 Subject: [PATCH 68/83] fix: receive only magento webhooks (#254) --- Model/WebhookManagement.php | 66 ++++++++++++++++++++++++++++++++----- 1 file changed, 58 insertions(+), 8 deletions(-) diff --git a/Model/WebhookManagement.php b/Model/WebhookManagement.php index 936e03ca..b2f8b670 100644 --- a/Model/WebhookManagement.php +++ b/Model/WebhookManagement.php @@ -2,17 +2,11 @@ namespace Pagarme\Pagarme\Model; -use Magento\Framework\DB\Transaction; use Magento\Framework\Phrase; use Magento\Framework\Webapi\Exception as M2WebApiException; -use Magento\Sales\Api\OrderRepositoryInterface; -use Magento\Sales\Model\Order; -use Magento\Sales\Model\Order\CreditmemoFactory; -use Magento\Sales\Model\Order\Email\Sender\InvoiceSender; -use Magento\Sales\Model\Service\CreditmemoService; -use Magento\Sales\Model\Service\InvoiceService; -use Magento\Sales\Model\Service\OrderService; +use Magento\Sales\Model\OrderFactory; use Pagarme\Core\Kernel\Exceptions\AbstractPagarmeCoreException; +use Pagarme\Core\Kernel\Services\LogService; use Pagarme\Core\Webhook\Exceptions\WebhookAlreadyHandledException; use Pagarme\Core\Webhook\Exceptions\WebhookHandlerNotFoundException; use Pagarme\Core\Webhook\Services\WebhookReceiverService; @@ -21,6 +15,14 @@ class WebhookManagement implements WebhookManagementInterface { + + protected OrderFactory $orderFactory; + + public function __construct( + OrderFactory $orderFactory + ) { + $this->orderFactory = $orderFactory; + } /** * @api * @param mixed $id @@ -38,6 +40,14 @@ public function save($id, $type, $data) $postData->type = $type; $postData->data = $data; + if($this->hasMagentoOrder($data) === false) { + $this->logWebhookIdCaseExistsMetadata($data, $id); + return [ + "message" => "Webhook Received", + "code" => 200 + ]; + } + $webhookReceiverService = new WebhookReceiverService(); return $webhookReceiverService->handle($postData); } catch (WebhookHandlerNotFoundException $e) { @@ -58,4 +68,44 @@ public function save($id, $type, $data) ); } } + private function logWebhookIdCaseExistsMetadata($webhookData, $webhookId) + { + $metadata = $this->getMetadata($webhookData); + if($metadata === false || !array_key_exists('platformVersion', $metadata)) { + return; + } + if(strpos($metadata['platformVersion'], "Magento") !== false) { + $logService = new LogService( + 'Webhook', + true + ); + $logService->info( + "Webhook Received but not proccessed", + (object)['webhookId' => $webhookId + ]); + } + } + private function getMetadata($data) + { + $metadata = false; + if(!array_key_exists('order', $data) && !array_key_exists('subscription', $data)) { + return false; + } + if(array_key_exists('metadata', $data)) { + $metadata = $data['metadata']; + } + return $metadata; + } + private function hasMagentoOrder($data) + { + $code = 0; + if(array_key_exists('subscription', $data)) { + $code = $data['subscription']['code']; + } + if(array_key_exists('order', $data)) { + $code = $data['order']['code']; + } + $order = $this->orderFactory->create()->loadByIncrementId($code); + return $order->getId() ?? false; + } } From abf930889a97ecbd3ae35eb23b4bb5fb2b413153 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 3 Oct 2023 17:41:30 -0300 Subject: [PATCH 69/83] fix: adding due_at, bank and instructions information to be send to createOrder for billet payment method (#256) --- Concrete/Magento2PlatformOrderDecorator.php | 13 +++++++++++++ etc/adminhtml/system/transaction/billet.xml | 1 + 2 files changed, 14 insertions(+) diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index 13ff0123..47e884c1 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -1140,6 +1140,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/etc/adminhtml/system/transaction/billet.xml b/etc/adminhtml/system/transaction/billet.xml index d82eb5f3..dea9861b 100644 --- a/etc/adminhtml/system/transaction/billet.xml +++ b/etc/adminhtml/system/transaction/billet.xml @@ -36,6 +36,7 @@ 1 1 + required-entry From dab13d1e722b6d35d1cc0c599bf0a30b3bd4c93c Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 4 Oct 2023 11:33:13 -0300 Subject: [PATCH 70/83] Revert "fix: adding due_at, bank and instructions information to be send to createOrder for billet payment method" (#257) This reverts commit abf930889a97ecbd3ae35eb23b4bb5fb2b413153. --- Concrete/Magento2PlatformOrderDecorator.php | 13 ------------- etc/adminhtml/system/transaction/billet.xml | 1 - 2 files changed, 14 deletions(-) diff --git a/Concrete/Magento2PlatformOrderDecorator.php b/Concrete/Magento2PlatformOrderDecorator.php index 47e884c1..13ff0123 100644 --- a/Concrete/Magento2PlatformOrderDecorator.php +++ b/Concrete/Magento2PlatformOrderDecorator.php @@ -1140,19 +1140,6 @@ 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/etc/adminhtml/system/transaction/billet.xml b/etc/adminhtml/system/transaction/billet.xml index dea9861b..d82eb5f3 100644 --- a/etc/adminhtml/system/transaction/billet.xml +++ b/etc/adminhtml/system/transaction/billet.xml @@ -36,7 +36,6 @@ 1 1 - required-entry From 48a201f899a3332f4fb792c12749e1997f352ed6 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 4 Oct 2023 15:22:46 -0300 Subject: [PATCH 71/83] build: changing module core version (#258) --- composer.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index 6cbe0f5a..338db8fd 100755 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "description": "Magento 2 Module Pagar.me", "require": { "php": ">=7.1", - "pagarme/ecommerce-module-core": "dev-develop" + "pagarme/ecommerce-module-core": "2.2.*" }, "require-dev": { "phpunit/phpunit": "4.1.0", @@ -41,6 +41,5 @@ }, "config":{ "secure-http":false - }, - "minimum-stability": "dev" + } } From d305e57a3c726ed287407f8f03eff6df594397c5 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Wed, 11 Oct 2023 14:50:40 -0300 Subject: [PATCH 72/83] fix: adding due_at, bank and instructions information to be send to createOrder for billet payment method (#260) --- Concrete/Magento2PlatformOrderDecorator.php | 14 ++++++++++++++ etc/adminhtml/system/transaction/billet.xml | 1 + 2 files changed, 15 insertions(+) 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/etc/adminhtml/system/transaction/billet.xml b/etc/adminhtml/system/transaction/billet.xml index d82eb5f3..dea9861b 100644 --- a/etc/adminhtml/system/transaction/billet.xml +++ b/etc/adminhtml/system/transaction/billet.xml @@ -36,6 +36,7 @@ 1 1 + required-entry From 56d69799b0380a9fb89da3c6b7b9e1c4f6c9e802 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:38:12 -0300 Subject: [PATCH 73/83] chore: add develop tag to module core (#261) --- composer.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 338db8fd..f2c3bfde 100755 --- a/composer.json +++ b/composer.json @@ -4,9 +4,10 @@ "version": "2.2.5", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", + "minimum-stability": "dev", "require": { "php": ">=7.1", - "pagarme/ecommerce-module-core": "2.2.*" + "pagarme/ecommerce-module-core": "dev-develop" }, "require-dev": { "phpunit/phpunit": "4.1.0", From 68d604865cac9a9391c8e51123a92e30ffab3c1f Mon Sep 17 00:00:00 2001 From: Mateus Picoloto Date: Mon, 16 Oct 2023 13:48:39 -0300 Subject: [PATCH 74/83] fix: db_schema credit_card, installments and boleto types --- etc/db_schema.xml | 6 +++--- etc/db_schema_whitelist.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) 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/db_schema_whitelist.json b/etc/db_schema_whitelist.json index a4eeac8a..c0e83dc7 100644 --- a/etc/db_schema_whitelist.json +++ b/etc/db_schema_whitelist.json @@ -80,4 +80,4 @@ "PRIMARY": true } } -} +} \ No newline at end of file From 3acfe4455fdce1b71d8c5f64fa7cff9fca5aa39f Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:22:49 -0300 Subject: [PATCH 75/83] Release 2.2.5 (#259) (#263) From 4f28476865dcdad693ef129de33c71dd1d0db4eb Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:45:23 -0300 Subject: [PATCH 76/83] fix: db_schema credit_card, installments and boleto types (#264) --- etc/db_schema.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 @@ - - - + + + From 81dcff671747c9787c5482fefb6aa58c947e81aa Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Thu, 19 Oct 2023 18:16:36 -0300 Subject: [PATCH 77/83] fix: elo brand image --- view/frontend/web/js/core/checkout/PlatformConfig.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 }; } From 2ef344023ff31ff74d80e6381aa5eaa63fab1c6e Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 26 Oct 2023 12:18:16 -0300 Subject: [PATCH 78/83] fix: removing property type for old php versions (#267) * fix: removing property type for old php versions * fix: code smell * fix: total amount with coupons --------- Co-authored-by: RafaMelazzo --- Model/WebhookManagement.php | 5 ++++- .../core/checkout/PaymentMethodController.js | 21 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/Model/WebhookManagement.php b/Model/WebhookManagement.php index b2f8b670..0c4d0609 100644 --- a/Model/WebhookManagement.php +++ b/Model/WebhookManagement.php @@ -16,7 +16,10 @@ class WebhookManagement implements WebhookManagementInterface { - protected OrderFactory $orderFactory; + /** + * @var OrderFactory + */ + protected $orderFactory; public function __construct( OrderFactory $orderFactory 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) { From 5e62117ee106104cb5080033b16a656f2072e67c Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 1 Nov 2023 16:51:06 -0300 Subject: [PATCH 79/83] feat: dash validation (#268) * added AccountService and CoreAuth * add temporary menu for tests * create HubAccount Class * add accountId in Concrete/Magento2CoreSetup * get accountId from Webhook * improving notifications * feat: adding dash account settings validation when access payment admin page * feat: adding debit dash validation * feat: adding debit dash validation * feat: add Dash validation messages * feat: dash settings validation translations * feat: added button to clear Dash validation messages * refactor: moving account validation to ecommerce module core (#265) * feat: gateway/psp/simulator config validator * fix: code smells * fix: code smells * fix: missing comment docs * fix: adding observer name * fix: integration button names * fix: adding back counter for softdescriptor --------- Co-authored-by: RafaMelazzo Co-authored-by: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Co-authored-by: mauriciohaygert --- Api/WebhookManagementInterface.php | 3 +- .../Form/Field/CreditCardPspField.php | 47 +++ .../Form/Field/EnableAdvanceSettings.php | 26 ++ Block/Adminhtml/Form/Field/GatewayField.php | 55 +++ .../Form/Field/InstallmentsNumber.php | 58 +++ Block/Adminhtml/Form/Field/SoftDescriptor.php | 64 +++ .../Fieldset/CreditCardGatewayFieldset.php | 53 +++ .../Form/Fieldset/CustomPaymentFieldset.php | 60 +++ .../Config/Form/Field/HubIntegration.php | 75 +++- Concrete/Magento2CoreSetup.php | 5 +- Controller/Adminhtml/Hub/Index.php | 27 ++ Gateway/Transaction/Base/Config/Config.php | 19 +- .../Base/Config/ConfigInterface.php | 49 ++- Model/Account.php | 381 ++++++++++++++++++ Model/Api/HubCommand.php | 17 + Model/CoreAuth.php | 17 + Model/Notifications.php | 235 ++++++++++- Model/PagarmeConfigProvider.php | 197 +++++++-- Model/Source/PixTypes.php | 26 -- Model/WebhookManagement.php | 24 +- Observer/DashConfigValidatorObserver.php | 54 +++ Observer/DataValidateAdmin.php | 42 +- Service/AccountService.php | 93 +++++ etc/adminhtml/di.xml | 38 ++ etc/adminhtml/system/global.xml | 2 + etc/adminhtml/system/recurrence.xml | 3 - etc/adminhtml/system/transaction/billet.xml | 8 +- .../system/transaction/creditcard.xml | 22 +- .../transaction/creditcard/antifraud.xml | 3 +- .../transaction/creditcard/installments.xml | 7 +- .../creditcard/installments/amex.xml | 4 +- .../creditcard/installments/aura.xml | 4 +- .../creditcard/installments/banese.xml | 2 + .../creditcard/installments/cabal.xml | 2 + .../creditcard/installments/credz.xml | 2 + .../creditcard/installments/diners.xml | 4 +- .../creditcard/installments/discover.xml | 4 +- .../creditcard/installments/elo.xml | 4 +- .../creditcard/installments/hipercard.xml | 4 +- .../creditcard/installments/jcb.xml | 4 +- .../creditcard/installments/mastercard.xml | 4 +- .../creditcard/installments/visa.xml | 4 +- etc/adminhtml/system/transaction/debit.xml | 24 +- .../multipleactionscreditcardbillet.xml | 6 + .../multipleactionstwocreditcard.xml | 6 + etc/adminhtml/system/transaction/pix.xml | 16 +- etc/adminhtml/system/transaction/voucher.xml | 24 +- etc/events.xml | 4 + i18n/en_US.csv | 337 ---------------- i18n/pt_BR.csv | 17 +- .../layout/adminhtml_system_config_edit.xml | 3 +- view/adminhtml/layout/default.xml | 3 +- view/adminhtml/web/css/hub_button.css | 32 -- .../adminhtml/web/css/integration_buttons.css | 48 +++ view/adminhtml/web/css/menu.css | 2 +- view/adminhtml/web/css/warnings.css | 22 + .../web/images/avatar-pagarme-white.svg | 6 + view/adminhtml/web/images/avatar-pagarme.svg | 13 +- view/adminhtml/web/js/hubIntegration.js | 47 --- view/adminhtml/web/js/integrationType.js | 96 +++-- 60 files changed, 1789 insertions(+), 669 deletions(-) create mode 100644 Block/Adminhtml/Form/Field/CreditCardPspField.php create mode 100644 Block/Adminhtml/Form/Field/EnableAdvanceSettings.php create mode 100644 Block/Adminhtml/Form/Field/GatewayField.php create mode 100644 Block/Adminhtml/Form/Field/InstallmentsNumber.php create mode 100644 Block/Adminhtml/Form/Field/SoftDescriptor.php create mode 100644 Block/Adminhtml/Form/Fieldset/CreditCardGatewayFieldset.php create mode 100644 Block/Adminhtml/Form/Fieldset/CustomPaymentFieldset.php create mode 100644 Model/Account.php create mode 100644 Model/CoreAuth.php delete mode 100644 Model/Source/PixTypes.php create mode 100644 Observer/DashConfigValidatorObserver.php create mode 100644 Service/AccountService.php delete mode 100644 view/adminhtml/web/css/hub_button.css create mode 100644 view/adminhtml/web/css/integration_buttons.css create mode 100644 view/adminhtml/web/css/warnings.css create mode 100644 view/adminhtml/web/images/avatar-pagarme-white.svg delete mode 100644 view/adminhtml/web/js/hubIntegration.js 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/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..76e8f499 --- /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..d9cb8012 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,20 @@ 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->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 0c4d0609..a1edf9cb 100644 --- a/Model/WebhookManagement.php +++ b/Model/WebhookManagement.php @@ -12,6 +12,7 @@ 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 { @@ -21,19 +22,27 @@ class WebhookManagement implements WebhookManagementInterface */ 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(); @@ -51,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/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 dea9861b..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,9 +35,9 @@ Pagarme\Pagarme\Model\Source\BilletTypes payment/pagarme_billet/types + Pagarme\Pagarme\Block\Adminhtml\Form\Field\BilletGatewayField 1 - 1 required-entry @@ -59,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/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/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..d2faaa69 --- /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; +} + +#pagarme-dash-button { + background-color: #e3e3e3; + border-color: #adadad; + color: #514943; + margin-left: 2rem; + 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+5sl4DECLunZiMC2TAZheSy84W74tzxLGSn85AlabxgxS4lPxilj6GkElO9bo33ynuXuuTf06DWSQihRwKqaGZyJWAjfopsVJDPYUUU0o5lVRTSz2HHHPKOZcs8OsllFhSyaWUWlrpNdRYU8211Gpqq735FgDH1HIrrbbWeuemnZE73+5c0PvwI4w40sijjDra6JPymXGmmWeZ1cw2+/IrLHBi5VVWXW317TaltONOO++y6267H0rthBNPOvmUU087/T1rzjxp/fLz17Pm3rLmb6Z0YXnPGl8t5W0IJzhJyhkZ89GR8aIMUNBeObPVxeiNUqec2ebpiuSZZVJyllPGyGDczqfj3nP3I3M/5c3E+H/lzb9lzih1/0TmjFL3i8x9zds3WVtim2mDuRlSGyqoNtB+XLBr97WL1L4/nrF9B7AsYepRMJxMhDFHrPw+7YmilOVbJSUl9rrO3q4PwryJxuqdicSyEynwwrS1mCGBGimaCQMeFnxaCmH2epjTLq2fnZLd3uWwbep+7EXp1OgKQKZrou+7Fr2r/vB1cypRnGvbcmzLxOCIbceubRWWCNZyNQ2f16p+l5kGsmMV0GHbfez0acfax0ZELA9mz2L9zN4t7jJC2i4cV0fcwy0mSgoa5H2ohJMbwwIZre61faorjtKaN3ZuaRVezuwj1AWYNOqxkvhScpgn3wgvgtlvsO23R/OrD745hn16b7aoS1asgZFRCel+2gzvXEzSIInkPO/aiIUitzM4qtSPw3xaTB7lwzxXyMunZseYlC/Ft3c424Q0J8VdthulxjEJ5XFr7T56pNo8vVNjpPJyI6/0fQt1akjG7nse1+ijGTuV7TnTqA2KoSayXdKpcxyr/E1/tovH1tSpZxKcy2p55zgOF1O5y1EZiVwZ79Azc9KKyVFL9CLZ7WsHvh6YxabsxLYgQ2h7b1+zHzXxN4/Ml/KaLrViTYFyXSUaJLOladM8mjDYgYok1YXA5skle1AGe2ieae629hyJ+CunY61jJmRtU5mB8KJvT4oLJcFHiban1WPLhbgRVd8BFhjbgmkVxebHpE/o+DiyjYZmUqroh+n/0Kq/aeHeze1hIuTtFu5Z99QfMuuOb38+SuuO14kQ66y9EnpCkM1azVFWcYd+Vu4zWdboc6f5PC1gj90qhgYKrFTiqT5Wl/OgC1q3EeikwwIigipFIYeZ4yrVlzNprVKHGhZZyoml8LanzxegF/20LfkAqNjjm84PStbwQT1+U2OpcjswdQN/BG4U5YHLuvqfoxhBR0AD9Oynz06RLAbYeXqj+vZ759UT+M68JmshZIirWTf3FNwtCx38vhPNX2jRODs4oAYtasVN24Uvl5tft7wIhDd+5JWB3CaY2dHTXaUGGtaVsEM9SB7Q7hjVYG2ZT+luuAm82zNfZpMzQBzZgcCpW+ThKVOAb6+TeluVcMV98sz7RLMGHEUPjtT2oibI36m51Amp7Wgh5V6amBhQ6P2ktc/MF9nBl9Rv+BGsYPZyzi1oP8Xva/A3x3KHUbfvYwaVscB0FUpbAAggVfNY5dKAzSEI/OlAccimb6GknXMjbioF6YpbHBQkcDRgCzp9j4SmO8VS41DgU4QMoWAeuAymZrjwVp69J7dDg2fIpNmewScFPCOi41BpHVFBfTL0Wh70kBR5QK6k7e88OqwJ3hyke7zAMpMhO6DhJJ0iF5Gg0HCNtAXAoFcbpZxQwBJYihrtC9GBXqgwTZh4kzaWS9Mw/KTQOqQXHAIiFcuLraJdeFVEugsr7W5NhTOuQBtlRNCajXeqtgWUmz/WY4sseBBHQgwb0Hgb+mflZ1CKN1o95GRoPtQQ0I8uo0kJDrzvKDWqC5UD+BPOhIVBz4zRUHPMMSIWMGWO2cYGcLBGw+9ngsf5UNsuLIZg4v0UsGBBUtQZuoQ0rzZPL+Q2u1yQ9N3WCpsURqwLpuX73tETNCOOvcABiZ6nyFoJ9IxE6V0tUPjb+jTffQDpE8vUz4giUriwRDVtHXRjQTv6PFPW3YWciKllqaPFr4Jw3pTtgcnNB4nMjRk8eQ6HuasQES9PtQOzwuCD6yTkzReK/IBHNC+VjQ5gBWl4S0KgSdg60UKoRw8UhsFcfTy5E4oBgAKzMD/1bhVE9dqcEvEFkoOFAZu0uBp9tBfmT2GHohNViZrKyP6OAXY5iix8QS2nOjcBLHA/YISsa2t0tG31UtNkIVFuxeXkAGaxBImqboJRSfSIr219wZlJwsE3u6WPlJEvpIc0BX3CGlIz4FNEQueA2B7gfcZqrIeyEKAIPX4xihDeG6WB0x7AMR1pQxko0jlw3TRMtapsB9/n0pFwYbp8BvULKCYKSdUD+G9aaQ/VPLqxlr5QO9B+pPYQGKTdoZw9zshlUhs5oj8od1qYzkdGT+tgIIwfSihc6SCxfxD6tWAE8AusBCnTKK5NVZK4XgXIEOcuDzmN6OpL8JkPyu9vHgtQQ4E5sTNMC86Xw2pt6/PgCBrks7KvCRShT5InlVZRoNEcwEYU0VccsiYEfgJwIMU0BUXnBdfMGrE9aIW+yPuElxBnZBzI3RJPHYXvRTIdnlknpgYyU21Qf8Wuw/XoDAnDhF8fopM8sR0zZslaKVqowSU0Y0HKrQ6Arq5Mno4WTKuquhoD2YV8dYjRJIE0imMJ9BpKfwIR8EKmFFsHdaVDwTDgJqCEMjU7HXlFLEO4SL+UwGy7gkRcQ0WDHZSYQooL+oyc3jcUtrbcIENIC4eDk5ohmdLA/GOp00R02xw2FiwLUwQnWkNkuwFe5CA1FxifVtxzIlEEfgJsFKybx4Cum/KDtUFchBO+89iIF29UWQsYrjoPWMAVrApFdjwZ8BMfi1ltIG8mmCGYKlpEHkkikAztnGwGuq4bShVQXmLejVouBBYO3RElHt1r3U9VmltdKJS4FwToKSFl8cSxwsbFEmQU2XKkkdYUbxB5VKNTSFkRmV8X7oxigEtGila48rJnmQ97oglARkTn/a1x4WV5RoMwSH6W/kOAMVpuJmSLWNQ3AdVHhCYpqwuq6TwU7cJzxTWduiK9iYy0XlfgjpAP8Cw6igT07oIUxRvbW7wI6NwdiPbMNq7XbKWAvYXn9/3ciPp/Xo5cCuS/j2Nou64wq4lvue1zXQA4aAO1JwAlhtTQlvUB/5IHyhMxjgMJOTu7zoLZE6A/cXdgvjYI6VjkuXaS4T0s+AGgRCveiQS2sXet0Cb8AL7hruCvTclg9VDGkA5ZSkhs8A5kR/zjBKgiP8Zwm2wLVkpq5it/Il4QOnTUIA6ExNLTEdeG/Gya5SqUtvNl4CzxbsNZTdSc10y39mky3qr5PtQgAvcCnfAxKYJ5tU2D/B1IW0BqwzA4IBgkAfnNmlA81GSB9lmlJrhP5kLUI4YSBBmLSnoyVRnxvsPPNSKCsCNUUU5jD0Nz+aZtIxgdW0oN4fpQZ7R2wCDbl9tvbxg7ree3SX8MPWLAAR2wnYJ0A1FPdWbL/I4bnbqRcamsVzkB/xDgdzdkSm3RYGdkuDldo0OqbzlnLMToV3Q74PcwJe4PgN/7F6KN2gCuchWyCEY6mjEKYfGoUfs4CzsHtBk/JxRqY8PQIb86YSLm/MoacYDQHbqurOAIlUqX4NzSRfj1eLsQpvZ9GxodZoulChyCd4Vlox78AAJXAw0wBswrgylzFVEnBoIXlNtc+b5bUE8ylu4uue7V7d15yWp0PTTSvsvNf4KLpqBx1FM89lBixyVaf2lzAScZ5NcwT9j/sDwF9Eab811LZKo9AR+UFwqp3Z2tlqrtYCc9yXmExt24MMfHHtS4Iz/GM8gmR6QqvrXd3QngLmoriQMdJAbFWu0l27nIM6SJKDOFssKV5YjskZAHsZmiw3Ep0BggKA26w+wwAVKIo0BljYN44tcJNmucFYz2d2EIJEJtCeXMuHg94JVX8Q1pSlL5r5786EE3FtDCFbMRQyzEYZYq+Bi1NwK83omABhNGdtrqpBkRnayctoodY60LyT9VSdDBJQrdxC676ADy6lEVVDSaDuLX5hOyaPJVjPizMTneRYy9+wwXLaSIAGgTIZyie92SP9ADvgjR3vCgfbBEgIOoJTmHUAHEBqIJ0DAWoPw+zH37GQ1yfMGEcCRCFd/sUMADa+RCT8Bo2xatAijM0HKmYhcakYKCFpqUHmPJAiOPFa1lwd7bceOqZvUu0m058a+gSFAJCms/qeskBWxRLFGiHBjThpkBeQJyYyMfqJNckPXgIHdG0DqiiFZFZqE6hYO06im9VRyjB8Z0gHlozOHN12r+cmx9dwdZEKN+N7ikpjN2FNWJzuGwwOwEigGbQ54WvKAVKpTD3fieR8UCxygP7cDSWJLKcuFijBaEktqQxeo2gk1O6BuAurQ4ECbcqRC0Qkk8W131x1ZXlxfvJHjX0HsEGqUtKLHSpLMPZUwSEXHSwzNYhLHT/lBdEhisa2Pu0UI74LpQkQVmJaaiw7sWbp7NcZiug3SPGQJs6AzXbNMmBogwtK+pIp16foFqpwpuvWWXaDpSjG0/yE8/DBbdArC/CHjEK0jB9r7utmtiIXBd5Es0IhJR1dRg5mQy1RscVt5eMY/p1UZilEGhWx4E968dvP6hRT4fzacTEgkobWTooC0ZULu/hUpE3u3wbGXQpdDtQSuL2DmD/AfY9BHtwiIori09jiGFTGgafHnWow4cIUPinhcCDXuvUnBeEgkLdQf33vT7BiEDW5SK1wXw5TL7xNL2vQRVGCxXZf3w41WuaCeqbaalZiRO8MwyaDEnExQbqEcBPPqSu6X3zbbyJI37Ah43ba+kiQ1v2oBd4+5mDDYTLeXUyRMjFbQprep1KQ/sN74drHp2ryzJWt6h+Z8t1Je2NR+2Q2QXIbjetGOIkuATzHvTpp8OH9j/m640v9vNpRYDsHCt5dbmCiYdODra/ny4HwLqemTSDw4yvAmC9NK3isBLD2iz39LBjyL50XVrau8abYfMc3fJZsiqSRTfLQwSMOiku+WI5bFXCEIWSPOrsHv6cS2qh1CP5ieyEKYVioUlXNH254oMo902PXND1N/7l6337p6eCqdbd8s9tnuqoQoHFmLa9HraQay7nnY4PSz4tJg/He8GQpMRk4n4Q7yomHQaonqdLJm4gz967nhQFxi/GJ/6SH7fKo+ZHkNIFj2f6F8I7RdH8+mEOzhB7kdWcyMeB+wMCmyhhIOeHGZFYaZIAIuzR/KSap4G7vgbzw0o1ZCcqBd5gtmNHv0tlO5mSfHgmMKO6QGJWbb0MMWnGmzzPtRnoa3wBbwzQLcmJmjRTJJgEw0foiHEtCViBHU5rR4ZxPs0kCnM+o0E+dXRfN5Wf6CqwqVoEm1/hWsHh7YUL+CsLnvpT8Lak0dQQ/twixhBOICajSK0HPVoG5NiZZ1JG7pBu7X4EZRtQhlg/TC9DVc/9ZRiVdQxpjgZljugECdupEz0QLBIlV4ykYaTvKQWCCV8jiTCVkdKBHVpdx4oAQfsRrJWBpxQpBLXaCfsKWm4E5FMg8qC36M2GKA3i+WHr3fE3nBbck6QZ77P8Khsq2fG30cx6H8G6bl61Q4dPedlXBDaNPRE+2hnCuKMcpmm3k0oz2DoF239NTi063GL29rmk5Xq0LO2ZJE6fjANsF9PxfO44J/yAyMnuccn48GQrhl9BBRIaCHKgvblCYJ2g7X7Q6ZGkkBFp5dMVsMaTy6Nho8oV0gQY7n+50dk5vOzMtCckUHuoA2vAmvgzCE62HJJ+emJxwmD8wFvS7hGa4q7wQy8P/a4+9asmXZMaYTS8KnEj1FkpcEpOI+uQGno/0Fp07c5WshNdIApeCHqs+vJI83myeKtYNyMvx77biMxOI43LGUioCOafGMBB3yx6KizgwF68JwegUx/UQ9Du4+Klb/4GtOCZxM9W4XeCEa9ot16Rk36jdHjG7CY2SVOPapMoaKOhEfgBBJOrlv/4WAVegwwh+cGFZUZQo5Jm0spU0wbcMbHL9OmnxvzAUCEjvZC+WhneEao3pZKKUBiE0Q9VbtGmAhKMDBhSNMi1VwBiQf6SA+KsZsgD53iHtJpkhj4S0inLRD9ICopDtoIjX+cti716B8guNanosU7dh3tgwtbtHocsxJPuCPf/7jnwDW05NjpagvqXP9BK+XXU4D5cRfD/L3HV6Sx0Q7/BWJwooL1dRH5AAABhWlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV9TiyKVInYQcchQHcSCqIijVLEIFkpboVUHk0u/oElDkuLiKLgWHPxYrDq4OOvq4CoIgh8gbm5Oii5S4v+SQosYD4778e7e4+4dIDQqTDW7JgBVs4xUPCZmc6ti9ysCCCOEfoxJzNQT6cUMPMfXPXx8vYvyLO9zf44+JW8ywCcSzzHdsIg3iGc2LZ3zPnGYlSSF+Jx43KALEj9yXXb5jXPRYYFnho1Map44TCwWO1juYFYyVOJp4oiiapQvZF1WOG9xVis11ronf2Ewr62kuU5zGHEsIYEkRMiooYwKLERp1UgxkaL9mId/yPEnySWTqwxGjgVUoUJy/OB/8LtbszA16SYFY0DgxbY/RoDuXaBZt+3vY9tungD+Z+BKa/urDWD2k/R6W4scAaFt4OK6rcl7wOUOMPikS4bkSH6aQqEAvJ/RN+WAgVugd83trbWP0wcgQ10t3wAHh8BokbLXPd7d09nbv2da/f0AhAxyrtE/1ZMAAA0YaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA0LjQuMC1FeGl2MiI+CiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiCiAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICB4bWxuczpHSU1QPSJodHRwOi8vd3d3LmdpbXAub3JnL3htcC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgeG1wTU06RG9jdW1lbnRJRD0iZ2ltcDpkb2NpZDpnaW1wOjE3YWFmOTUyLWNiMTYtNDc5Mi1hMmU1LWZkZGRmODY1ZWFmZCIKICAgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpiZGE4ODI3My0wNzllLTQ2NTAtYjAyYS0wOTRlZTkwOWQzOTciCiAgIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDphNGVlM2VhMi02NzM5LTQwODYtYWY4ZS00NjgyNmU3ZmNiNTgiCiAgIGRjOkZvcm1hdD0iaW1hZ2UvcG5nIgogICBHSU1QOkFQST0iMi4wIgogICBHSU1QOlBsYXRmb3JtPSJXaW5kb3dzIgogICBHSU1QOlRpbWVTdGFtcD0iMTYyMTUyMzk4MDE2MTIxMCIKICAgR0lNUDpWZXJzaW9uPSIyLjEwLjI0IgogICB0aWZmOk9yaWVudGF0aW9uPSIxIgogICB4bXA6Q3JlYXRvclRvb2w9IkdJTVAgMi4xMCI+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+Ewb+Gb3E+vO0v/xeiN5K3Cd4v4MLllcf4jOBoH/OhM6bxCsnuNBx7Lw2XkOor8EIyHdxsh9mZT5n5f2d+8X5T0kJ+TlvOPFzMPP78dvzLn06/xrQ3BB/uHOY73f+6fwJzn9eztu/c1Y15+xndT1mQppfi3pbyn3HhYOQh/u1zE/hX+J9uT+Nn2qo3knKl5128DNdc560HBfdct0dt+9xuskUo9++cPR+kiidq6H45mewhgxF/bjjC7laoZK3SXoDZ/37XNy9b7u3m65y4+W40jsGU6a90cs/8fPLgc5RyTtn63usmJdXwJmGMqdXriIh7rzVUboBfvv5/Ed5DWQw3TBXFtjteIYYyb1qS3UUbqIDFyaOT6+5sl4DECLunZiMC2TAZheSy84W74tzxLGSn85AlabxgxS4lPxilj6GkElO9bo33ynuXuuTf06DWSQihRwKqaGZyJWAjfopsVJDPYUUU0o5lVRTSz2HHHPKOZcs8OsllFhSyaWUWlrpNdRYU8211Gpqq735FgDH1HIrrbbWeuemnZE73+5c0PvwI4w40sijjDra6JPymXGmmWeZ1cw2+/IrLHBi5VVWXW317TaltONOO++y6267H0rthBNPOvmUU087/T1rzjxp/fLz17Pm3rLmb6Z0YXnPGl8t5W0IJzhJyhkZ89GR8aIMUNBeObPVxeiNUqec2ebpiuSZZVJyllPGyGDczqfj3nP3I3M/5c3E+H/lzb9lzih1/0TmjFL3i8x9zds3WVtim2mDuRlSGyqoNtB+XLBr97WL1L4/nrF9B7AsYepRMJxMhDFHrPw+7YmilOVbJSUl9rrO3q4PwryJxuqdicSyEynwwrS1mCGBGimaCQMeFnxaCmH2epjTLq2fnZLd3uWwbep+7EXp1OgKQKZrou+7Fr2r/vB1cypRnGvbcmzLxOCIbceubRWWCNZyNQ2f16p+l5kGsmMV0GHbfez0acfax0ZELA9mz2L9zN4t7jJC2i4cV0fcwy0mSgoa5H2ohJMbwwIZre61faorjtKaN3ZuaRVezuwj1AWYNOqxkvhScpgn3wgvgtlvsO23R/OrD745hn16b7aoS1asgZFRCel+2gzvXEzSIInkPO/aiIUitzM4qtSPw3xaTB7lwzxXyMunZseYlC/Ft3c424Q0J8VdthulxjEJ5XFr7T56pNo8vVNjpPJyI6/0fQt1akjG7nse1+ijGTuV7TnTqA2KoSayXdKpcxyr/E1/tovH1tSpZxKcy2p55zgOF1O5y1EZiVwZ79Azc9KKyVFL9CLZ7WsHvh6YxabsxLYgQ2h7b1+zHzXxN4/Ml/KaLrViTYFyXSUaJLOladM8mjDYgYok1YXA5skle1AGe2ieae629hyJ+CunY61jJmRtU5mB8KJvT4oLJcFHiban1WPLhbgRVd8BFhjbgmkVxebHpE/o+DiyjYZmUqroh+n/0Kq/aeHeze1hIuTtFu5Z99QfMuuOb38+SuuO14kQ66y9EnpCkM1azVFWcYd+Vu4zWdboc6f5PC1gj90qhgYKrFTiqT5Wl/OgC1q3EeikwwIigipFIYeZ4yrVlzNprVKHGhZZyoml8LanzxegF/20LfkAqNjjm84PStbwQT1+U2OpcjswdQN/BG4U5YHLuvqfoxhBR0AD9Oynz06RLAbYeXqj+vZ759UT+M68JmshZIirWTf3FNwtCx38vhPNX2jRODs4oAYtasVN24Uvl5tft7wIhDd+5JWB3CaY2dHTXaUGGtaVsEM9SB7Q7hjVYG2ZT+luuAm82zNfZpMzQBzZgcCpW+ThKVOAb6+TeluVcMV98sz7RLMGHEUPjtT2oibI36m51Amp7Wgh5V6amBhQ6P2ktc/MF9nBl9Rv+BGsYPZyzi1oP8Xva/A3x3KHUbfvYwaVscB0FUpbAAggVfNY5dKAzSEI/OlAccimb6GknXMjbioF6YpbHBQkcDRgCzp9j4SmO8VS41DgU4QMoWAeuAymZrjwVp69J7dDg2fIpNmewScFPCOi41BpHVFBfTL0Wh70kBR5QK6k7e88OqwJ3hyke7zAMpMhO6DhJJ0iF5Gg0HCNtAXAoFcbpZxQwBJYihrtC9GBXqgwTZh4kzaWS9Mw/KTQOqQXHAIiFcuLraJdeFVEugsr7W5NhTOuQBtlRNCajXeqtgWUmz/WY4sseBBHQgwb0Hgb+mflZ1CKN1o95GRoPtQQ0I8uo0kJDrzvKDWqC5UD+BPOhIVBz4zRUHPMMSIWMGWO2cYGcLBGw+9ngsf5UNsuLIZg4v0UsGBBUtQZuoQ0rzZPL+Q2u1yQ9N3WCpsURqwLpuX73tETNCOOvcABiZ6nyFoJ9IxE6V0tUPjb+jTffQDpE8vUz4giUriwRDVtHXRjQTv6PFPW3YWciKllqaPFr4Jw3pTtgcnNB4nMjRk8eQ6HuasQES9PtQOzwuCD6yTkzReK/IBHNC+VjQ5gBWl4S0KgSdg60UKoRw8UhsFcfTy5E4oBgAKzMD/1bhVE9dqcEvEFkoOFAZu0uBp9tBfmT2GHohNViZrKyP6OAXY5iix8QS2nOjcBLHA/YISsa2t0tG31UtNkIVFuxeXkAGaxBImqboJRSfSIr219wZlJwsE3u6WPlJEvpIc0BX3CGlIz4FNEQueA2B7gfcZqrIeyEKAIPX4xihDeG6WB0x7AMR1pQxko0jlw3TRMtapsB9/n0pFwYbp8BvULKCYKSdUD+G9aaQ/VPLqxlr5QO9B+pPYQGKTdoZw9zshlUhs5oj8od1qYzkdGT+tgIIwfSihc6SCxfxD6tWAE8AusBCnTKK5NVZK4XgXIEOcuDzmN6OpL8JkPyu9vHgtQQ4E5sTNMC86Xw2pt6/PgCBrks7KvCRShT5InlVZRoNEcwEYU0VccsiYEfgJwIMU0BUXnBdfMGrE9aIW+yPuElxBnZBzI3RJPHYXvRTIdnlknpgYyU21Qf8Wuw/XoDAnDhF8fopM8sR0zZslaKVqowSU0Y0HKrQ6Arq5Mno4WTKuquhoD2YV8dYjRJIE0imMJ9BpKfwIR8EKmFFsHdaVDwTDgJqCEMjU7HXlFLEO4SL+UwGy7gkRcQ0WDHZSYQooL+oyc3jcUtrbcIENIC4eDk5ohmdLA/GOp00R02xw2FiwLUwQnWkNkuwFe5CA1FxifVtxzIlEEfgJsFKybx4Cum/KDtUFchBO+89iIF29UWQsYrjoPWMAVrApFdjwZ8BMfi1ltIG8mmCGYKlpEHkkikAztnGwGuq4bShVQXmLejVouBBYO3RElHt1r3U9VmltdKJS4FwToKSFl8cSxwsbFEmQU2XKkkdYUbxB5VKNTSFkRmV8X7oxigEtGila48rJnmQ97oglARkTn/a1x4WV5RoMwSH6W/kOAMVpuJmSLWNQ3AdVHhCYpqwuq6TwU7cJzxTWduiK9iYy0XlfgjpAP8Cw6igT07oIUxRvbW7wI6NwdiPbMNq7XbKWAvYXn9/3ciPp/Xo5cCuS/j2Nou64wq4lvue1zXQA4aAO1JwAlhtTQlvUB/5IHyhMxjgMJOTu7zoLZE6A/cXdgvjYI6VjkuXaS4T0s+AGgRCveiQS2sXet0Cb8AL7hruCvTclg9VDGkA5ZSkhs8A5kR/zjBKgiP8Zwm2wLVkpq5it/Il4QOnTUIA6ExNLTEdeG/Gya5SqUtvNl4CzxbsNZTdSc10y39mky3qr5PtQgAvcCnfAxKYJ5tU2D/B1IW0BqwzA4IBgkAfnNmlA81GSB9lmlJrhP5kLUI4YSBBmLSnoyVRnxvsPPNSKCsCNUUU5jD0Nz+aZtIxgdW0oN4fpQZ7R2wCDbl9tvbxg7ree3SX8MPWLAAR2wnYJ0A1FPdWbL/I4bnbqRcamsVzkB/xDgdzdkSm3RYGdkuDldo0OqbzlnLMToV3Q74PcwJe4PgN/7F6KN2gCuchWyCEY6mjEKYfGoUfs4CzsHtBk/JxRqY8PQIb86YSLm/MoacYDQHbqurOAIlUqX4NzSRfj1eLsQpvZ9GxodZoulChyCd4Vlox78AAJXAw0wBswrgylzFVEnBoIXlNtc+b5bUE8ylu4uue7V7d15yWp0PTTSvsvNf4KLpqBx1FM89lBixyVaf2lzAScZ5NcwT9j/sDwF9Eab811LZKo9AR+UFwqp3Z2tlqrtYCc9yXmExt24MMfHHtS4Iz/GM8gmR6QqvrXd3QngLmoriQMdJAbFWu0l27nIM6SJKDOFssKV5YjskZAHsZmiw3Ep0BggKA26w+wwAVKIo0BljYN44tcJNmucFYz2d2EIJEJtCeXMuHg94JVX8Q1pSlL5r5786EE3FtDCFbMRQyzEYZYq+Bi1NwK83omABhNGdtrqpBkRnayctoodY60LyT9VSdDBJQrdxC676ADy6lEVVDSaDuLX5hOyaPJVjPizMTneRYy9+wwXLaSIAGgTIZyie92SP9ADvgjR3vCgfbBEgIOoJTmHUAHEBqIJ0DAWoPw+zH37GQ1yfMGEcCRCFd/sUMADa+RCT8Bo2xatAijM0HKmYhcakYKCFpqUHmPJAiOPFa1lwd7bceOqZvUu0m058a+gSFAJCms/qeskBWxRLFGiHBjThpkBeQJyYyMfqJNckPXgIHdG0DqiiFZFZqE6hYO06im9VRyjB8Z0gHlozOHN12r+cmx9dwdZEKN+N7ikpjN2FNWJzuGwwOwEigGbQ54WvKAVKpTD3fieR8UCxygP7cDSWJLKcuFijBaEktqQxeo2gk1O6BuAurQ4ECbcqRC0Qkk8W131x1ZXlxfvJHjX0HsEGqUtKLHSpLMPZUwSEXHSwzNYhLHT/lBdEhisa2Pu0UI74LpQkQVmJaaiw7sWbp7NcZiug3SPGQJs6AzXbNMmBogwtK+pIp16foFqpwpuvWWXaDpSjG0/yE8/DBbdArC/CHjEK0jB9r7utmtiIXBd5Es0IhJR1dRg5mQy1RscVt5eMY/p1UZilEGhWx4E968dvP6hRT4fzacTEgkobWTooC0ZULu/hUpE3u3wbGXQpdDtQSuL2DmD/AfY9BHtwiIori09jiGFTGgafHnWow4cIUPinhcCDXuvUnBeEgkLdQf33vT7BiEDW5SK1wXw5TL7xNL2vQRVGCxXZf3w41WuaCeqbaalZiRO8MwyaDEnExQbqEcBPPqSu6X3zbbyJI37Ah43ba+kiQ1v2oBd4+5mDDYTLeXUyRMjFbQprep1KQ/sN74drHp2ryzJWt6h+Z8t1Je2NR+2Q2QXIbjetGOIkuATzHvTpp8OH9j/m640v9vNpRYDsHCt5dbmCiYdODra/ny4HwLqemTSDw4yvAmC9NK3isBLD2iz39LBjyL50XVrau8abYfMc3fJZsiqSRTfLQwSMOiku+WI5bFXCEIWSPOrsHv6cS2qh1CP5ieyEKYVioUlXNH254oMo902PXND1N/7l6337p6eCqdbd8s9tnuqoQoHFmLa9HraQay7nnY4PSz4tJg/He8GQpMRk4n4Q7yomHQaonqdLJm4gz967nhQFxi/GJ/6SH7fKo+ZHkNIFj2f6F8I7RdH8+mEOzhB7kdWcyMeB+wMCmyhhIOeHGZFYaZIAIuzR/KSap4G7vgbzw0o1ZCcqBd5gtmNHv0tlO5mSfHgmMKO6QGJWbb0MMWnGmzzPtRnoa3wBbwzQLcmJmjRTJJgEw0foiHEtCViBHU5rR4ZxPs0kCnM+o0E+dXRfN5Wf6CqwqVoEm1/hWsHh7YUL+CsLnvpT8Lak0dQQ/twixhBOICajSK0HPVoG5NiZZ1JG7pBu7X4EZRtQhlg/TC9DVc/9ZRiVdQxpjgZljugECdupEz0QLBIlV4ykYaTvKQWCCV8jiTCVkdKBHVpdx4oAQfsRrJWBpxQpBLXaCfsKWm4E5FMg8qC36M2GKA3i+WHr3fE3nBbck6QZ77P8Khsq2fG30cx6H8G6bl61Q4dPedlXBDaNPRE+2hnCuKMcpmm3k0oz2DoF239NTi063GL29rmk5Xq0LO2ZJE6fjANsF9PxfO44J/yAyMnuccn48GQrhl9BBRIaCHKgvblCYJ2g7X7Q6ZGkkBFp5dMVsMaTy6Nho8oV0gQY7n+50dk5vOzMtCckUHuoA2vAmvgzCE62HJJ+emJxwmD8wFvS7hGa4q7wQy8P/a4+9asmXZMaYTS8KnEj1FkpcEpOI+uQGno/0Fp07c5WshNdIApeCHqs+vJI83myeKtYNyMvx77biMxOI43LGUioCOafGMBB3yx6KizgwF68JwegUx/UQ9Du4+Klb/4GtOCZxM9W4XeCEa9ot16Rk36jdHjG7CY2SVOPapMoaKOhEfgBBJOrlv/4WAVegwwh+cGFZUZQo5Jm0spU0wbcMbHL9OmnxvzAUCEjvZC+WhneEao3pZKKUBiE0Q9VbtGmAhKMDBhSNMi1VwBiQf6SA+KsZsgD53iHtJpkhj4S0inLRD9ICopDtoIjX+cti716B8guNanosU7dh3tgwtbtHocsxJPuCPf/7jnwDW05NjpagvqXP9BK+XXU4D5cRfD/L3HV6Sx0Q7/BWJwooL1dRH5AAABhWlDQ1BJQ0MgcHJvZmlsZQAAeJx9kT1Iw0AcxV9TiyKVInYQcchQHcSCqIijVLEIFkpboVUHk0u/oElDkuLiKLgWHPxYrDq4OOvq4CoIgh8gbm5Oii5S4v+SQosYD4778e7e4+4dIDQqTDW7JgBVs4xUPCZmc6ti9ysCCCOEfoxJzNQT6cUMPMfXPXx8vYvyLO9zf44+JW8ywCcSzzHdsIg3iGc2LZ3zPnGYlSSF+Jx43KALEj9yXXb5jXPRYYFnho1Map44TCwWO1juYFYyVOJp4oiiapQvZF1WOG9xVis11ronf2Ewr62kuU5zGHEsIYEkRMiooYwKLERp1UgxkaL9mId/yPEnySWTqwxGjgVUoUJy/OB/8LtbszA16SYFY0DgxbY/RoDuXaBZt+3vY9tungD+Z+BKa/urDWD2k/R6W4scAaFt4OK6rcl7wOUOMPikS4bkSH6aQqEAvJ/RN+WAgVugd83trbWP0wcgQ10t3wAHh8BokbLXPd7d09nbv2da/f0AhAxyrtE/1ZMAAA0YaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8P3hwYWNrZXQgYmVnaW49Iu+7vyIgaWQ9Ilc1TTBNcENlaGlIenJlU3pOVGN6a2M5ZCI/Pgo8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA0LjQuMC1FeGl2MiI+CiA8cmRmOlJERiB4bWxuczpyZGY9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkvMDIvMjItcmRmLXN5bnRheC1ucyMiPgogIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIKICAgIHhtbG5zOnN0RXZ0PSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VFdmVudCMiCiAgICB4bWxuczpkYz0iaHR0cDovL3B1cmwub3JnL2RjL2VsZW1lbnRzLzEuMS8iCiAgICB4bWxuczpHSU1QPSJodHRwOi8vd3d3LmdpbXAub3JnL3htcC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgeG1wTU06RG9jdW1lbnRJRD0iZ2ltcDpkb2NpZDpnaW1wOjE3YWFmOTUyLWNiMTYtNDc5Mi1hMmU1LWZkZGRmODY1ZWFmZCIKICAgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDpiZGE4ODI3My0wNzllLTQ2NTAtYjAyYS0wOTRlZTkwOWQzOTciCiAgIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDphNGVlM2VhMi02NzM5LTQwODYtYWY4ZS00NjgyNmU3ZmNiNTgiCiAgIGRjOkZvcm1hdD0iaW1hZ2UvcG5nIgogICBHSU1QOkFQST0iMi4wIgogICBHSU1QOlBsYXRmb3JtPSJXaW5kb3dzIgogICBHSU1QOlRpbWVTdGFtcD0iMTYyMTUyMzk4MDE2MTIxMCIKICAgR0lNUDpWZXJzaW9uPSIyLjEwLjI0IgogICB0aWZmOk9yaWVudGF0aW9uPSIxIgogICB4bXA6Q3JlYXRvclRvb2w9IkdJTVAgMi4xMCI+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==" - 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); + } }); }); From 768a189b123a3ec25b09a1114b002fc22bb0dfa8 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:46:14 -0300 Subject: [PATCH 80/83] fix: removing error messsages when disintegrating (#271) --- Model/Account.php | 2 +- Model/Api/HubCommand.php | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Model/Account.php b/Model/Account.php index 76e8f499..f0950ce3 100644 --- a/Model/Account.php +++ b/Model/Account.php @@ -168,7 +168,7 @@ public function getDashSettingsErrors() return []; } - $errorsList = $collection->getFirstItem()->getData()['value']; + $errorsList = $collection->getFirstItem()->getData()['value'] ?? ''; $returnData = json_decode($errorsList); if (empty($returnData)) { return []; diff --git a/Model/Api/HubCommand.php b/Model/Api/HubCommand.php index d9cb8012..4fdceddb 100644 --- a/Model/Api/HubCommand.php +++ b/Model/Api/HubCommand.php @@ -148,6 +148,13 @@ public function uninstallCommand() $this->websiteId ); + $this->configWriter->save( + "pagarme_pagarme/hub/account_errors", + null, + 'websites', + $this->websiteId + ); + $this->cacheManager->clean(['config']); return "Hub uninstalled successfully"; From 3a5abb82e351d882080db23edc1d0b4fc9b49ca2 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Mon, 6 Nov 2023 18:21:51 -0300 Subject: [PATCH 81/83] fix: integration buttons css (#272) --- view/adminhtml/web/css/integration_buttons.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/view/adminhtml/web/css/integration_buttons.css b/view/adminhtml/web/css/integration_buttons.css index d2faaa69..59b87f70 100644 --- a/view/adminhtml/web/css/integration_buttons.css +++ b/view/adminhtml/web/css/integration_buttons.css @@ -17,13 +17,13 @@ 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; - margin-left: 2rem; text-transform: none; } From d876ff284f93a9528f6231e4ba203bda22530457 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Tue, 7 Nov 2023 16:43:28 -0300 Subject: [PATCH 82/83] Release 2.2.6 --- composer.json | 5 ++--- etc/module.xml | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/composer.json b/composer.json index f2c3bfde..c7c5d599 100755 --- a/composer.json +++ b/composer.json @@ -1,13 +1,12 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.5", + "version": "2.2.6", "type": "magento2-module", "description": "Magento 2 Module Pagar.me", - "minimum-stability": "dev", "require": { "php": ">=7.1", - "pagarme/ecommerce-module-core": "dev-develop" + "pagarme/ecommerce-module-core": "2.2.*" }, "require-dev": { "phpunit/phpunit": "4.1.0", diff --git a/etc/module.xml b/etc/module.xml index 8d4024ec..7c90bc43 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -9,7 +9,7 @@ */ --> - + From 54864de24503deec11db8a5a55c38ec8e37c4350 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Tue, 7 Nov 2023 17:15:59 -0300 Subject: [PATCH 83/83] release 2.3.0 --- composer.json | 4 ++-- etc/module.xml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index c7c5d599..8f5f2c30 100755 --- a/composer.json +++ b/composer.json @@ -1,12 +1,12 @@ { "name": "pagarme/pagarme-magento2-module", "license": "MIT", - "version": "2.2.6", + "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/module.xml b/etc/module.xml index 7c90bc43..b8794923 100755 --- a/etc/module.xml +++ b/etc/module.xml @@ -9,7 +9,7 @@ */ --> - +