From 90cd0ca303e0775f94b7628d6ada1854b5a8fe03 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Wed, 7 Feb 2024 14:11:03 -0300 Subject: [PATCH 01/14] fix: zero in address number field (#392) * fix: zero in address number field * fix: php 7 compatibility for address number validation --- src/Concrete/WoocommercePlatformOrderDecorator.php | 11 +++++++++++ .../src/Payment/Aggregates/Address.php | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/Concrete/WoocommercePlatformOrderDecorator.php b/src/Concrete/WoocommercePlatformOrderDecorator.php index 31caa219..2470efe1 100644 --- a/src/Concrete/WoocommercePlatformOrderDecorator.php +++ b/src/Concrete/WoocommercePlatformOrderDecorator.php @@ -1103,6 +1103,17 @@ private function validateAddressFields($platformAddress) foreach ($requiredFields as $requiredField) { $fieldIsNotSet = !array_key_exists($requiredField, $platformAddress) || empty($platformAddress[$requiredField]); + + if ($requiredField === 'number') { + $fieldIsNotSet = !array_key_exists($requiredField, $platformAddress) + || ( + empty($platformAddress[$requiredField]) + && ( + $platformAddress[$requiredField] === null + || !is_numeric(trim($platformAddress[$requiredField])) + ) + ); + } if ($fieldIsNotSet) { $message = "Missing $requiredField in customer address"; diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Address.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Address.php index 7a0b7bde..a692f65a 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Address.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Address.php @@ -78,7 +78,7 @@ public function setNumber($number) $this->number = substr($numberWithoutLineBreaks, 0, 15); - if (empty($this->number)) { + if (empty($this->number) && ($this->number === null || !is_numeric(trim($this->number)))) { $inputName = $this->i18n->getDashboard('number'); $message = $this->i18n->getDashboard( From b004b5490db02016873d812df9a742189e887f8a Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 7 Mar 2024 11:21:10 -0300 Subject: [PATCH 02/14] fix: log name with dot (#395) --- .../ecommerce-module-core/src/Kernel/Services/LogService.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php index 39e3e6d9..a6b0f7ba 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php +++ b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php @@ -132,9 +132,6 @@ protected function setFileName() { $base = 'Pagarme_PaymentModule_' . date('Y-m-d'); $fileName = $this->path . DIRECTORY_SEPARATOR . $base; - if ($this->addHost) { - $fileName .= '_' . gethostname(); - } $fileName .= '.log'; $this->fileName = $fileName; } From b5f72bde7e8745dbbc01cfe1c1283f72714758e4 Mon Sep 17 00:00:00 2001 From: Fabiano Mallmann <25328512+fabiano-mallmann@users.noreply.github.com> Date: Tue, 19 Mar 2024 16:31:48 -0300 Subject: [PATCH 03/14] fix: webhook problem when there is a path in the url (#399) --- src/Core.php | 6 +++- tests/Model/CoreTest.php | 65 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 tests/Model/CoreTest.php diff --git a/src/Core.php b/src/Core.php index 8be88f76..a42991d1 100644 --- a/src/Core.php +++ b/src/Core.php @@ -257,7 +257,11 @@ public static function instance() public static function get_webhook_url($custom_url = false) { $url = !$custom_url ? Utils::get_site_url() : $custom_url; - + if ( !$custom_url ) { + $parsedUrl = parse_url($url); + $url = $parsedUrl['scheme'] . '://' . $parsedUrl['host']; + } + return sprintf('%s/wc-api/%s/', $url, self::get_webhook_name()); } diff --git a/tests/Model/CoreTest.php b/tests/Model/CoreTest.php new file mode 100644 index 00000000..21d44740 --- /dev/null +++ b/tests/Model/CoreTest.php @@ -0,0 +1,65 @@ +shouldReceive('get_site_url')->andReturn($domain); + $utils->shouldReceive('add_prefix')->andReturn('pagarme-webhook'); + + $getUrl = Core::get_webhook_url(); + + $this->assertEquals($webhookLink, $getUrl); + } + + public function testGetWebhookWithoutCustomUrlWithPath() + { + $domain = "https://mycustomdomain.test"; + $domainWithPath = "https://mycustomdomain.test/app/customPath"; + $webhookLink = $domain . "/wc-api/pagarme-webhook/"; + + $utils = Mockery::mock("alias:Woocommerce\Pagarme\Helper\Utils"); + $utils->shouldReceive('get_site_url')->andReturn($domainWithPath); + $utils->shouldReceive('add_prefix')->andReturn('pagarme-webhook'); + + $getUrl = Core::get_webhook_url(); + + $this->assertEquals($webhookLink, $getUrl); + } + public function testGetWebhookWithoutCustomUrl() + { + $customDomain = "https://mycustomdomain.test"; + $webhookLink = $customDomain . "/wc-api/pagarme-webhook/"; + + $utils = Mockery::mock("alias:Woocommerce\Pagarme\Helper\Utils"); + $utils->shouldReceive('get_site_url')->andReturn($customDomain); + $utils->shouldReceive('add_prefix')->andReturn('pagarme-webhook'); + + $getUrl = Core::get_webhook_url($customDomain); + + $this->assertEquals($webhookLink, $getUrl); + } +} From 4c0144534b55d55721255f0927ca68ec2cbc1582 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Thu, 21 Mar 2024 15:46:03 -0300 Subject: [PATCH 04/14] feat: add 3ds (#402) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add 3ds admin configs * fix: wrong translation * build: bump ecommerce-module-core version * feat: tds token endpoint * chore: remove comment * feat: add 3ds js authentication * fix: 3ds admin options to all account types * fix: tds authentication call only to credit_card payment method * fix: credit card number mask * fix: code smells * fix: code smells * refactor: code identation * chore: change dev to false * fix: amount with float value * fix: tds min amount validation * feat: add authentication node to create order * fix: remove unnecessary times 100 * fix: test method typo * feat: add 3ds status to order admin page * fix: code smells * fix: code smells * fix: wrong replace * fix: specialize CSS more * build: bump ecommerce-module-core version --- .github/workflows/pr.yml | 2 +- .../front/checkout/model/payment.js | 2 +- .../front/checkout/model/payment/card.js | 75 ++-- .../checkout/model/payment/card/initTds.js | 6 + .../front/checkout/model/payment/card/tds.js | 324 ++++++++++++++++++ .../checkout/model/payment/card/tdsToken.js | 29 ++ .../checkout/model/payment/card/tokenize.js | 4 +- .../checkout/model/payment/card/wallet.js | 2 +- .../checkout/model/payment/order-value.js | 2 +- assets/stylesheets/front/style.css | 29 ++ composer.json | 2 +- languages/woo-pagarme-payments-pt_BR.mo | Bin 33115 -> 34642 bytes languages/woo-pagarme-payments-pt_BR.po | 47 ++- src/Block/Checkout/Form/Tds.php | 57 +++ src/Block/Order/Transaction/AbstractCard.php | 28 +- .../WoocommercePlatformOrderDecorator.php | 85 +++-- src/Controller/Gateways/CreditCard.php | 55 +++ src/Controller/TdsToken.php | 30 ++ src/Core.php | 11 + src/Helper/Utils.php | 151 ++++---- src/Model/Checkout.php | 20 +- src/Model/Config.php | 10 + src/Model/Order.php | 9 +- src/Model/Payment/CreditCard.php | 2 + src/Service/TdsTokenService.php | 44 +++ templates/checkout/form/billet.phtml | 2 +- templates/checkout/form/card.phtml | 18 +- templates/checkout/form/card/tds.phtml | 24 ++ templates/checkout/form/field/card-save.phtml | 14 +- templates/checkout/payment/credit-card.phtml | 9 + templates/order/charge.phtml | 3 +- .../WoocommercePlatformOrderDecoratorTest.php | 103 ++++++ tests/Model/CheckoutTest.php | 149 ++++++++ tests/Model/CustomerTest.php | 2 +- tests/Service/AccountServiceTest.php | 5 +- tests/Service/TdsTokenServiceTest.php | 69 ++++ vendor/composer/autoload_psr4.php | 1 + vendor/composer/autoload_real.php | 2 + vendor/composer/autoload_static.php | 5 + vendor/composer/installed.json | 30 +- vendor/composer/installed.php | 12 +- vendor/composer/platform_check.php | 26 ++ .../ecommerce-module-core/catalog-info.yaml | 21 -- .../ecommerce-module-core/composer.json | 4 +- .../src/Kernel/Aggregates/Order.php | 18 + .../src/Kernel/Services/LogService.php | 6 +- .../src/Kernel/Services/OrderLogService.php | 2 +- .../src/Kernel/Services/OrderService.php | 33 +- .../src/Middle/Client.php | 7 +- .../src/Middle/Proxy/TdsTokenProxy.php | 28 ++ .../src/Payment/Aggregates/Customer.php | 16 +- .../src/Payment/Aggregates/Order.php | 40 ++- .../Payments/AbstractCreditCardPayment.php | 35 ++ .../Authentication/Authentication.php | 137 ++++++++ .../AuthenticationStatusEnum.php | 80 +++++ .../Authentication/Type/ThreeDSecure.php | 94 +++++ .../src/Payment/Aggregates/Shipping.php | 12 +- .../src/Payment/Factories/PaymentFactory.php | 6 +- .../Services/SubscriptionService.php | 11 +- .../src/Controllers/TdsTokenController.php | 95 +++++ .../src/Models/GetTdsTokenResponse.php | 41 +++ .../src/PagarmeCoreApiClient.php | 10 +- 62 files changed, 1935 insertions(+), 261 deletions(-) create mode 100644 assets/javascripts/front/checkout/model/payment/card/initTds.js create mode 100644 assets/javascripts/front/checkout/model/payment/card/tds.js create mode 100644 assets/javascripts/front/checkout/model/payment/card/tdsToken.js create mode 100644 src/Block/Checkout/Form/Tds.php create mode 100644 src/Controller/TdsToken.php create mode 100644 src/Service/TdsTokenService.php create mode 100644 templates/checkout/form/card/tds.phtml create mode 100644 tests/Concrete/WoocommercePlatformOrderDecoratorTest.php create mode 100644 tests/Model/CheckoutTest.php create mode 100644 tests/Service/TdsTokenServiceTest.php create mode 100644 vendor/composer/platform_check.php delete mode 100644 vendor/pagarme/ecommerce-module-core/catalog-info.yaml create mode 100644 vendor/pagarme/ecommerce-module-core/src/Middle/Proxy/TdsTokenProxy.php create mode 100644 vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/Authentication.php create mode 100644 vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/AuthenticationStatusEnum.php create mode 100644 vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/Type/ThreeDSecure.php create mode 100644 vendor/pagarme/pagarmecoreapi/src/Controllers/TdsTokenController.php create mode 100644 vendor/pagarme/pagarmecoreapi/src/Models/GetTdsTokenResponse.php diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index e389eb07..f868de2a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -95,7 +95,7 @@ jobs: with: args: > -Dsonar.php.coverage.reportPaths=coverage/clover.xml - -Dsonar.coverage.exclusions=tests/**,assets/**,templates/**,woo-pagarme-payments.php + -Dsonar.coverage.exclusions=tests/**,assets/**,src/Controller/**,templates/**,woo-pagarme-payments.php -Dsonar.tests=tests/ -Dsonar.sources=src,assets,templates,woo-pagarme-payments.php diff --git a/assets/javascripts/front/checkout/model/payment.js b/assets/javascripts/front/checkout/model/payment.js index 003dc525..869db9c6 100644 --- a/assets/javascripts/front/checkout/model/payment.js +++ b/assets/javascripts/front/checkout/model/payment.js @@ -11,7 +11,7 @@ jQuery(function ($) { } const requiredFields = $('#shipping_number:visible, input[data-required=true]:visible,' + 'select[data-required=true]:visible,' + - `.wc_payment_method.payment_method_${checkedPayment} [data-pagarmecheckout-element="brand-input"]`); + `.wc_payment_method.payment_method_${checkedPayment} [data-pagarme-element="brand-input"]`); let isValid = true; requiredFields.each(function (index, item) { const field = $(item); diff --git a/assets/javascripts/front/checkout/model/payment/card.js b/assets/javascripts/front/checkout/model/payment/card.js index 3abe978e..a7c481d3 100644 --- a/assets/javascripts/front/checkout/model/payment/card.js +++ b/assets/javascripts/front/checkout/model/payment/card.js @@ -4,12 +4,15 @@ let pagarmeCard = { limitTokenize: 10, tokenExpirationAttribute: 'data-pagarmecheckout-expiration', cardNumberTarget: 'input[data-element="pagarme-card-number"]', - brandTarget: 'input[data-pagarmecheckout-element="brand-input"]', - valueTarget: 'input[data-pagarmecheckout-element="order-value"]', + cardHolderNameTarget: 'input[data-element="card-holder-name"]', + cardExpiryTarget: 'input[data-element="card-expiry"]', + cardCvvTarget: 'input[data-element="card-cvv"]', + brandTarget: 'input[data-pagarme-element="brand-input"]', + valueTarget: 'input[data-pagarme-element="order-value"]', installmentsTarget: '[data-pagarme-component="installments"]', installmentsInfoTarget: '[data-pagarme-component="installments-info"]', mundiCdn: 'https://cdn.mundipagg.com/assets/images/logos/brands/png/', - tokenElement: '[data-pagarmecheckout-element="token"]', + tokenElement: '[data-pagarme-element="token"]', fieldsetCardElements: 'fieldset[data-pagarmecheckout="card"]', billingCpfId: '#billing_cpf', voucherDocumentHolder: 'input[name="pagarme[voucher][cards][1][document-holder]"]', @@ -288,17 +291,17 @@ let pagarmeCard = { } }); ajax.done(function (response) { - pagarmeCard._done(select, info, storageName, cardForm, JSON.parse(response)); + pagarmeCard._done(select, info, storageName, JSON.parse(response)); }); ajax.fail(function () { - pagarmeCard._fail(cardForm); + pagarmeCard._fail(); }); - pagarmeCard.showLoader(cardForm); + pagarmeCard.showLoader(); } return true; }, - _done: function (select, info, storageName, event, response) { + _done: function (select, info, storageName, response) { if (info.length) { info.addClass('pagarme-hidden'); if(response.installmentsConfig > 1) { @@ -307,26 +310,26 @@ let pagarmeCard = { } select.html(response.optionsHtml); sessionStorage.setItem(storageName, response); - this.removeLoader(event); + this.removeLoader(); }, - _fail: function (event) { - this.removeLoader(event); + _fail: function () { + this.removeLoader(); }, - removeLoader: function (event) { - if (!(event instanceof jQuery)) { - event = jQuery(event); + removeLoader: function () { + if (typeof jQuery.unblockUI === 'function') { + jQuery.unblockUI(); } - event.unblock(); }, - showLoader: function (event) { - event = this.formatEventToJQuery(event) - event.block({ - message: null, - overlayCSS: { - background: '#fff', - opacity: 0.6 - } - }); + showLoader: function () { + if (typeof jQuery.blockUI === 'function') { + jQuery.blockUI({ + message: null, + overlayCSS: { + background: '#fff', + opacity: 0.6 + } + }); + } }, showError: function (text) { const errorMessageText = this.translateErrors('card', text); @@ -347,15 +350,14 @@ let pagarmeCard = { return output; }, execute: async function (event) { - const checkoutPaymentElement = this.getCheckoutPaymentElement(); try { for (let i = 1; !pagarmeCard.isTokenized() && i <= this.limitTokenize; i++) { if (i === this.limit) { - this.removeLoader(checkoutPaymentElement); + this.removeLoader(); throw new Error("Tokenize timeout"); } if (wc_pagarme_checkout.errorTokenize === true) { - this.removeLoader(checkoutPaymentElement); + this.removeLoader(); return; } await pagarmeCard.wait(); @@ -379,12 +381,29 @@ let pagarmeCard = { !pagarmeCard.isTokenized() && pagarmeCard.haveCardForm(checkoutPaymentElement) ) { - pagarmeTokenize.execute(); - pagarmeCard.execute(event); + if (typeof pagarmeTds == 'object') { + const tdsExecuted = pagarmeTds.start(event); + + if (tdsExecuted) { + return false; + } + } + this.executeAll(event); return false; } return true; }, + executeAll: function (event) { + pagarmeTokenize.execute(); + pagarmeCard.execute(event); + }, + brandIsVisaOrMaster: function() { + const checkoutPaymentElement = this.getCheckoutPaymentElement(); + const brand = jQuery(checkoutPaymentElement).find(this.brandTarget) + .val(); + return brand === "visa" + || brand === "mastercard"; + }, onChangeBillingCpf: function () { let cpf = jQuery(this.billingCpfId).val(); jQuery(this.voucherDocumentHolder).empty(); diff --git a/assets/javascripts/front/checkout/model/payment/card/initTds.js b/assets/javascripts/front/checkout/model/payment/card/initTds.js new file mode 100644 index 00000000..b1ac0b53 --- /dev/null +++ b/assets/javascripts/front/checkout/model/payment/card/initTds.js @@ -0,0 +1,6 @@ +const initTds = { + callTdsFunction(tdsToken, tdsData, callbackTds) { + const challengeWindowSize = "03"; + Script3ds.init3ds(tdsToken, tdsData, callbackTds, challengeWindowSize); + }, +}; diff --git a/assets/javascripts/front/checkout/model/payment/card/tds.js b/assets/javascripts/front/checkout/model/payment/card/tds.js new file mode 100644 index 00000000..185e1f65 --- /dev/null +++ b/assets/javascripts/front/checkout/model/payment/card/tds.js @@ -0,0 +1,324 @@ +/* globals cartTotal */ +const pagarmeTds = { + authentication: "authentication", + vendor: "pagarme", + checkoutEvent: null, + paymentMethodTarget: "data-pagarmecheckout-method", + sequenceTarget: "data-pagarmecheckout-card-num", + elementTarget: "data-pagarmecheckout-element", + formTarget: "data-pagarmecheckout-form", + FAIL_GET_EMAIL: "fail_get_email", + FAIL_GET_BILLING_ADDRESS: "fail_get_billing_address", + FAIL_ASSEMBLE_CARD_EXPIRY_DATE: "fail_assemble_card_expiry_date", + FAIL_ASSEMBLE_PURCHASE: "fail_assemble_purchase", + addErrors: (errors) => { + if (errors.error?.email) { + pagarmeTds.showError( + PagarmeGlobalVars.checkoutErrors.pt_BR[ + pagarmeTds.FAIL_GET_EMAIL + ] + ); + return; + } + if (errors.error?.bill_addr) { + pagarmeTds.showError( + PagarmeGlobalVars.checkoutErrors.pt_BR[ + pagarmeTds.FAIL_GET_BILLING_ADDRESS + ] + ); + return; + } + if (errors.error?.card_expiry_date) { + pagarmeTds.showError( + PagarmeGlobalVars.checkoutErrors.pt_BR[ + pagarmeTds.FAIL_ASSEMBLE_CARD_EXPIRY_DATE + ] + ); + return; + } + if (errors.error?.purchase) { + pagarmeTds.showError( + PagarmeGlobalVars.checkoutErrors.pt_BR[ + pagarmeTds.FAIL_ASSEMBLE_PURCHASE + ] + ); + } + }, + + getToken: () => { + const data = pagarmeTdsToken.getToken(); + if (data.error) { + pagarmeTds.removeTdsAttributeData(); + pagarmeTds.showError( + PagarmeGlobalVars.checkoutErrors.pt_BR[data.error] + ); + return ""; + } + + return data.token; + }, + + canTdsRun: () => { + const fieldset = pagarmeCard + .getCheckoutPaymentElement() + .find(pagarmeCard.fieldsetCardElements); + + const paymentMethod = fieldset.attr(pagarmeTds.paymentMethodTarget); + return ( + paymentMethod === "credit_card" && + wc_pagarme_checkout.config.payment.credit_card.tdsEnabled === + true && + cartTotal >= + wc_pagarme_checkout.config.payment.credit_card.tdsMinAmount && + pagarmeCard.brandIsVisaOrMaster() && + !pagarmeTds.hasAuthenticationField() + ); + }, + + addTdsAttributeData: () => { + const checkoutPaymentElement = pagarmeCard.getCheckoutPaymentElement(); + jQuery("form.checkout").attr(pagarmeTds.formTarget, ""); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardHolderNameTarget) + .attr(pagarmeTds.elementTarget, "holder_name"); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardNumberTarget) + .attr(pagarmeTds.elementTarget, "number"); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.brandTarget) + .attr(pagarmeTds.elementTarget, "brand"); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardCvvTarget) + .attr(pagarmeTds.elementTarget, "cvv"); + }, + + removeTdsAttributeData: () => { + const checkoutPaymentElement = pagarmeCard.getCheckoutPaymentElement(); + jQuery("form.checkout").removeAttr(pagarmeTds.formTarget); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardHolderNameTarget) + .removeAttr(pagarmeTds.elementTarget); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardNumberTarget) + .removeAttr(pagarmeTds.elementTarget); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.brandTarget) + .removeAttr(pagarmeTds.elementTarget); + jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardCvvTarget) + .removeAttr(pagarmeTds.elementTarget); + }, + + getTdsData: (acctType, cardExpiryDate) => { + const customerPhones = [ + { + country_code: "55", + subscriber: pagarmeTds.filterOnlyNumber( + jQuery('input[name="billing_phone"]').val() + ), + phone_type: "mobile", + }, + ]; + + const billingAddressStreet = jQuery( + 'input[name="billing_address_1"]' + ).val(); + const billingAddressNumber = jQuery( + 'input[name="billing_number"]' + ).val(); + const billingAddressComplement = jQuery( + 'input[name="billing_address_2"]' + ).val(); + const billingAddressCity = jQuery('input[name="billing_city"]').val(); + const billingAddressState = jQuery( + 'select[name="billing_state"]' + ).val(); + const billingAddressPostcode = jQuery( + 'input[name="billing_postcode"]' + ).val(); + + let shippingAddressStreet = billingAddressStreet; + let shippingAddressNumber = billingAddressNumber; + let shippingAddressComplement = billingAddressComplement; + let shippingAddressCity = billingAddressCity; + let shippingAddressState = billingAddressState; + let shippingAddressPostcode = billingAddressPostcode; + + if (jQuery('input[name="ship_to_different_address"]').is(":checked")) { + shippingAddressStreet = jQuery( + 'input[name="shipping_address_1"]' + ).val(); + shippingAddressNumber = jQuery( + 'input[name="shipping_number"]' + ).val(); + shippingAddressComplement = jQuery( + 'input[name="shipping_address_2"]' + ).val(); + shippingAddressCity = jQuery('input[name="shipping_city"]').val(); + shippingAddressState = jQuery( + 'select[name="shipping_state"]' + ).val(); + shippingAddressPostcode = jQuery( + 'input[name="shipping_postcode"]' + ).val(); + } + + return { + bill_addr: { + street: billingAddressStreet, + number: billingAddressNumber, + complement: billingAddressComplement, + city: billingAddressCity, + state: billingAddressState, + country: "BRA", + post_code: billingAddressPostcode, + }, + ship_addr: { + street: shippingAddressStreet, + number: shippingAddressNumber, + complement: shippingAddressComplement, + city: shippingAddressCity, + state: shippingAddressState, + country: "BRA", + post_code: shippingAddressPostcode, + }, + email: jQuery('input[name="billing_email"]').val(), + phones: customerPhones, + card_expiry_date: cardExpiryDate, + purchase: { + amount: parseInt(cartTotal * 100), + date: new Date().toISOString(), + instal_data: 2, + }, + acct_type: acctType, + }; + }, + + callTds: (tdsToken) => { + const checkoutPaymentElement = pagarmeCard.getCheckoutPaymentElement(); + + const expDate = jQuery(checkoutPaymentElement) + .find(pagarmeCard.cardExpiryTarget) + .val(); + let [expMonth, expYear] = expDate.split("/"); + expMonth = expMonth.trim(); + expYear = expYear.trim(); + expYear = `20${expYear}`; + + const cardExpiryDate = `${expYear}-${expMonth}`; + + const tdsData = pagarmeTds.getTdsData("02", cardExpiryDate); + initTds.callTdsFunction( + tdsToken, + tdsData, + pagarmeTds.callbackTds.bind(this) + ); + }, + + showError: function (error) { + const element = jQuery('input[name$="payment_method"]:checked') + .closest("li") + .find("#wcmp-checkout-errors"); + + swal.close(); + + wc_pagarme_checkout.errorList = `
heQ&Sr? z$E{Fr*bkfGi|+g(REL)^4ew(^^dt?kH;lwM8Wy7Fb~|eBuc8Ka4?o0`gKb9#P;>YL z>bg5fl8pZl`^#()22mf5+C}5AIL<^ij#+@bh{xQp1rs#XJ~$RN1@*Bqwni<|F_?;T z-TA$!j*nsjUc@9UI*h-PFcUZ6CG^L9=BFku!9e^H{k8v(P*5sQ;9R_ig>lvhy9?%{ zM!pgCMxVL*0n|1+jg>HBq|IO&YMb@MLO2p*aUxd4rKnx;F-FqAIZQzVxQrTM;3%8& zbgW9f8|n>ap!WF-s5LR)x!SoCgK0m3n(K?GwRO)KmTMPfB37Zj4SGT-jH93t=eY|O zqULrJYSr#TO~H4lH~I^;R{TeE4y)o<_zP-a+sD{{k{v-^A3fH7*s7skpbqM}O~#Uc zt=e8RXpxOar8pn;pk=5J&n8U316UkyV;K63vnh?hJnE^a^IK2@-jCsU$+h1@&3({# zYq9a<-;ah!8Z^=<{260VDJn6+PC;F)PQ4$-<6PADVzaB?#3!hSP2`_zx(=J-pBRJn zC)vL-`#Kk)ruvY_6&_&?8j_!}9rbq3L3Owp6Y(sjV4=zOJCKRpsdvM8AO8OU)}?-Y zip^xmvo>>)Sd{jL7=W!&Ys%AsLL`N*SPX|_S)Afrgj$@NuoNE02)v2M&}XV$WXDl+ z`ztDw53m~gO|t_}LQPq3)b7efmWRhorqF?g8(0hLPj`P%V8P0il;u2R}f7J6BF^9Ea$?;2#UB%pvX(pAdY53O=`B z61hp4(awk>MiQ0XgFd6IV*$~lpu{dg)^EWyR^mF%bBwz_jq(-Z@!@&im412Lg1%hL zIx|~bTNUcJD6b(tAhr@4h~>mTgpN33Z9&PVy^AZ0JR*tk<2h9c9Rmoyih6%OKtx9( zh?8$(1Zq)c5jqxH%zk{As6c2DJw8&oele9g_!BN6mbsJJPBuir*D%4=wF@$Q=)XKS z-Jvp%xI}zGXzvHpegyRiK0#EYein7KCb|)YY198X*YSvGLwP< A0r4I?-SZ$;ly8rw#(zgpBubXz9t?L72Sy!@MGent5@K< ze;*U6)TJ#9uMyRVBGjj2XU+fb6y6|o93>KoVq8!YUm|p@vY5B9GI7Jz?_xCZhpV?j zJ}RacF@z{YtRM s& z#7 #p1k(}{DgE?T?is(hHp)r@4i#uOU%5c)0F4<{3kk8dcHrTxEH2!F$dxYS*+ z4L1|dx%y?SK|Jm1y|E0}>sU{`SWseDX#P{FH0Go)?jVj4+lfz!XNjW3mqdG_5pj^v z(Z^y!xVJCm getConfig()->getIsSandboxMode()) { + $url = 'https://auth-3ds-sdx.pagar.me/bundle.js'; + } + return $url; + } + + public function canInitTds() + { + return $this->getConfig()->isTdsEnabled(); + } +} diff --git a/src/Block/Order/Transaction/AbstractCard.php b/src/Block/Order/Transaction/AbstractCard.php index 7f81e375..e9128d37 100644 --- a/src/Block/Order/Transaction/AbstractCard.php +++ b/src/Block/Order/Transaction/AbstractCard.php @@ -1,4 +1,5 @@ getData('orderId'); + if ($orderId) { + $order = new Order($orderId); + $authorization = $order->get_meta('pagarme_tds_authentication'); + + if (!empty($authorization)) { + $authorization = json_decode($authorization, true); + $value[$this->getLabel('3DS Status')] = __( + AuthenticationStatusEnum::statusMessage( + $authorization['trans_status'] + ), + 'woo-pagarme-payments' + ); + } + } + } catch (\Exception $e) { + } return $value; } @@ -76,7 +96,7 @@ private function getLabel(string $key) /** * @param $key * @param $value - * @return String + * @return string */ public function convertData($key, $value) { diff --git a/src/Concrete/WoocommercePlatformOrderDecorator.php b/src/Concrete/WoocommercePlatformOrderDecorator.php index 2470efe1..1486249a 100644 --- a/src/Concrete/WoocommercePlatformOrderDecorator.php +++ b/src/Concrete/WoocommercePlatformOrderDecorator.php @@ -2,39 +2,39 @@ namespace Woocommerce\Pagarme\Concrete; +use stdClass; +use WC_Order; use Woocommerce\Pagarme\Model\Order; -use Woocommerce\Pagarme\Model\Customer as PagarmeCustomer; -use Woocommerce\Pagarme\Model\Api; -use Woocommerce\Pagarme\Model\Config; -use Woocommerce\Pagarme\Model\Payment as WCModelPayment; use Woocommerce\Pagarme\Helper\Utils; -use Pagarme\Core\Kernel\Abstractions\AbstractPlatformOrderDecorator; +use Woocommerce\Pagarme\Model\Config; +use Pagarme\Core\Payment\Aggregates\Item; use Pagarme\Core\Kernel\Aggregates\Charge; -use Pagarme\Core\Kernel\Interfaces\PlatformInvoiceInterface; +use Pagarme\Core\Kernel\Services\LogService; +use Pagarme\Core\Payment\Aggregates\Address; +use Pagarme\Core\Payment\ValueObjects\Phone; +use Pagarme\Core\Payment\Aggregates\Customer; +use Pagarme\Core\Payment\Aggregates\Shipping; use Pagarme\Core\Kernel\Services\MoneyService; use Pagarme\Core\Kernel\Services\OrderService; use Pagarme\Core\Kernel\ValueObjects\Id\OrderId; use Pagarme\Core\Kernel\ValueObjects\OrderState; use Pagarme\Core\Kernel\ValueObjects\OrderStatus; -use Pagarme\Core\Payment\Aggregates\Address; -use Pagarme\Core\Payment\Aggregates\Customer; -use Pagarme\Core\Payment\Aggregates\Item; -use Pagarme\Core\Payment\Aggregates\Payments\AbstractCreditCardPayment; -use Pagarme\Core\Payment\Aggregates\Payments\AbstractPayment; -use Pagarme\Core\Payment\Aggregates\Payments\BoletoPayment; -use Pagarme\Core\Payment\Aggregates\Payments\NewDebitCardPayment; -use Pagarme\Core\Payment\Aggregates\Payments\NewVoucherPayment; -use Pagarme\Core\Payment\Aggregates\Payments\PixPayment; -use Pagarme\Core\Payment\Aggregates\Shipping; use Pagarme\Core\Payment\Factories\PaymentFactory; -use Pagarme\Core\Payment\Repositories\CustomerRepository as CoreCustomerRepository; -use Pagarme\Core\Payment\ValueObjects\CustomerPhones; use Pagarme\Core\Payment\ValueObjects\CustomerType; -use Pagarme\Core\Payment\ValueObjects\Phone; -use Pagarme\Core\Recurrence\Services\RecurrenceService; use Pagarme\Core\Kernel\Services\LocalizationService; -use Pagarme\Core\Kernel\Services\LogService; -use WC_Order; +use Pagarme\Core\Payment\ValueObjects\CustomerPhones; +use Pagarme\Core\Recurrence\Services\RecurrenceService; +use Pagarme\Core\Payment\Aggregates\Payments\PixPayment; +use Woocommerce\Pagarme\Model\Payment as WCModelPayment; +use Woocommerce\Pagarme\Model\Customer as PagarmeCustomer; +use Pagarme\Core\Payment\Aggregates\Payments\BoletoPayment; +use Pagarme\Core\Kernel\Interfaces\PlatformInvoiceInterface; +use Pagarme\Core\Payment\Aggregates\Payments\AbstractPayment; +use Pagarme\Core\Payment\Aggregates\Payments\NewVoucherPayment; +use Pagarme\Core\Payment\Aggregates\Payments\NewDebitCardPayment; +use Pagarme\Core\Kernel\Abstractions\AbstractPlatformOrderDecorator; +use Pagarme\Core\Payment\Aggregates\Payments\AbstractCreditCardPayment; +use Pagarme\Core\Payment\Repositories\CustomerRepository as CoreCustomerRepository; class WoocommercePlatformOrderDecorator extends AbstractPlatformOrderDecorator { @@ -51,6 +51,9 @@ class WoocommercePlatformOrderDecorator extends AbstractPlatformOrderDecorator private $orderService; + /** @var Customer */ + private $customer; + public function __construct($formData = null, $paymentMethod = null) { $this->i18n = new LocalizationService(); @@ -395,15 +398,32 @@ public function getPaymentCollection() /** @return Customer */ public function getCustomer() { + if (!empty($this->customer)) { + return $this->customer; + } + $customerId = get_current_user_id(); if (!empty($this->getPlatformOrder()->get_user_id())) { $customerId = $this->getPlatformOrder()->get_user_id() ?? null; } if (!empty($customerId)) { - return $this->getRegisteredCustomer($customerId); + $customer = $this->getRegisteredCustomer($customerId); + $this->setCustomer($customer); + return $customer; } - return $this->getGuestCustomer(); + $customer = $this->getGuestCustomer(); + $this->setCustomer($customer); + return $customer; + } + + /** + * @param Customer $customer + * @return void + */ + public function setCustomer($customer) + { + $this->customer = $customer; } /** @@ -580,7 +600,7 @@ public function getPaymentMethodCollection() $payment = new WCModelPayment($this->formData['payment_method']); $pagarmeCustomer = $this->getCustomer(); - $customer = new \stdClass(); + $customer = new stdClass(); $customer->id = $pagarmeCustomer->getPagarmeId() ? $pagarmeCustomer->getPagarmeId()->getValue() : null; @@ -701,6 +721,21 @@ private function extractPaymentDataFromCreditCard( if (!isset($paymentData[$creditCardDataIndex])) { $paymentData[$creditCardDataIndex] = []; } + + if (!empty($this->formData['authentication'])) { + $authenticationFormData = $this->formData['authentication']; + $authentication = new stdClass(); + $authentication->type = 'threed_secure'; + $authentication->status = $authenticationFormData['trans_status']; + + $threeDSecure = new stdClass(); + $threeDSecure->mpi = 'pagarme'; + $threeDSecure->transactionId = $authenticationFormData['tds_server_trans_id']; + + $authentication->threeDSecure = $threeDSecure; + $newPaymentData->authentication = $authentication; + } + $paymentData[$creditCardDataIndex][] = $newPaymentData; } diff --git a/src/Controller/Gateways/CreditCard.php b/src/Controller/Gateways/CreditCard.php index 7285f70f..31f5ebfb 100644 --- a/src/Controller/Gateways/CreditCard.php +++ b/src/Controller/Gateways/CreditCard.php @@ -78,6 +78,11 @@ public function append_form_fields() $fields['cc_allowed_in_subscription'] = $this->field_cc_allowed_for_subscription(); $fields['cc_subscription_installments'] = $this->field_cc_subscription_installments(); } + + $fields['section_tds'] = $this->section_tds(); + $fields['tds_enabled'] = $this->field_cc_tds_enabled(); + $fields['tds_min_amount'] = $this->field_cc_tds_min_amount(); + return $fields; } @@ -384,6 +389,56 @@ public function antifraud_min_value() ]; } + /** + * @return array + */ + public function section_tds() + { + return [ + 'title' => __('3DS settings', 'woo-pagarme-payments'), + 'type' => 'title', + 'custom_attributes' => array( + 'data-field' => 'tds-section', + ) + ]; + } + + /** + * @return array + */ + private function field_cc_tds_enabled() + { + return [ + 'title' => __('Enable', 'woo-pagarme-payments'), + 'type' => 'select', + 'options' => $this->yesnoOptions->toLabelsArray(true), + 'label' => __('Enable 3DS', 'woo-pagarme-payments'), + 'default' => $this->config->getData('cc_tds_enabled') ?? strtolower(Yesno::NO), + 'custom_attributes' => [ + 'data-field' => 'cc-tds-enabled', + ], + ]; + } + + /** + * @return array + */ + private function field_cc_tds_min_amount() + { + return [ + 'title' => __('Minimum value for 3DS authentication', 'woo-pagarme-payments'), + 'type' => 'text', + 'default' => $this->config->getData('cc_tds_min_amount') ?? '', + 'placeholder' => '0.00', + 'custom_attributes' => array( + 'data-field' => 'cc-tds-min-amount', + 'data-mask' => '##0.00', + 'data-mask-reverse' => 'true', + ), + ]; + } + + public function generate_installments_by_flag_html($key, $data) { $fieldKey = $this->get_field_key($key); diff --git a/src/Controller/TdsToken.php b/src/Controller/TdsToken.php new file mode 100644 index 00000000..c3b3b307 --- /dev/null +++ b/src/Controller/TdsToken.php @@ -0,0 +1,30 @@ +config = new Config; + add_action('woocommerce_api_pagarme-tds-token', [$this, 'getTdsToken']); + } + + public function getTdsToken() + { + $accountId = $this->config->getAccountId(); + $tdsTokenService = new TdsTokenService($this->config); + wp_send_json_success([ + 'token' => $tdsTokenService->getTdsToken($accountId) + ]); + wp_die(); + } +} diff --git a/src/Core.php b/src/Core.php index a42991d1..fc1d8c05 100644 --- a/src/Core.php +++ b/src/Core.php @@ -68,6 +68,7 @@ public static function initialize() 'Charges', 'Accounts', 'HubAccounts', + 'TdsToken', ); self::load_controllers($controllers); @@ -346,6 +347,16 @@ public static function credit_card_errors_pt_br() __('Timeout na tokenização.', 'woo-pagarme-payments'), 'card: Can\'t check card form: Invalid element received' => __('Can\'t check card form: Invalid element received.', 'woo-pagarme-payments'), + 'fail_get_token' => + __('Failed to generate Token for 3ds, try again.', 'woo-pagarme-payments'), + 'fail_get_email' => + __('There was a problem finding the email.', 'woo-pagarme-payments'), + 'fail_get_billing_address' => + __('There was a problem finding the addresses.', 'woo-pagarme-payments'), + 'fail_assemble_card_expiry_date' => + __('There was a problem when assembling the card\'s expiration data.', 'woo-pagarme-payments'), + 'fail_assemble_purchase' => + __('There was a problem when assembling the purchase data.', 'woo-pagarme-payments'), ); } } diff --git a/src/Helper/Utils.php b/src/Helper/Utils.php index 0751abc0..0097f4a4 100644 --- a/src/Helper/Utils.php +++ b/src/Helper/Utils.php @@ -17,10 +17,10 @@ class Utils * Sanitize value from custom method * * @since 1.0 - * @param String $name - * @param Mixed $default - * @param String|Array $sanitize - * @return Mixed + * @param string $name + * @param mixed $default + * @param string|array $sanitize + * @return mixed */ public static function request($type, $name, $default, $sanitize = 'rm_tags') { @@ -37,10 +37,10 @@ public static function request($type, $name, $default, $sanitize = 'rm_tags') * Sanitize value from methods post * * @since 1.0 - * @param String $name - * @param Mixed $default - * @param String|Array $sanitize - * @return Mixed + * @param string $name + * @param mixed $default + * @param string|array $sanitize + * @return mixed */ public static function post($name, $default = '', $sanitize = 'rm_tags') { @@ -51,10 +51,10 @@ public static function post($name, $default = '', $sanitize = 'rm_tags') * Sanitize value from methods get * * @since 1.0 - * @param String $name - * @param Mixed $default - * @param String|Array $sanitize - * @return Mixed + * @param string $name + * @param mixed $default + * @param string|array $sanitize + * @return mixed */ public static function get($name, $default = '', $sanitize = 'rm_tags') { @@ -65,10 +65,10 @@ public static function get($name, $default = '', $sanitize = 'rm_tags') * Sanitize value from cookie * * @since 1.0 - * @param String $name - * @param Mixed $default - * @param String|Array $sanitize - * @return Mixed + * @param string $name + * @param mixed $default + * @param string|array $sanitize + * @return mixed */ public static function cookie($name, $default = '', $sanitize = 'rm_tags') { @@ -79,8 +79,8 @@ public static function cookie($name, $default = '', $sanitize = 'rm_tags') * Get filtered super global server by key * * @since 1.0 - * @param String $key - * @return String + * @param string $key + * @return string */ public static function server($key) { @@ -93,9 +93,9 @@ public static function server($key) * Verify request by nonce * * @since 1.0 - * @param String $name - * @param String $action - * @return Boolean + * @param string $name + * @param string $action + * @return bool */ public static function verify_nonce_post($name, $action) { @@ -106,9 +106,9 @@ public static function verify_nonce_post($name, $action) * Sanitize requests * * @since 1.0 - * @param String $value - * @param String|Array $sanitize - * @return String + * @param string $value + * @param string|array $sanitize + * @return string */ public static function sanitize($value, $sanitize) { @@ -127,9 +127,9 @@ public static function sanitize($value, $sanitize) * Properly strip all HTML tags including script and style * * @since 1.0 - * @param Mixed String|Array $value - * @param Boolean $remove_breaks - * @return Mixed String|Array + * @param mixed string|array $value + * @param bool $remove_breaks + * @return mixed string|array */ public static function rm_tags($value, $remove_breaks = false) { @@ -148,9 +148,9 @@ public static function rm_tags($value, $remove_breaks = false) * Find the position of the first occurrence of a substring in a string * * @since 1.0 - * @param String $value - * @param String $search - * @return Boolean + * @param string $value + * @param string $search + * @return bool */ public static function indexof($value, $search) { @@ -161,8 +161,7 @@ public static function indexof($value, $search) * Verify request ajax * * @since 1.0 - * @param null - * @return Boolean + * @return bool */ public static function is_request_ajax() { @@ -174,8 +173,7 @@ public static function is_request_ajax() * Get charset option * * @since 1.0 - * @param Null - * @return String + * @return string */ public static function get_charset() { @@ -186,8 +184,8 @@ public static function get_charset() * Descode html entityes * * @since 1.0 - * @param String $string - * @return String + * @param string $string + * @return string */ public static function html_decode($string) { @@ -198,9 +196,9 @@ public static function html_decode($string) * Get value by array index * * @since 1.0 - * @param Array $args - * @param String|int $index - * @return String + * @param array $args + * @param string|int $index + * @return string */ public static function get_value_by($args, $index, $default = '') { @@ -215,8 +213,8 @@ public static function get_value_by($args, $index, $default = '') * Admin sanitize url * * @since 1.0 - * @param String $path - * @return String + * @param string $path + * @return string */ public static function get_admin_url($path = '') { @@ -227,8 +225,8 @@ public static function get_admin_url($path = '') * Site URL * * @since 1.0 - * @param String $path - * @return String + * @param string $path + * @return string */ public static function get_site_url($path = '') { @@ -239,8 +237,8 @@ public static function get_site_url($path = '') * Permalink url sanitized * * @since 1.0 - * @param Integer $post_id - * @return String + * @param int $post_id + * @return string */ public static function get_permalink($post_id = 0) { @@ -251,9 +249,9 @@ public static function get_permalink($post_id = 0) * Add prefix in string * * @since 1.0 - * @param String $after - * @param String $before - * @return String + * @param string $after + * @param string $before + * @return string */ public static function add_prefix($after, $before = '') { @@ -264,8 +262,8 @@ public static function add_prefix($after, $before = '') * Component attribute with prefix * * @since 1.0 - * @param String $name - * @return String + * @param string $name + * @return string */ public static function get_component($name) { @@ -276,8 +274,7 @@ public static function get_component($name) * Check is plugin settings page * * @since 1.0 - * @param null - * @return Boolean + * @return bool */ public static function is_settings_page() { @@ -288,8 +285,8 @@ public static function is_settings_page() * Format and validate phone number with DDD * * @since 1.0 - * @param String $phone - * @return String + * @param string $phone + * @return string */ public static function format_phone_number($phone) { @@ -306,8 +303,8 @@ public static function format_phone_number($phone) * Format order price with amount * * @since 1.0 - * @param Mixed String|Float|Int $price - * @return Integer + * @param mixed string|float|int $price + * @return int */ public static function format_order_price($price) { @@ -322,7 +319,7 @@ public static function format_order_price($price) * Format order price with a currency symbol * * @since 1.0 - * @param Mixed String|Float|Int $price + * @param mixed string|float|int $price * @return string */ public static function format_order_price_with_currency_symbol($price) @@ -338,8 +335,8 @@ public static function format_order_price_with_currency_symbol($price) * Format desnormalized order price with amount * * @since 1.0 - * @param Mixed String|Float|Int $price - * @return Integer + * @param mixed string|float|int $price + * @return int */ public static function format_desnormalized_order_price($price) { @@ -368,8 +365,8 @@ public static function normalize_price($price) * Format order price to current currency * * @since 1.0 - * @param Int $price - * @return String + * @param int $price + * @return string */ public static function format_order_price_to_view($price) { @@ -387,9 +384,8 @@ public static function format_order_price_to_view($price) * Generate log file * * @since 1.0 - * @param Mixed $data - * @param String $log_name - * @return Void + * @param mixed $data + * @param string $log_name */ public static function log($data, $log_name = 'debug') { @@ -474,8 +470,7 @@ public static function is_cnpj($cnpj = null) * Get the settings option key * * @since 1.0 - * @param Null - * @return String + * @return string */ public static function get_option_key() { @@ -488,8 +483,8 @@ public static function get_option_key() * Format document number * * @since 1.0 - * @param String $document - * @return String + * @param string $document + * @return string */ public static function format_document($document) { @@ -500,8 +495,8 @@ public static function format_document($document) * Get the order id by meta value * * @since 1.0 - * @param String $meta_value - * @return Integer + * @param string $meta_value + * @return int */ public static function get_order_by_meta_value($meta_value) { @@ -525,9 +520,9 @@ public static function get_order_by_meta_value($meta_value) /** * Get date formatted for SQL * - * @param String $date - * @param String $format - * @return String + * @param string $date + * @param string $format + * @return string */ public static function convert_date_for_sql($date, $format = 'Y-m-d') { @@ -537,11 +532,11 @@ public static function convert_date_for_sql($date, $format = 'Y-m-d') /** * Conversion of date * - * @param String $date - * @param String $format - * @param String $search - * @param String $replace - * @return String + * @param string $date + * @param string $format + * @param string $search + * @param string $replace + * @return string */ public static function convert_date($date, $format = 'Y-m-d', $search = '/', $replace = '-') { diff --git a/src/Model/Checkout.php b/src/Model/Checkout.php index cf94f39f..90ea6eae 100644 --- a/src/Model/Checkout.php +++ b/src/Model/Checkout.php @@ -129,7 +129,7 @@ public function process(WC_Order $wc_order = null, string $type = CheckoutTypes: $order = new Order($wc_order->get_id()); $totalWithInstallments = $order->getTotalAmountByCharges(); $order->pagarme_card_tax = $order->calculateInstallmentFee($totalWithInstallments, $wc_order->get_total()); - $order->wc_order->set_total($this->getTotalValue($wc_order, $totalWithInstallments)); + $order->getWcOrder()->set_total($this->getTotalValue($wc_order, $totalWithInstallments)); $order->payment_method = $fields['payment_method']; WC()->cart->empty_cart(); if ($response) { @@ -138,6 +138,7 @@ public function process(WC_Order $wc_order = null, string $type = CheckoutTypes: $order->pagarme_id = $response->getPagarmeId()->getValue(); $order->pagarme_status = $response->getStatus()->getStatus(); $this->addInstallmentsOnMetaData($order, $fields); + $this->addAuthenticationOnMetaData($order, $fields); $order->response_data = json_encode($response); $order->update_by_pagarme_status($response->getStatus()->getStatus()); return true; @@ -168,6 +169,15 @@ private function convertCheckoutObject(PaymentRequestInterface $paymentRequest) if ($value = $card->getWalletId()) { $fields['card_id'] = $value; } + + $authentication = $card->getAuthentication(); + + if (!empty($authentication)) { + $fields['authentication'] = json_decode( + stripslashes($authentication), + true + ); + } } else { if ($orderValue = $card->getOrderValue()) { $fields['card_order_value' . $key] = $orderValue; @@ -200,6 +210,14 @@ private function addInstallmentsOnMetaData(&$order, $fields) } } + private function addAuthenticationOnMetaData(&$order, $fields) + { + if (!array_key_exists('authentication', $fields)) { + return; + } + $order->pagarme_tds_authentication = json_encode($fields["authentication"]); + } + private function extractMulticustomers(array &$fields, PaymentRequestInterface $paymentRequest) { foreach ($paymentRequest->getData() as $method => $data) { diff --git a/src/Model/Config.php b/src/Model/Config.php index c2273faa..8978c960 100644 --- a/src/Model/Config.php +++ b/src/Model/Config.php @@ -333,6 +333,16 @@ public function isVoucherEnabled() return $this->isEnabled('enable_voucher'); } + public function isTdsEnabled() + { + return $this->isEnabled('tds_enabled'); + } + + public function getTdsMinAmount() + { + return $this->getData('tds_min_amount'); + } + public function isAnyBilletMethodEnabled() { return $this->isBilletEnabled() diff --git a/src/Model/Order.php b/src/Model/Order.php index f54eeb11..9eb4cda3 100644 --- a/src/Model/Order.php +++ b/src/Model/Order.php @@ -59,7 +59,7 @@ class Order extends Meta public function __construct($ID = false) { parent::__construct($ID); - $this->wc_order = $this->getWcOrder($ID); + $this->wc_order = $this->getWcOrderById($ID); $this->settings = new Config(); } /** phpcs:enable */ @@ -257,7 +257,12 @@ public function isPagarmePaymentMethod() return false; } - public function getWcOrder($id = false) + public function getWcOrder() + { + return $this->wc_order; + } + + private function getWcOrderById($id = false) { global $theorder; if(empty($theorder) || ((int)$id !== $theorder->get_id() && $id !== false)) { diff --git a/src/Model/Payment/CreditCard.php b/src/Model/Payment/CreditCard.php index 9e7faa43..5f720fbd 100644 --- a/src/Model/Payment/CreditCard.php +++ b/src/Model/Payment/CreditCard.php @@ -68,6 +68,8 @@ public function getConfigDataProvider() $brand = new $class; $jsConfigProvider['brands'][$brand->getBrandCode()] = $brand->getConfigDataProvider(); } + $jsConfigProvider['tdsEnabled'] = $this->getConfig()->isTdsEnabled(); + $jsConfigProvider['tdsMinAmount'] = $this->getConfig()->getTdsMinAmount(); return $jsConfigProvider; } diff --git a/src/Service/TdsTokenService.php b/src/Service/TdsTokenService.php new file mode 100644 index 00000000..cf11d5d7 --- /dev/null +++ b/src/Service/TdsTokenService.php @@ -0,0 +1,44 @@ +coreAuth = new CoreAuth(''); + $this->config = $config; + } + + /** + * @param string $accountId + * @return string + */ + public function getTdsToken($accountId) + { + $tdsTokenProxy = new TdsTokenProxy($this->coreAuth); + $environment = 'live'; + if ($this->config->getIsSandboxMode()) { + $environment = 'test'; + } + return $tdsTokenProxy->getTdsToken($environment, $accountId)->tdsToken; + } +} diff --git a/templates/checkout/form/billet.phtml b/templates/checkout/form/billet.phtml index bb4d58c2..3a15788c 100644 --- a/templates/checkout/form/billet.phtml +++ b/templates/checkout/form/billet.phtml @@ -24,7 +24,7 @@ if (!function_exists('add_action')) { diff --git a/templates/checkout/form/card.phtml b/templates/checkout/form/card.phtml index 2f7d672f..1ee434a5 100644 --- a/templates/checkout/form/card.phtml +++ b/templates/checkout/form/card.phtml @@ -46,7 +46,7 @@ wp_localize_script( @@ -63,7 +63,7 @@ wp_localize_script( ")},Wt=function(t,e){var n=e.showClass||{};t.className="".concat(w.popup," ").concat(mt(t)?n.popup:""),e.toast?(rt([document.documentElement,document.body],w["toast-shown"]),rt(t,w.toast)):rt(t,w.modal),et(t,e,"popup"),"string"==typeof e.customClass&&rt(t,e.customClass),e.icon&&rt(t,w["icon-".concat(e.icon)])},Kt=function(t){var e=document.createElement("li");return rt(e,w["progress-step"]),Q(e,t),e},Yt=function(t){var e=document.createElement("li");return rt(e,w["progress-step-line"]),t.progressStepsDistance&&ut(e,"width",t.progressStepsDistance),e},Zt=function(t,e){!function(t,e){var n=j(),o=H();if(n&&o){if(e.toast){ut(n,"width",e.width),o.style.width="100%";var i=W();i&&o.insertBefore(i,D())}else ut(o,"width",e.width);ut(o,"padding",e.padding),e.color&&(o.style.color=e.color),e.background&&(o.style.background=e.background),lt(N()),Wt(o,e)}}(0,e),xt(0,e),function(t,e){var n=R();if(n){var o=e.progressSteps,i=e.currentProgressStep;o&&0!==o.length&&void 0!==i?(st(n),n.textContent="",i>=o.length&&E("Invalid currentProgressStep parameter, it should be less than progressSteps.length (currentProgressStep like JS arrays starts from 0)"),o.forEach((function(t,r){var a=Kt(t);if(n.appendChild(a),r===i&&rt(a,w["active-progress-step"]),r!==o.length-1){var c=Yt(e);n.appendChild(c)}}))):lt(n)}}(0,e),function(t,e){var n=St.innerParams.get(t),o=D();if(o){if(n&&e.icon===n.icon)return Ft(o,e),void Rt(o,e);if(e.icon||e.iconHtml){if(e.icon&&-1===Object.keys(C).indexOf(e.icon))return P('Unknown icon! Expected "success", "error", "warning", "info" or "question", got "'.concat(e.icon,'"')),void lt(o);st(o),Ft(o,e),Rt(o,e),rt(o,e.showClass&&e.showClass.icon)}else lt(o)}}(t,e),function(t,e){var n=_();n&&(e.imageUrl?(st(n,""),n.setAttribute("src",e.imageUrl),n.setAttribute("alt",e.imageAlt||""),ut(n,"width",e.imageWidth),ut(n,"height",e.imageHeight),n.className=w.image,et(n,e,"image")):lt(n))}(0,e),function(t,e){var n=q();n&&(dt(n),pt(n,e.title||e.titleText,"block"),e.title&&At(e.title,n),e.titleText&&(n.innerText=e.titleText),et(n,e,"title"))}(0,e),function(t,e){var n=$();n&&(Q(n,e.closeButtonHtml||""),et(n,e,"closeButton"),pt(n,e.showCloseButton),n.setAttribute("aria-label",e.closeButtonAriaLabel||""))}(0,e),_t(t,e),Bt(0,e),function(t,e){var n=Y();n&&(dt(n),pt(n,e.footer,"block"),e.footer&&At(e.footer,n),et(n,e,"footer"))}(0,e);var n=H();"function"==typeof e.didRender&&n&&e.didRender(n)},$t=function(){var t;return null===(t=F())||void 0===t?void 0:t.click()},Jt=Object.freeze({cancel:"cancel",backdrop:"backdrop",close:"close",esc:"esc",timer:"timer"}),Xt=function(t){t.keydownTarget&&t.keydownHandlerAdded&&(t.keydownTarget.removeEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!1)},Gt=function(t,e){var n,o=J();if(o.length)return(t+=e)===o.length?t=0:-1===t&&(t=o.length-1),void o[t].focus();null===(n=H())||void 0===n||n.focus()},Qt=["ArrowRight","ArrowDown"],te=["ArrowLeft","ArrowUp"],ee=function(t,e,n){t&&(e.isComposing||229===e.keyCode||(t.stopKeydownPropagation&&e.stopPropagation(),"Enter"===e.key?ne(e,t):"Tab"===e.key?oe(e):[].concat(Qt,te).includes(e.key)?ie(e.key):"Escape"===e.key&&re(e,t,n)))},ne=function(t,e){if(x(e.allowEnterKey)){var n=nt(H(),e.input);if(t.target&&n&&t.target instanceof HTMLElement&&t.target.outerHTML===n.outerHTML){if(["textarea","file"].includes(e.input))return;$t(),t.preventDefault()}}},oe=function(t){for(var e=t.target,n=J(),o=-1,i=0;igetCompoenent() ?> data-pagarmecheckout-app-id="= esc_attr($this->getConfig()->getPublicKey()); ?>"> -\n \n \n \n',n=n.replace(/ style=".*?"/g,"");else if("error"===e.icon)o='\n \n \n \n \n';else if(e.icon){o=zt({question:"?",warning:"!",info:"i"}[e.icon])}n.trim()!==o.trim()&&Q(t,o)}},Ut=function(t,e){if(e.iconColor){t.style.color=e.iconColor,t.style.borderColor=e.iconColor;for(var n=0,o=[".swal2-success-line-tip",".swal2-success-line-long",".swal2-x-mark-line-left",".swal2-x-mark-line-right"];n+@@ -133,7 +133,7 @@ wp_localize_script( data-element="document-holder" data-mask="000.000.000-00" class="input-text wc-credit-card-form-card-cvv pagarme-card-form-holder-number" maxlength="14" - placeholder="CPF" data-required="true" data-pagarmecheckout-element="holder_document"> + placeholder="CPF" data-required="true" data-pagarme-element="holder_document"> = $this->createBlock( diff --git a/templates/checkout/form/card/tds.phtml b/templates/checkout/form/card/tds.phtml new file mode 100644 index 00000000..c96c2fed --- /dev/null +++ b/templates/checkout/form/card/tds.phtml @@ -0,0 +1,24 @@ +canInitTds()) { + return; +} + +?> + ++ data-required="true" class="input-text" data-pagarme-element="holder_name">
- + + data-required="true" data-pagarme-element="number"> + data-pagarme-element="brand-input"/>
++ \ No newline at end of file diff --git a/templates/checkout/form/field/card-save.phtml b/templates/checkout/form/field/card-save.phtml index 42a5f43b..1c847c74 100644 --- a/templates/checkout/form/field/card-save.phtml +++ b/templates/checkout/form/field/card-save.phtml @@ -1,4 +1,5 @@ getIsEnableWallet()) : ?> +- + \ No newline at end of file diff --git a/templates/checkout/payment/credit-card.phtml b/templates/checkout/payment/credit-card.phtml index 54ecdc85..bd1381eb 100644 --- a/templates/checkout/payment/credit-card.phtml +++ b/templates/checkout/payment/credit-card.phtml @@ -1,4 +1,5 @@ createBlock( 'qty_cards' => $this->getQtyCards() ] )->toHtml(); + +$this->createBlock( + '\Woocommerce\Pagarme\Block\Checkout\Form\Tds', + 'pagarme.checkout.form.tds', + [ + 'payment_instance' => $this->getPaymentInstance() + ] +)->toHtml(); diff --git a/templates/order/charge.phtml b/templates/order/charge.phtml index fadf32c6..677aac88 100644 --- a/templates/order/charge.phtml +++ b/templates/order/charge.phtml @@ -29,7 +29,8 @@ if (!function_exists('add_action')) { $this->getTransactionClass($transaction), 'pagarme.order.charge.transaction', [ - 'transaction' => $transaction + 'transaction' => $transaction, + 'orderId' => $this->getCharge()->getCode() ] )->toHtml(); ?> diff --git a/tests/Concrete/WoocommercePlatformOrderDecoratorTest.php b/tests/Concrete/WoocommercePlatformOrderDecoratorTest.php new file mode 100644 index 00000000..40b709bb --- /dev/null +++ b/tests/Concrete/WoocommercePlatformOrderDecoratorTest.php @@ -0,0 +1,103 @@ +shouldReceive('get_payment_data') + ->andReturn([ + [ + 'payment_method' => 'credit_card', + 'credit_card' => [ + 'installments' => 1, + 'statement_descriptor' => '', + 'capture' => null, + 'card' => [ + 'billing_address' => [ + 'street' => 'test street', + 'complement' => 'test', + 'number' => '123', + 'zip_code' => '1234567', + 'neighborhood' => 'neighborhood', + 'city' => 'city', + 'state' => 'SP', + 'country' => 'BR', + ], + 'card_token' => 'token_test' + ] + ], + 'amount' => 1000 + ] + ]); + + $paymentMethodName = 'credit_card'; + + $formData = [ + 'payment_method' => $paymentMethodName, + 'brand' => 'visa', + 'installments' => 1, + 'authentication' => ['trans_status' => 'Y', 'tds_server_trans_id' => 'test-trans-id'], + 'pagarmetoken1' => 'token_test' + ]; + + $platformOrderDecorator = new WoocommercePlatformOrderDecorator($formData, 'credit_card'); + + $customerIdMock = Mockery::mock(CustomerId::class); + $customerIdMock->shouldReceive('getValue') + ->andReturn(1); + + $customer = new Customer(); + $customerMock = Mockery::mock($customer); + $customerMock->shouldReceive('getPagarmeId') + ->andReturn($customerIdMock); + $platformOrderDecorator->setCustomer($customerMock); + + $platformOrderMock = Mockery::mock(WC_Order::class); + $platformOrderMock->shouldReceive('get_total') + ->andReturn(10); + $platformOrderMock->shouldReceive('get_total_tax') + ->andReturn(0); + + $platformOrderDecorator->setPlatformOrder($platformOrderMock); + + + $paymentFactoryMock->shouldReceive('createFromJson') + ->withArgs(function ($data) { + $formatedData = json_decode($data, true); + + $card = current($formatedData[AbstractCreditCardPayment::getBaseCode()]); + + return $card['authentication']['status'] === 'Y' + && $card['authentication']['threeDSecure']['transactionId'] === 'test-trans-id'; + }) + ->andReturn([]); + + $result = $platformOrderDecorator->getPaymentMethodCollection(); + + $this->assertIsArray($result); + } +} diff --git a/tests/Model/CheckoutTest.php b/tests/Model/CheckoutTest.php new file mode 100644 index 00000000..88a0bcc4 --- /dev/null +++ b/tests/Model/CheckoutTest.php @@ -0,0 +1,149 @@ +shouldReceive('getBrand') + ->andReturn('visa'); + $cardMock->shouldReceive('getInstallment') + ->andReturn(1); + $cardMock->shouldReceive('getAuthentication') + ->andReturn("{\"trans_status\":\"Y\",\"tds_server_trans_id\":\"test-trans-id\"}"); + $cardMock->shouldReceive('getToken') + ->andReturn('token_test'); + $cardMock->shouldReceive('getOrderValue') + ->andReturnFalse(); + $cardMock->shouldReceive('getSaveCard') + ->andReturnFalse(); + $cardMock->shouldReceive('getWalletId') + ->andReturnFalse(); + + $paymentRequestMock = Mockery::mock(PaymentRequest::class); + $paymentRequestMock->shouldReceive('getPaymentMethod') + ->andReturn('credit_card'); + $paymentRequestMock->shouldReceive('getCards') + ->andReturn([$cardMock]); + $paymentRequestMock->shouldReceive('getData') + ->andReturn([]); + + $_POST[PaymentRequestInterface::PAGARME_PAYMENT_REQUEST_KEY] = $paymentRequestMock; + + $subscriptionMock = Mockery::mock('alias:Woocommerce\Pagarme\Model\Subscription'); + $subscriptionMock->shouldReceive('getRecurrenceCycle') + ->andReturnNull(); + + $orderIdMock = Mockery::mock(OrderId::class); + $orderIdMock->shouldReceive('getValue') + ->andReturn(1); + + $order = new Order(); + $orderMock = Mockery::mock($order); + $orderMock->shouldReceive('getPagarmeId') + ->andReturn($orderIdMock); + + $orderMock->shouldReceive('getStatus') + ->andReturn(OrderStatus::paid()); + + $wcOrderMock = Mockery::mock(WC_Order::class); + $wcOrderMock->shouldReceive('get_total') + ->andReturn(10); + $wcOrderMock->shouldReceive('get_id') + ->andReturn(1); + $wcOrderMock->shouldReceive('set_total') + ->andReturnSelf(); + + $ordersMock->shouldReceive('create_order') + ->withArgs(function ($wcOrder, $paymentMethod, $fields) use ($wcOrderMock) { + return $wcOrder === $wcOrderMock + && $paymentMethod === 'credit_card' + && $fields['authentication']['trans_status'] === 'Y' + && $fields['authentication']['tds_server_trans_id'] === 'test-trans-id'; + }) + ->andReturn($orderMock); + + $orderModelMock = Mockery::mock('overload:Woocommerce\Pagarme\Model\Order'); + $orderModelMock->shouldReceive('getTotalAmountByCharges') + ->andReturn(10); + $orderModelMock->shouldReceive('calculateInstallmentFee') + ->andReturn(0); + $orderModelMock->shouldReceive('update_by_pagarme_status') + ->andReturnSelf(); + $orderModelMock->shouldReceive('getWcOrder') + ->andReturn($wcOrderMock); + + $wcCheckoutMock = Mockery::mock(WC_Checkout::class); + $wcCheckoutMock->shouldReceive('empty_cart') + ->andReturnSelf(); + $woocommerce = new stdClass(); + $woocommerce->cart = $wcCheckoutMock; + Brain\Monkey\Functions\stubs([ + 'WC' => $woocommerce, + ]); + + Brain\Monkey\Functions\stubs([ + 'wp_strip_all_tags', + ]); + + Brain\Monkey\Functions\expect('add_action') + ->once(); + + Brain\Monkey\Functions\expect('do_action') + ->once(); + + $checkout = new Checkout($gatewayMock, $configMock, $ordersMock, $wooOrderRepositoryMock); + + $this->assertTrue($checkout->process($wcOrderMock)); + } +} diff --git a/tests/Model/CustomerTest.php b/tests/Model/CustomerTest.php index ead8e510..a13a6796 100644 --- a/tests/Model/CustomerTest.php +++ b/tests/Model/CustomerTest.php @@ -333,4 +333,4 @@ public function testGetPagarmeCustomerIdShouldReturnPagarmeCustomerIdValue() $this->assertSame($id, $responsePagarmeCustomerId); } -} \ No newline at end of file +} diff --git a/tests/Service/AccountServiceTest.php b/tests/Service/AccountServiceTest.php index 91678df5..7e538e9d 100644 --- a/tests/Service/AccountServiceTest.php +++ b/tests/Service/AccountServiceTest.php @@ -4,13 +4,16 @@ use Mockery; use Pagarme\Core\Middle\Model\Account\PaymentEnum; -use Pagarme\Core\Middle\Proxy\AccountProxy; use PagarmeCoreApiLib\Models\GetAccountResponse; use PHPUnit\Framework\TestCase; use Woocommerce\Pagarme\Model\Config; use Woocommerce\Pagarme\Model\CoreAuth; use Woocommerce\Pagarme\Service\AccountService; +/** + * @runTestsInSeparateProcesses + * @preserveGlobalState disabled + */ class AccountServiceTest extends TestCase { public function tearDown(): void diff --git a/tests/Service/TdsTokenServiceTest.php b/tests/Service/TdsTokenServiceTest.php new file mode 100644 index 00000000..8667d6be --- /dev/null +++ b/tests/Service/TdsTokenServiceTest.php @@ -0,0 +1,69 @@ +shouldReceive('getIsSandboxMode') + ->andReturnFalse(); + + $tdsTokenService = new TdsTokenService($configMock); + + $token = 'tokentds'; + $getTdsTokenResponseMock = Mockery::mock(GetTdsTokenResponse::class); + $getTdsTokenResponseMock->tdsToken = $token; + + $tdsTokenProxyMock = Mockery::mock('overload:Pagarme\Core\Middle\Proxy\TdsTokenProxy'); + + + $accountId = 'acc_test'; + $tdsTokenProxyMock->shouldReceive('getTdsToken') + ->with('live', $accountId) + ->andReturn($getTdsTokenResponseMock); + + $this->assertSame($token, $tdsTokenService->getTdsToken($accountId)); + } + + public function testShoudGetTdsTokenWithTestEnviroment() + { + Mockery::mock('overload:Woocommerce\Pagarme\Model\CoreAuth'); + $configMock = Mockery::mock(Config::class); + $configMock->shouldReceive('getIsSandboxMode') + ->andReturnTrue(); + + $tdsTokenService = new TdsTokenService($configMock); + + $token = 'tokentds'; + $getTdsTokenResponseMock = Mockery::mock(GetTdsTokenResponse::class); + $getTdsTokenResponseMock->tdsToken = $token; + + $tdsTokenProxyMock = Mockery::mock('overload:Pagarme\Core\Middle\Proxy\TdsTokenProxy'); + + + $accountId = 'acc_test'; + $tdsTokenProxyMock->shouldReceive('getTdsToken') + ->with('test', $accountId) + ->andReturn($getTdsTokenResponseMock); + + $this->assertSame($token, $tdsTokenService->getTdsToken($accountId)); + } +} diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index ae45d786..2e6317ca 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -7,6 +7,7 @@ return array( 'apimatic\\jsonmapper\\' => array($vendorDir . '/apimatic/jsonmapper/src'), + 'Woocommerce\\Pagarme\\Tests\\' => array($baseDir . '/tests'), 'Woocommerce\\Pagarme\\' => array($baseDir . '/src'), 'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'), 'Pagarme\\Core\\Test\\Mock\\' => array($vendorDir . '/pagarme/ecommerce-module-core/tests/mock'), diff --git a/vendor/composer/autoload_real.php b/vendor/composer/autoload_real.php index 815ff091..94f0e491 100644 --- a/vendor/composer/autoload_real.php +++ b/vendor/composer/autoload_real.php @@ -22,6 +22,8 @@ public static function getLoader() return self::$loader; } + require __DIR__ . '/platform_check.php'; + spl_autoload_register(array('ComposerAutoloaderInitbb567e266966327c41fd47379c4c230d', 'loadClassLoader'), true, true); self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); spl_autoload_unregister(array('ComposerAutoloaderInitbb567e266966327c41fd47379c4c230d', 'loadClassLoader')); diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 3c754df5..55fd85d4 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -13,6 +13,7 @@ class ComposerStaticInitbb567e266966327c41fd47379c4c230d ), 'W' => array ( + 'Woocommerce\\Pagarme\\Tests\\' => 26, 'Woocommerce\\Pagarme\\' => 20, ), 'P' => @@ -34,6 +35,10 @@ class ComposerStaticInitbb567e266966327c41fd47379c4c230d array ( 0 => __DIR__ . '/..' . '/apimatic/jsonmapper/src', ), + 'Woocommerce\\Pagarme\\Tests\\' => + array ( + 0 => __DIR__ . '/../..' . '/tests', + ), 'Woocommerce\\Pagarme\\' => array ( 0 => __DIR__ . '/../..' . '/src', diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 4a4a6014..e9ab6a5c 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -260,23 +260,23 @@ }, { "name": "pagarme/ecommerce-module-core", - "version": "2.3.1", - "version_normalized": "2.3.1.0", + "version": "2.4.1", + "version_normalized": "2.4.1.0", "source": { "type": "git", "url": "https://github.com/pagarme/ecommerce-module-core.git", - "reference": "9c9e927cea9b1bf90a499d2146f042f1f7f1c921" + "reference": "3e75e5365882c6806f2ac76e6901ee17815d101e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pagarme/ecommerce-module-core/zipball/9c9e927cea9b1bf90a499d2146f042f1f7f1c921", - "reference": "9c9e927cea9b1bf90a499d2146f042f1f7f1c921", + "url": "https://api.github.com/repos/pagarme/ecommerce-module-core/zipball/3e75e5365882c6806f2ac76e6901ee17815d101e", + "reference": "3e75e5365882c6806f2ac76e6901ee17815d101e", "shasum": "" }, "require": { "ext-json": "*", "monolog/monolog": "<3", - "pagarme/pagarmecoreapi": "v5.6.3", + "pagarme/pagarmecoreapi": "v5.6.4", "php": ">=7.1" }, "require-dev": { @@ -285,7 +285,7 @@ "nesbot/carbon": "1.39.0", "phpunit/phpunit": "^5 | ^6 | ^7 | ^8 | ^9" }, - "time": "2023-11-14T15:38:42+00:00", + "time": "2024-03-07T13:35:21+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -306,23 +306,23 @@ ], "description": "Core component for Pagar.me e-commerce platform modules.", "support": { - "source": "https://github.com/pagarme/ecommerce-module-core/tree/2.3.1" + "source": "https://github.com/pagarme/ecommerce-module-core/tree/2.4.1" }, "install-path": "../pagarme/ecommerce-module-core" }, { "name": "pagarme/pagarmecoreapi", - "version": "v5.6.3", - "version_normalized": "5.6.3.0", + "version": "v5.6.4", + "version_normalized": "5.6.4.0", "source": { "type": "git", "url": "https://github.com/pagarme/pagarme-core-api-php.git", - "reference": "49e0d222c50c69ac3e0debea9b69202e6555d3ef" + "reference": "acab7709b2579221417946b261f6c24710604eb8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pagarme/pagarme-core-api-php/zipball/49e0d222c50c69ac3e0debea9b69202e6555d3ef", - "reference": "49e0d222c50c69ac3e0debea9b69202e6555d3ef", + "url": "https://api.github.com/repos/pagarme/pagarme-core-api-php/zipball/acab7709b2579221417946b261f6c24710604eb8", + "reference": "acab7709b2579221417946b261f6c24710604eb8", "shasum": "" }, "require": { @@ -336,7 +336,7 @@ "require-dev": { "squizlabs/php_codesniffer": "^2.7" }, - "time": "2023-09-28T18:22:12+00:00", + "time": "2023-12-15T13:58:12+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -365,7 +365,7 @@ ], "support": { "issues": "https://github.com/pagarme/pagarme-core-api-php/issues", - "source": "https://github.com/pagarme/pagarme-core-api-php/tree/v5.6.3" + "source": "https://github.com/pagarme/pagarme-core-api-php/tree/v5.6.4" }, "install-path": "../pagarme/pagarmecoreapi" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 04b5102c..1d2e8aa5 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -47,18 +47,18 @@ 'dev_requirement' => false, ), 'pagarme/ecommerce-module-core' => array( - 'pretty_version' => '2.3.1', - 'version' => '2.3.1.0', - 'reference' => '9c9e927cea9b1bf90a499d2146f042f1f7f1c921', + 'pretty_version' => '2.4.1', + 'version' => '2.4.1.0', + 'reference' => '3e75e5365882c6806f2ac76e6901ee17815d101e', 'type' => 'library', 'install_path' => __DIR__ . '/../pagarme/ecommerce-module-core', 'aliases' => array(), 'dev_requirement' => false, ), 'pagarme/pagarmecoreapi' => array( - 'pretty_version' => 'v5.6.3', - 'version' => '5.6.3.0', - 'reference' => '49e0d222c50c69ac3e0debea9b69202e6555d3ef', + 'pretty_version' => 'v5.6.4', + 'version' => '5.6.4.0', + 'reference' => 'acab7709b2579221417946b261f6c24710604eb8', 'type' => 'library', 'install_path' => __DIR__ . '/../pagarme/pagarmecoreapi', 'aliases' => array(), diff --git a/vendor/composer/platform_check.php b/vendor/composer/platform_check.php new file mode 100644 index 00000000..6d3407db --- /dev/null +++ b/vendor/composer/platform_check.php @@ -0,0 +1,26 @@ += 70100)) { + $issues[] = 'Your Composer dependencies require a PHP version ">= 7.1.0". You are running ' . PHP_VERSION . '.'; +} + +if ($issues) { + if (!headers_sent()) { + header('HTTP/1.1 500 Internal Server Error'); + } + if (!ini_get('display_errors')) { + if (PHP_SAPI === 'cli' || PHP_SAPI === 'phpdbg') { + fwrite(STDERR, 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . implode(PHP_EOL, $issues) . PHP_EOL.PHP_EOL); + } elseif (!headers_sent()) { + echo 'Composer detected issues in your platform:' . PHP_EOL.PHP_EOL . str_replace('You are running '.PHP_VERSION.'.', '', implode(PHP_EOL, $issues)) . PHP_EOL.PHP_EOL; + } + } + trigger_error( + 'Composer detected issues in your platform: ' . implode(' ', $issues), + E_USER_ERROR + ); +} diff --git a/vendor/pagarme/ecommerce-module-core/catalog-info.yaml b/vendor/pagarme/ecommerce-module-core/catalog-info.yaml deleted file mode 100644 index 4989ab4b..00000000 --- a/vendor/pagarme/ecommerce-module-core/catalog-info.yaml +++ /dev/null @@ -1,21 +0,0 @@ ---- -apiVersion: backstage.io/v1alpha1 -kind: Component -metadata: - name: ECOMMERCE MODULE CORE - title: ECOMMERCE MODULE CORE - description: Modulo opensource para unificação de integração para a P&G - namespace: pagarme-psp - annotations: - legacy.stone.tech/owner-email: opensource@pagar.me - legacy.stone.tech/prod-date: 2021-03-30 - labels: - legacy.stone.tech/internal-user-auth-base: not-applicable - legacy.stone.tech/access-request-type: not-applicable - legacy.stone.tech/handle-lgpd: false - legacy.stone.tech/customer-auth-method: not-applicable - stone.tech/endpoint-type: none -spec: - type: library - lifecycle: production - owner: pagarme/opensource-apps-team \ No newline at end of file diff --git a/vendor/pagarme/ecommerce-module-core/composer.json b/vendor/pagarme/ecommerce-module-core/composer.json index 9219d50f..f3afe9d1 100644 --- a/vendor/pagarme/ecommerce-module-core/composer.json +++ b/vendor/pagarme/ecommerce-module-core/composer.json @@ -2,7 +2,7 @@ "name": "pagarme/ecommerce-module-core", "description": "Core component for Pagar.me e-commerce platform modules.", "license": "MIT", - "version": "2.3.1", + "version": "2.4.1", "authors": [ { "name":"Open Source Team" @@ -12,7 +12,7 @@ "require": { "php": ">=7.1", "monolog/monolog": "<3", - "pagarme/pagarmecoreapi": "v5.6.3", + "pagarme/pagarmecoreapi": "v5.6.4", "ext-json": "*" }, "require-dev": { diff --git a/vendor/pagarme/ecommerce-module-core/src/Kernel/Aggregates/Order.php b/vendor/pagarme/ecommerce-module-core/src/Kernel/Aggregates/Order.php index c7aac1ee..cce93df5 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Kernel/Aggregates/Order.php +++ b/vendor/pagarme/ecommerce-module-core/src/Kernel/Aggregates/Order.php @@ -104,6 +104,24 @@ public function getCharges() return $this->charges; } + + /** + * + * @return Transaction|null + */ + public function getPixOrBilletTransaction() + { + foreach ($this->getCharges() as $charge) { + foreach ($charge->getTransactions() as $transaction) { + $type = $transaction->getTransactionType()->getType(); + if ($type === 'pix' || $type === 'boleto') { + return $transaction; + } + } + } + return null; + } + public function applyOrderStatusFromCharges() { if (empty($this->getCharges())) { diff --git a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php index a6b0f7ba..b4605104 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php +++ b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/LogService.php @@ -98,7 +98,7 @@ public function exception(\Exception $exception) $logObject = $this->prepareObject($exception); $code = ' | Exception code: ' . $exception->getCode(); $this->monolog->error($exception->getMessage() . $code, $logObject); - + } catch (\Throwable $th) { //throw $th; } @@ -184,7 +184,9 @@ private function blurSensitiveData($logObject) } } return $logObject; - } catch (\Exception $e) {} + } catch (\Exception $e) { + $this->exception($e); + } } /** diff --git a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderLogService.php b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderLogService.php index 73ea0fc7..600b412a 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderLogService.php +++ b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderLogService.php @@ -16,7 +16,7 @@ public function orderInfo($orderCode, $message, $sourceObject = null) $orderMessage = "Order #$orderCode : $message"; parent::info($orderMessage, $sourceObject); } catch (\Throwable $throwable) { - + $this->orderException($throwable, $orderCode); } } diff --git a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderService.php b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderService.php index 21577910..ee1431ef 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderService.php +++ b/vendor/pagarme/ecommerce-module-core/src/Kernel/Services/OrderService.php @@ -243,13 +243,6 @@ public function cancelAtPagarmeByPlatformOrder(PlatformOrderInterface $platformO public function createOrderAtPagarme(PlatformOrderInterface $platformOrder) { try { - $orderInfo = $this->getOrderInfo($platformOrder); - - $this->logService->orderInfo( - $platformOrder->getCode(), - 'Creating order.', - $orderInfo - ); //set pending $platformOrder->setState(OrderState::stateNew()); @@ -257,6 +250,11 @@ public function createOrderAtPagarme(PlatformOrderInterface $platformOrder) //build PaymentOrder based on platformOrder $paymentOrder = $this->extractPaymentOrderFromPlatformOrder($platformOrder); + $this->logService->orderInfo( + $platformOrder->getCode(), + 'Creating order.', + $paymentOrder + ); $i18n = new LocalizationService(); @@ -270,13 +268,13 @@ public function createOrderAtPagarme(PlatformOrderInterface $platformOrder) $this->logService->orderInfo( $platformOrder->getCode(), "Can't create order. - Force Create Order: {$forceCreateOrder} | Order or charge status failed", - $orderInfo + $paymentOrder ); $charges = $this->createChargesFromResponse($response); $errorMessages = $this->cancelChargesAtPagarme($charges); - $this->addChargeMessagesToLog($platformOrder, $orderInfo, $errorMessages); + $this->addChargeMessagesToLog($platformOrder, $paymentOrder, $errorMessages); $this->persistListChargeFailed($response); @@ -312,7 +310,7 @@ public function createOrderAtPagarme(PlatformOrderInterface $platformOrder) $this->logService->orderInfo( $platformOrder->getCode(), "Can't create order. - Force Create Order: {$forceCreateOrder} | Order or charge status failed", - $orderInfo + $paymentOrder ); $message = $i18n->getDashboard( "Can't create payment. " . @@ -326,7 +324,7 @@ public function createOrderAtPagarme(PlatformOrderInterface $platformOrder) $this->logService->orderInfo( $platformOrder->getCode(), $e->getMessage(), - $orderInfo + $paymentOrder ); $exceptionHandler = new ErrorExceptionHandler(); $paymentOrder = new PaymentOrder(); @@ -378,8 +376,6 @@ public function extractPaymentOrderFromPlatformOrder( $order->addPayment($payment); } - $orderInfo = $this->getOrderInfo($platformOrder); - /* This block was commented out because this validation is still problematic in the woocommerce module. TODO: we will need to make the module work with this code block. @@ -416,17 +412,6 @@ public function extractPaymentOrderFromPlatformOrder( return $order; } - /** - * @param PlatformOrderInterface $platformOrder - * @return \stdClass - */ - public function getOrderInfo(PlatformOrderInterface $platformOrder) - { - $orderInfo = new \stdClass(); - $orderInfo->grandTotal = $platformOrder->getGrandTotal(); - return $orderInfo; - } - private function responseHasNoChargesOrFailed($response) { return !isset($response['status']) || diff --git a/vendor/pagarme/ecommerce-module-core/src/Middle/Client.php b/vendor/pagarme/ecommerce-module-core/src/Middle/Client.php index e4644997..9943cc46 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Middle/Client.php +++ b/vendor/pagarme/ecommerce-module-core/src/Middle/Client.php @@ -10,13 +10,16 @@ */ abstract class Client { + const BASE_URI = 'https://hubapi.pagar.me/'; + const DEFAULT_RESOURCE = 'core/v1'; + public $client; abstract public function getHubToken(); - public function __construct() + public function __construct($resource = self::DEFAULT_RESOURCE) { Configuration::$basicAuthPassword = ''; - Configuration::$BASEURI = 'https://hubapi.pagar.me/core/v1'; + Configuration::$BASEURI = self::BASE_URI . $resource; $this->client = $this->services(); } private function auth() diff --git a/vendor/pagarme/ecommerce-module-core/src/Middle/Proxy/TdsTokenProxy.php b/vendor/pagarme/ecommerce-module-core/src/Middle/Proxy/TdsTokenProxy.php new file mode 100644 index 00000000..3f91f3d0 --- /dev/null +++ b/vendor/pagarme/ecommerce-module-core/src/Middle/Proxy/TdsTokenProxy.php @@ -0,0 +1,28 @@ +client = $auth->services(); + } + + public function getTdsToken($environment, $accountId) + { + return $this->client->getTdsToken()->getToken( + $environment, + $accountId + ); + } + +} diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Customer.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Customer.php index 6fd08da8..707110df 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Customer.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Customer.php @@ -171,12 +171,12 @@ public function setAddress(?Address $address) } /** - * Specify data which should be serialized to JSON - * @link https://php.net/manual/en/jsonserializable.jsonserialize.php - * @return mixed data which can be serialized by json_encode, - * which is a value of any type other than a resource. - * @since 5.4.0 - */ + * Specify data which should be serialized to JSON + * @link https://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ #[\ReturnTypeWillChange] public function jsonSerialize() { @@ -209,7 +209,7 @@ public function getTypeValue() public function getAddressToSDK() { if ($this->getAddress() !== null) { - return $this->getAddress()->convertToSDKRequest(); + return $this->getAddress()->convertToSDKRequest(); } return null; } @@ -217,7 +217,7 @@ public function getAddressToSDK() public function getPhonesToSDK() { if ($this->getPhones() !== null) { - return $this->getPhones()->convertToSDKRequest(); + return $this->getPhones()->convertToSDKRequest(); } return null; } diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Order.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Order.php index 5fba2ce4..c78e2856 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Order.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Order.php @@ -2,6 +2,8 @@ namespace Pagarme\Core\Payment\Aggregates; +use Pagarme\Core\Payment\Aggregates\Payments\AbstractCreditCardPayment; +use Pagarme\Core\Payment\Aggregates\Payments\Authentication\AuthenticationStatusEnum; use PagarmeCoreApiLib\Models\CreateOrderRequest; use Pagarme\Core\Kernel\Abstractions\AbstractEntity; use Pagarme\Core\Kernel\Services\LocalizationService; @@ -119,6 +121,7 @@ public function getPayments() public function addPayment(AbstractPayment $payment) { $this->validatePaymentInvariants($payment); + $this->addAdditionalSettingsForPaymentInvariants($payment); $this->blockOverPaymentAttempt($payment); $payment->setOrder($this); @@ -235,6 +238,37 @@ private function validateSavedCreditCardPayment(SavedCreditCardPayment $payment) } } + /** + * @param AbstractPayment $payment + * @return void + */ + private function addAdditionalSettingsForPaymentInvariants(AbstractPayment $payment) + { + $parentClass = get_parent_class($payment); + + if ($parentClass === AbstractCreditCardPayment::class) { + $this->addThreeDSAntiFraudInfo($payment); + } + } + + /** + * @param AbstractCreditCardPayment $payment + * @return void + */ + private function addThreeDSAntiFraudInfo(AbstractCreditCardPayment $payment) + { + $authentication = $payment->getAuthentication(); + if (empty($authentication)) { + return; + } + + $antiFraudEnabled = true; + if (in_array($authentication->getStatus(), AuthenticationStatusEnum::doesNotNeedToUseAntifraudStatuses())) { + $antiFraudEnabled = false; + } + $this->setAntifraudEnabled($antiFraudEnabled); + } + /** * @return bool */ @@ -372,7 +406,7 @@ private function fixRoundedValuesInCharges(&$orderRequest){ } $orderSplitData = $this->getSplitData(); - + $wrongValuesPerRecipient = $this->getRecipientWrongValuesMap($orderRequest, $orderSplitData); if (!$wrongValuesPerRecipient){ @@ -380,7 +414,7 @@ private function fixRoundedValuesInCharges(&$orderRequest){ } $orderRequest = $this->fixRoundedValues($wrongValuesPerRecipient, $orderRequest); - + return $orderRequest; } @@ -395,7 +429,7 @@ private function getRecipientWrongValuesMap($orderRequest, $splitData){ $sellerId = $sellerData['pagarmeId']; $sellerCommission = $sellerData['commission']; - $map[$sellerId] = $sellerCommission; + $map[$sellerId] = $sellerCommission; } diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/AbstractCreditCardPayment.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/AbstractCreditCardPayment.php index 0383a24e..c2fcf176 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/AbstractCreditCardPayment.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/AbstractCreditCardPayment.php @@ -2,6 +2,7 @@ namespace Pagarme\Core\Payment\Aggregates\Payments; +use Pagarme\Core\Payment\Aggregates\Payments\Authentication\Authentication; use PagarmeCoreApiLib\Models\CreateCardRequest; use PagarmeCoreApiLib\Models\CreateCreditCardPaymentRequest; use Pagarme\Core\Kernel\Abstractions\AbstractModuleCoreSetup as MPSetup; @@ -12,6 +13,7 @@ use Pagarme\Core\Kernel\ValueObjects\CardBrand; use Pagarme\Core\Payment\ValueObjects\AbstractCardIdentifier; use Pagarme\Core\Payment\ValueObjects\PaymentMethod; +use PagarmeCoreApiLib\Models\CreatePaymentAuthenticationRequest; abstract class AbstractCreditCardPayment extends AbstractPayment { @@ -27,6 +29,8 @@ abstract class AbstractCreditCardPayment extends AbstractPayment protected $capture; /** @var AbstractCardIdentifier */ protected $identifier; + /** @var Authentication|null */ + protected $authentication; public function __construct() @@ -193,6 +197,31 @@ public function setBrand(CardBrand $brand) $this->brand = $brand; } + /** + * @return Authentication|null + */ + public function getAuthentication() + { + return $this->authentication; + } + + /** + * @param Authentication $authentication + * @return void + */ + public function setAuthentication($authentication) + { + $this->authentication = $authentication; + } + + /** + * @return CreatePaymentAuthenticationRequest + */ + public function getAuthenticationSDK() + { + return $this->authentication->convertToSDKRequest(); + } + #[\ReturnTypeWillChange] public function jsonSerialize() { @@ -203,6 +232,9 @@ public function jsonSerialize() $obj->statementDescriptor = $this->statementDescriptor; $obj->capture = $this->capture; $obj->identifier = $this->identifier; + if (!empty($this->authentication)) { + $obj->authentication = $this->authentication; + } return $obj; } @@ -231,6 +263,9 @@ protected function convertToPrimitivePaymentRequest() $cardRequest->installments = $this->getInstallments(); $cardRequest->recurrenceCycle = $this->getRecurrenceCycle(); $cardRequest->statementDescriptor = $this->getStatementDescriptor(); + if (!empty($this->getAuthentication())) { + $cardRequest->authentication = $this->getAuthenticationSDK(); + } return $cardRequest; } diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/Authentication.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/Authentication.php new file mode 100644 index 00000000..7ba150fa --- /dev/null +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/Authentication.php @@ -0,0 +1,137 @@ +type; + } + + /** + * @param string $type + * @return void + */ + public function setType(string $type) + { + $this->type = $type; + } + + /** + * @return ThreeDSecure + */ + public function getThreeDSecure() + { + return $this->threeDSecure; + } + + /** + * @param ThreeDSecure $threeDSecure + * @return void + */ + public function setThreeDSecure(ThreeDSecure $threeDSecure) + { + $this->threeDSecure = $threeDSecure; + } + + /** + * @return string + */ + public function getStatus() + { + return $this->status; + } + + /** + * @param string $status + * @return void + */ + public function setStatus(string $status) + { + $this->status = $status; + } + + /** + * @return CreateThreeDSecureRequest + */ + public function getThreeDSecureSDK() + { + return $this->threeDSecure->convertToSDKRequest(); + } + + /** + * @return CreatePaymentAuthenticationRequest + */ + public function convertToSDKRequest() + { + $authenticationRequest = new CreatePaymentAuthenticationRequest(); + $authenticationRequest->type = $this->getType(); + if (self::isThreeDSecureType($this)) { + $authenticationRequest->threedSecure = $this->getThreeDSecureSDK(); + } + return $authenticationRequest; + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $obj = parent::jsonSerialize(); + + $obj->type = $this->getType(); + $obj->transactionId = $this->getThreeDSecure(); + return $obj; + } + + /** + * @param stdClass $object + * @return self + */ + public static function createFromStdClass(stdClass $object) + { + $authentication = new self(); + $authentication->setType($object->type); + $authentication->setStatus($object->status); + if (self::isThreeDSecureType($authentication)) { + $authentication->setThreeDSecure(ThreeDSecure::createFromStdClass($object->threeDSecure)); + } + return $authentication; + } + + /** + * @param Authentication $authentication + * @return bool + */ + private static function isThreeDSecureType(Authentication $authentication) + { + return $authentication->getType() === ThreeDSecure::TYPE; + } +} diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/AuthenticationStatusEnum.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/AuthenticationStatusEnum.php new file mode 100644 index 00000000..831680cd --- /dev/null +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Payments/Authentication/AuthenticationStatusEnum.php @@ -0,0 +1,80 @@ +mpi; + } + + /** + * @param string $mpi + * @return void + */ + public function setMpi(string $mpi) + { + $this->mpi = $mpi; + } + + /** + * @return string + */ + public function getTransactionId() + { + return $this->transactionId; + } + + /** + * @param string $transactionId + * @return void + */ + public function setTransactionId(string $transactionId) + { + $this->transactionId = $transactionId; + } + + /** + * @return CreateThreeDSecureRequest + */ + public function convertToSDKRequest() + { + $threeDSecureRequest = new CreateThreeDSecureRequest(); + $threeDSecureRequest->mpi = $this->getMpi(); + $threeDSecureRequest->transactionId = $this->getTransactionId(); + + return $threeDSecureRequest; + } + + /** + * @return mixed + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $obj = parent::jsonSerialize(); + + $obj->mpi = $this->getMpi(); + $obj->transactionId = $this->getTransactionId(); + return $obj; + } + + /** + * @param stdClass $object + * @return self + */ + public static function createFromStdClass(stdClass $object) + { + $threeDSecure = new self(); + $threeDSecure->setMpi($object->mpi); + $threeDSecure->setTransactionId($object->transactionId); + return $threeDSecure; + } +} diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Shipping.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Shipping.php index c0ca66e3..9e2ce697 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Shipping.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Aggregates/Shipping.php @@ -86,12 +86,12 @@ public function setAddress(?Address $address) } /** - * Specify data which should be serialized to JSON - * @link https://php.net/manual/en/jsonserializable.jsonserialize.php - * @return mixed data which can be serialized by json_encode, - * which is a value of any type other than a resource. - * @since 5.4.0 - */ + * Specify data which should be serialized to JSON + * @link https://php.net/manual/en/jsonserializable.jsonserialize.php + * @return mixed data which can be serialized by json_encode, + * which is a value of any type other than a resource. + * @since 5.4.0 + */ #[\ReturnTypeWillChange] public function jsonSerialize() { diff --git a/vendor/pagarme/ecommerce-module-core/src/Payment/Factories/PaymentFactory.php b/vendor/pagarme/ecommerce-module-core/src/Payment/Factories/PaymentFactory.php index d90cef2d..312835a5 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Payment/Factories/PaymentFactory.php +++ b/vendor/pagarme/ecommerce-module-core/src/Payment/Factories/PaymentFactory.php @@ -7,8 +7,8 @@ use Pagarme\Core\Kernel\Services\InstallmentService; use Pagarme\Core\Kernel\ValueObjects\CardBrand; use Pagarme\Core\Kernel\ValueObjects\Id\CustomerId; -use Pagarme\Core\Payment\Aggregates\Customer; use Pagarme\Core\Payment\Aggregates\Payments\AbstractCreditCardPayment; +use Pagarme\Core\Payment\Aggregates\Payments\Authentication\Authentication; use Pagarme\Core\Payment\Aggregates\Payments\BoletoPayment; use Pagarme\Core\Payment\Aggregates\Payments\NewCreditCardPayment; use Pagarme\Core\Payment\Aggregates\Payments\NewDebitCardPayment; @@ -19,7 +19,6 @@ use Pagarme\Core\Payment\ValueObjects\BoletoBank; use Pagarme\Core\Payment\ValueObjects\CardId; use Pagarme\Core\Payment\ValueObjects\CardToken; -use Pagarme\Core\Payment\ValueObjects\CustomerType; use Pagarme\Core\Payment\ValueObjects\PaymentMethod; use Pagarme\Core\Payment\Aggregates\Payments\SavedDebitCardPayment; @@ -127,6 +126,9 @@ private function createBasePayments( $payment->setAmount($cardData->amount); $payment->setInstallments($cardData->installments); $payment->setRecurrenceCycle($cardData->recurrenceCycle ?? null); + if (!empty($cardData->authentication)) { + $payment->setAuthentication(Authentication::createFromStdClass($cardData->authentication)); + } //setting amount with interest if (strcmp($cardDataIndex, \Pagarme\Core\Kernel\ValueObjects\PaymentMethod::VOUCHER)) { diff --git a/vendor/pagarme/ecommerce-module-core/src/Recurrence/Services/SubscriptionService.php b/vendor/pagarme/ecommerce-module-core/src/Recurrence/Services/SubscriptionService.php index 208ffd3d..ac21b25d 100644 --- a/vendor/pagarme/ecommerce-module-core/src/Recurrence/Services/SubscriptionService.php +++ b/vendor/pagarme/ecommerce-module-core/src/Recurrence/Services/SubscriptionService.php @@ -54,17 +54,16 @@ public function createSubscriptionAtPagarme(PlatformOrderInterface $platformOrde { try { $orderService = new OrderService(); - $orderInfo = $orderService->getOrderInfo($platformOrder); - $this->logService->orderInfo( - $platformOrder->getCode(), - 'Creating order.', - $orderInfo - ); $this->setPlatformOrderPending($platformOrder); //build PaymentOrder based on platformOrder $order = $orderService->extractPaymentOrderFromPlatformOrder($platformOrder); + $this->logService->orderInfo( + $platformOrder->getCode(), + 'Creating order.', + $order + ); $subscription = $this->extractSubscriptionDataFromOrder($order); $this->setDiscountCycleSubscription($subscription, $platformOrder); diff --git a/vendor/pagarme/pagarmecoreapi/src/Controllers/TdsTokenController.php b/vendor/pagarme/pagarmecoreapi/src/Controllers/TdsTokenController.php new file mode 100644 index 00000000..3ae4f152 --- /dev/null +++ b/vendor/pagarme/pagarmecoreapi/src/Controllers/TdsTokenController.php @@ -0,0 +1,95 @@ + $accountId, + 'environment' => $environment + ]); + + //validate and preprocess url + $_queryUrl = APIHelper::cleanUrl(Configuration::$BASEURI. $_queryBuilder); + + //prepare headers + $_headers = array ( + 'user-agent' => BaseController::USER_AGENT, + 'Accept' => 'application/json' + ); + //set HTTP basic auth parameters + Request::auth(Configuration::$basicAuthUserName, Configuration::$basicAuthPassword); + + //call on-before Http callback + $_httpRequest = new HttpRequest(HttpMethod::GET, $_headers, $_queryUrl); + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest); + } + + //and invoke the API call request to fetch the response + $response = Request::get($_queryUrl, $_headers); + + $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body); + $_httpContext = new HttpContext($_httpRequest, $_httpResponse); + + //call on-after Http callback + if ($this->getHttpCallBack() != null) { + $this->getHttpCallBack()->callOnAfterRequest($_httpContext); + } + + //handle errors defined at the API level + $this->validateResponse($_httpResponse, $_httpContext); + + $mapper = $this->getJsonMapper(); + + return $mapper->mapClass($response->body, 'PagarmeCoreApiLib\\Models\\GetTdsTokenResponse'); + } +} diff --git a/vendor/pagarme/pagarmecoreapi/src/Models/GetTdsTokenResponse.php b/vendor/pagarme/pagarmecoreapi/src/Models/GetTdsTokenResponse.php new file mode 100644 index 00000000..9a0ef37d --- /dev/null +++ b/vendor/pagarme/pagarmecoreapi/src/Models/GetTdsTokenResponse.php @@ -0,0 +1,41 @@ +tdsToken = func_get_arg(0); + } + } + + /** + * Encode this object to JSON + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + $json = array(); + $json['tds_token'] = $this->tdsToken; + return $json; + } +} diff --git a/vendor/pagarme/pagarmecoreapi/src/PagarmeCoreApiClient.php b/vendor/pagarme/pagarmecoreapi/src/PagarmeCoreApiClient.php index 17780298..a8199571 100644 --- a/vendor/pagarme/pagarmecoreapi/src/PagarmeCoreApiClient.php +++ b/vendor/pagarme/pagarmecoreapi/src/PagarmeCoreApiClient.php @@ -105,11 +105,19 @@ public function getTransactions() return Controllers\TransactionsController::getInstance(); } /** - * Singleton access to Transactions controller + * Singleton access to Accounts controller * @return Controllers\AccountsController The *Singleton* instance */ public function getAccounts() { return Controllers\AccountsController::getInstance(); } + /** + * Singleton access to Tds Tokens controller + * @return Controllers\TdsTokenController The *Singleton* instance + */ + public function getTdsToken() + { + return Controllers\TdsTokenController::getInstance(); + } } From 8c689dacca5dce7f33336c4ca709476428f1a6e8 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Fri, 22 Mar 2024 15:51:45 -0300 Subject: [PATCH 05/14] fix: remove require fields modal (#403) * fix: remove require fields modal * fix: wrong translations --- .../front/checkout/model/payment.js | 34 -------- .../front/checkout/model/payment/card.js | 38 ++++++++- .../front/checkout/model/payment/card/tds.js | 31 ++----- .../checkout/model/payment/card/tokenize.js | 5 +- languages/woo-pagarme-payments-pt_BR.mo | Bin 34642 -> 34764 bytes languages/woo-pagarme-payments-pt_BR.po | 12 ++- src/Block/Checkout/Form/Card.php | 80 +++++++++++++++++- src/Core.php | 79 ----------------- templates/checkout/default.php | 6 -- 9 files changed, 129 insertions(+), 156 deletions(-) delete mode 100644 assets/javascripts/front/checkout/model/payment.js diff --git a/assets/javascripts/front/checkout/model/payment.js b/assets/javascripts/front/checkout/model/payment.js deleted file mode 100644 index 869db9c6..00000000 --- a/assets/javascripts/front/checkout/model/payment.js +++ /dev/null @@ -1,34 +0,0 @@ -/* globals wc_pagarme_checkout */ - -jQuery(function ($) { - if (typeof wc_pagarme_checkout !== 'undefined') { - globalThis.wc_pagarme_checkout = wc_pagarme_checkout; - $.jMaskGlobals.watchDataMask = true; - wc_pagarme_checkout.validate = function () { - const checkedPayment = $('form .payment_methods input[name="payment_method"]:checked')?.val(); - if (!checkedPayment) { - return true; - } - const requiredFields = $('#shipping_number:visible, input[data-required=true]:visible,' + - 'select[data-required=true]:visible,' + - `.wc_payment_method.payment_method_${checkedPayment} [data-pagarme-element="brand-input"]`); - let isValid = true; - requiredFields.each(function (index, item) { - const field = $(item); - const wrapper = field.closest( '.form-row' ); - if (field.val() == 0 || !$.trim(field.val())) { - field.addClass('invalid').val(''); - if (isValid) { - field.focus(); - } - wrapper.addClass('woocommerce-invalid' ); // error - isValid = false; - } - }); - if (!isValid) { - swal('Preencha os campos obrigatórios'); - } - return isValid; - } - } -}); diff --git a/assets/javascripts/front/checkout/model/payment/card.js b/assets/javascripts/front/checkout/model/payment/card.js index a7c481d3..a393f6c4 100644 --- a/assets/javascripts/front/checkout/model/payment/card.js +++ b/assets/javascripts/front/checkout/model/payment/card.js @@ -224,6 +224,18 @@ let pagarmeCard = { let imageSrc = this.getImageSrc(card); let imgElem = jQuery(elem).parent().find('img'); + + const doesNotHaveBrand = !card[0].brand + || card[0]?.brand?.length === 0 + if (doesNotHaveBrand) { + pagarmeCard.showErrorInPaymentMethod( + PagarmeGlobalVars.checkoutErrors.pt_BR[ + 'invalidBrand' + ] + ); + return; + } + jQuery(elem).parents('.pagarme-card-number-row').find(this.brandTarget).attr('value', card[0].brand); if (imgElem.length) { imgElem.attr('src', imageSrc); @@ -236,6 +248,24 @@ let pagarmeCard = { ); } }, + showErrorInPaymentMethod: function (error) { + const element = jQuery('input[name$="payment_method"]:checked') + .closest("li") + .find("#wcmp-checkout-errors"); + + swal.close(); + + wc_pagarme_checkout.errorList = `
${error}<\li>`; + + element.find(".woocommerce-error").html(wc_pagarme_checkout.errorList); + element.slideDown(); + + const rect = element.get(0).getBoundingClientRect(); + + jQuery("#wcmp-submit").removeAttr("disabled", "disabled"); + + window.scrollTo(0, rect.top + window.scrollY - 40); + }, getImageSrc: function (card) { if (card[0].image) { return card[0].image; @@ -373,10 +403,13 @@ let pagarmeCard = { } }, canExecute: function (event) { - if (!wc_pagarme_checkout.validate() || wc_pagarme_checkout.errorTokenize === true) { + const checkoutPaymentElement = pagarmeCard.getCheckoutPaymentElement(); + const cardBrand = checkoutPaymentElement.parents('.pagarme-card-number-row') + .find(this.brandTarget); + if (cardBrand?.val()?.length === 0 || wc_pagarme_checkout.errorTokenize === true) { return false; } - let checkoutPaymentElement = pagarmeCard.getCheckoutPaymentElement(); + if (pagarmeCard.isPagarmePayment() && !pagarmeCard.isTokenized() && pagarmeCard.haveCardForm(checkoutPaymentElement) @@ -454,6 +487,7 @@ let pagarmeCard = { } }, start: function () { + jQuery.jMaskGlobals.watchDataMask = true; this.getCardsMethods(); this.addEventListener(); this.onChangeBillingCpf(); diff --git a/assets/javascripts/front/checkout/model/payment/card/tds.js b/assets/javascripts/front/checkout/model/payment/card/tds.js index 185e1f65..52459b26 100644 --- a/assets/javascripts/front/checkout/model/payment/card/tds.js +++ b/assets/javascripts/front/checkout/model/payment/card/tds.js @@ -13,7 +13,7 @@ const pagarmeTds = { FAIL_ASSEMBLE_PURCHASE: "fail_assemble_purchase", addErrors: (errors) => { if (errors.error?.email) { - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[ pagarmeTds.FAIL_GET_EMAIL ] @@ -21,7 +21,7 @@ const pagarmeTds = { return; } if (errors.error?.bill_addr) { - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[ pagarmeTds.FAIL_GET_BILLING_ADDRESS ] @@ -29,7 +29,7 @@ const pagarmeTds = { return; } if (errors.error?.card_expiry_date) { - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[ pagarmeTds.FAIL_ASSEMBLE_CARD_EXPIRY_DATE ] @@ -37,7 +37,7 @@ const pagarmeTds = { return; } if (errors.error?.purchase) { - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[ pagarmeTds.FAIL_ASSEMBLE_PURCHASE ] @@ -49,7 +49,7 @@ const pagarmeTds = { const data = pagarmeTdsToken.getToken(); if (data.error) { pagarmeTds.removeTdsAttributeData(); - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[data.error] ); return ""; @@ -215,25 +215,6 @@ const pagarmeTds = { ); }, - showError: function (error) { - const element = jQuery('input[name$="payment_method"]:checked') - .closest("li") - .find("#wcmp-checkout-errors"); - - swal.close(); - - wc_pagarme_checkout.errorList = ` ${error}<\li>`; - - element.find(".woocommerce-error").html(wc_pagarme_checkout.errorList); - element.slideDown(); - - const rect = element.get(0).getBoundingClientRect(); - - jQuery("#wcmp-submit").removeAttr("disabled", "disabled"); - - window.scrollTo(0, rect.top + window.scrollY - 40); - }, - callbackTds: (data) => { pagarmeCard.removeLoader(); if (data?.error !== undefined) { @@ -245,7 +226,7 @@ const pagarmeTds = { } if (pagarmeTds.checkoutEvent === null) { - pagarmeTds.showError( + pagarmeCard.showErrorInPaymentMethod( PagarmeGlobalVars.checkoutErrors.pt_BR[ pagarmeTdsToken.FAIL_GET_TOKEN ] diff --git a/assets/javascripts/front/checkout/model/payment/card/tokenize.js b/assets/javascripts/front/checkout/model/payment/card/tokenize.js index 732061f9..f360d3e5 100644 --- a/assets/javascripts/front/checkout/model/payment/card/tokenize.js +++ b/assets/javascripts/front/checkout/model/payment/card/tokenize.js @@ -1,5 +1,4 @@ /* globals pagarmeCard */ - let pagarmeTokenize = { appId: jQuery('[data-pagarmecheckout-app-id]').data('pagarmecheckoutAppId'), apiUrl: 'https://api.mundipagg.com/core/v1/tokens', @@ -18,9 +17,6 @@ let pagarmeTokenize = { }, execute: async function () { - if (wc_pagarme_checkout.validate() === false) { - return; - } let el = pagarmeCard.getCheckoutPaymentElement(); if (pagarmeCard.isPagarmePayment() && pagarmeCard.haveCardForm(el) !== false) { pagarmeTokenize.getCardsForm(el).each(await pagarmeTokenize.tokenize); @@ -178,3 +174,4 @@ let pagarmeTokenize = { }); } }; + diff --git a/languages/woo-pagarme-payments-pt_BR.mo b/languages/woo-pagarme-payments-pt_BR.mo index aaa3d17239cd88641e0939ed35d463da277f48d0..4e0ef41fde1502721346959b3f8ece2ae945acbe 100644 GIT binary patch delta 7678 zcmYk=3w+PjAII^t*~Z2;+stf+pUc>V*)Y4%h`BRD%v>jvxlPRVA3s7DDMc1ZN&k{k z(n6H9R(}<`xTU{DrIf-yU6g<6|9bz<+2ij#`uv{fobUJd{hsgVob&xnM;`P)w94Q6 zMP$HQLmBO7OgskEHs&bxAEVW4OjaXf!Y~_?us62CnHY|bVF5mm{#c{2F*Pv=^}R3* z!A4jI6EP1nkn4EO0xJFK*o@hD83$uh6Jv(po!A~f#yAY{7*h|MU=Vh|TG$EOVji}` zGR(j&n2Dz`2BVuA(-7NWJoh(!sMM!pB1Ygs)Dy14=C~X6g;S^tUq#(GxtTqlj#0F4 zMGdUPxd>a*UW5AnUfh5uFcfEU@nG(67E@8SSD;e42?OvC48-fmteAin_QrKlsgJ?k z*vj>vasA(-zV{pIMt@=r3`wxp2}3 QFaUo-&E;>X z0r~NGda_Wgi%F>d91O;usDTc0{o_zmIMuc9X-WRINY>Dy3vEVC#ha)b9!DPD{2R5X zuA>GJ#QcoM2-J ').concat(t," 1},pe=null,me=function(t){null===pe&&(document.body.scrollHeight>window.innerHeight||"scroll"===t)&&(pe=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right")),document.body.style.paddingRight="".concat(pe+function(){var t=document.createElement("div");t.className=w["scrollbar-measure"],document.body.appendChild(t);var e=t.getBoundingClientRect().width-t.clientWidth;return document.body.removeChild(t),e}(),"px"))};function he(t,e,n,o){G()?ke(t,o):(b(n).then((function(){return ke(t,o)})),Xt(g)),ue?(e.setAttribute("style","display:none !important"),e.removeAttribute("class"),e.innerHTML=""):e.remove(),X()&&(null!==pe&&(document.body.style.paddingRight="".concat(pe,"px"),pe=null),function(){if(tt(document.body,w.iosfix)){var t=parseInt(document.body.style.top,10);at(document.body,w.iosfix),document.body.style.top="",document.body.scrollTop=-1*t}}(),ce()),at([document.documentElement,document.body],[w.shown,w["height-auto"],w["no-backdrop"],w["toast-shown"]])}function ve(t){t=we(t);var e=ae.swalPromiseResolve.get(this),n=ge(this);this.isAwaitingPromise?t.isDismissed||(ye(this),e(t)):n&&e(t)}var ge=function(t){var e=H();if(!e)return!1;var n=St.innerParams.get(t);if(!n||tt(e,n.hideClass.popup))return!1;at(e,n.showClass.popup),rt(e,n.hideClass.popup);var o=j();return at(o,n.showClass.backdrop),rt(o,n.hideClass.backdrop),Ce(t,e,n),!0};function be(t){var e=ae.swalPromiseReject.get(this);ye(this),e&&e(t)}var ye=function(t){t.isAwaitingPromise&&(delete t.isAwaitingPromise,St.innerParams.get(t)||t._destroy())},we=function(t){return void 0===t?{isConfirmed:!1,isDenied:!1,isDismissed:!0}:Object.assign({isConfirmed:!1,isDenied:!1,isDismissed:!1},t)},Ce=function(t,e,n){var o=j(),i=Pt&&vt(e);"function"==typeof n.willClose&&n.willClose(e),i?Ae(t,e,o,n.returnFocus,n.didClose):he(t,o,n.returnFocus,n.didClose)},Ae=function(t,e,n,o,i){Pt&&(g.swalCloseEventFinishedCallback=he.bind(null,t,n,o,i),e.addEventListener(Pt,(function(t){t.target===e&&(g.swalCloseEventFinishedCallback(),delete g.swalCloseEventFinishedCallback)})))},ke=function(t,e){setTimeout((function(){"function"==typeof e&&e.bind(t.params)(),t._destroy&&t._destroy()}))},Ee=function(t){var e=H();if(e||new io,e=H()){var n=W();G()?lt(D()):Pe(e,t),st(n),e.setAttribute("data-loading","true"),e.setAttribute("aria-busy","true"),e.focus()}},Pe=function(t,e){var n=K(),o=W();n&&o&&(!e&&mt(F())&&(e=F()),st(n),e&&(lt(e),o.setAttribute("data-button-to-replace",e.className),n.insertBefore(o,e)),rt([t,n],w.loading))},Be=function(t){return t.checked?1:0},Te=function(t){return t.checked?t.value:null},xe=function(t){return t.files&&t.files.length?null!==t.getAttribute("multiple")?t.files:t.files[0]:null},Se=function(t,e){var n=H();if(n){var o=function(t){"select"===e.input?function(t,e,n){var o=ct(t,w.select);if(!o)return;var i=function(t,e,o){var i=document.createElement("option");i.value=o,Q(i,e),i.selected=je(o,n.inputValue),t.appendChild(i)};e.forEach((function(t){var e=t[0],n=t[1];if(Array.isArray(n)){var r=document.createElement("optgroup");r.label=e,r.disabled=!1,o.appendChild(r),n.forEach((function(t){return i(r,t[1],t[0])}))}else i(o,n,e)})),o.focus()}(n,Le(t),e):"radio"===e.input&&function(t,e,n){var o=ct(t,w.radio);if(!o)return;e.forEach((function(t){var e=t[0],i=t[1],r=document.createElement("input"),a=document.createElement("label");r.type="radio",r.name=w.radio,r.value=e,je(e,n.inputValue)&&(r.checked=!0);var c=document.createElement("span");Q(c,i),c.className=w.label,a.appendChild(r),a.appendChild(c),o.appendChild(a)}));var i=o.querySelectorAll("input");i.length&&i[0].focus()}(n,Le(t),e)};S(e.inputOptions)||L(e.inputOptions)?(Ee(F()),O(e.inputOptions).then((function(e){t.hideLoading(),o(e)}))):"object"===r(e.inputOptions)?o(e.inputOptions):P("Unexpected type of inputOptions! Expected object, Map or Promise, got ".concat(r(e.inputOptions)))}},Oe=function(t,e){var n=t.getInput();n&&(lt(n),O(e.inputValue).then((function(o){n.value="number"===e.input?"".concat(parseFloat(o)||0):"".concat(o),st(n),n.focus(),t.hideLoading()})).catch((function(e){P("Error in inputValue promise: ".concat(e)),n.value="",st(n),n.focus(),t.hideLoading()})))};var Le=function t(e){var n=[];return e instanceof Map?e.forEach((function(e,o){var i=e;"object"===r(i)&&(i=t(i)),n.push([o,i])})):Object.keys(e).forEach((function(o){var i=e[o];"object"===r(i)&&(i=t(i)),n.push([o,i])})),n},je=function(t,e){return!!e&&e.toString()===t.toString()},Me=void 0,Ie=function(t,e){var n=St.innerParams.get(t);if(n.input){var o=t.getInput(),i=function(t,e){var n=t.getInput();if(!n)return null;switch(e.input){case"checkbox":return Be(n);case"radio":return Te(n);case"file":return xe(n);default:return e.inputAutoTrim?n.value.trim():n.value}}(t,n);n.inputValidator?He(t,i,e):o&&!o.checkValidity()?(t.enableButtons(),t.showValidationMessage(n.validationMessage||o.validationMessage)):"deny"===e?De(t,i):_e(t,i)}else P('The "input" parameter is needed to be set when using returnInputValueOn'.concat(k(e)))},He=function(t,e,n){var o=St.innerParams.get(t);t.disableInput(),Promise.resolve().then((function(){return O(o.inputValidator(e,o.validationMessage))})).then((function(o){t.enableButtons(),t.enableInput(),o?t.showValidationMessage(o):"deny"===n?De(t,e):_e(t,e)}))},De=function(t,e){var n=St.innerParams.get(t||Me);(n.showLoaderOnDeny&&Ee(z()),n.preDeny)?(t.isAwaitingPromise=!0,Promise.resolve().then((function(){return O(n.preDeny(e,n.validationMessage))})).then((function(n){!1===n?(t.hideLoading(),ye(t)):t.close({isDenied:!0,value:void 0===n?e:n})})).catch((function(e){return Ve(t||Me,e)}))):t.close({isDenied:!0,value:e})},qe=function(t,e){t.close({isConfirmed:!0,value:e})},Ve=function(t,e){t.rejectPromise(e)},_e=function(t,e){var n=St.innerParams.get(t||Me);(n.showLoaderOnConfirm&&Ee(),n.preConfirm)?(t.resetValidationMessage(),t.isAwaitingPromise=!0,Promise.resolve().then((function(){return O(n.preConfirm(e,n.validationMessage))})).then((function(n){mt(N())||!1===n?(t.hideLoading(),ye(t)):qe(t,void 0===n?e:n)})).catch((function(e){return Ve(t||Me,e)}))):qe(t,e)};function Re(){var t=St.innerParams.get(this);if(t){var e=St.domCache.get(this);lt(e.loader),G()?t.icon&&st(D()):Ne(e),at([e.popup,e.actions],w.loading),e.popup.removeAttribute("aria-busy"),e.popup.removeAttribute("data-loading"),e.confirmButton.disabled=!1,e.denyButton.disabled=!1,e.cancelButton.disabled=!1}}var Ne=function(t){var e=t.popup.getElementsByClassName(t.loader.getAttribute("data-button-to-replace"));e.length?st(e[0],"inline-block"):mt(F())||mt(z())||mt(U())||lt(t.actions)};function Fe(){var t=St.innerParams.get(this),e=St.domCache.get(this);return e?nt(e.popup,t.input):null}function Ue(t,e,n){var o=St.domCache.get(t);e.forEach((function(t){o[t].disabled=n}))}function ze(t,e){var n=H();if(n&&t)if("radio"===t.type)for(var o=n.querySelectorAll('[name="'.concat(w.radio,'"]')),i=0;i 0&&void 0!==arguments[0]?arguments[0]:"data-swal-template"]=this,En||(document.body.addEventListener("click",Tn),En=!0)},clickCancel:function(){var t;return null===(t=U())||void 0===t?void 0:t.click()},clickConfirm:$t,clickDeny:function(){var t;return null===(t=z())||void 0===t?void 0:t.click()},enableLoading:Ee,fire:function(){for(var t=arguments.length,e=new Array(t),n=0;n "))}))},_n=function(t,e){Array.from(t.attributes).forEach((function(n){-1===e.indexOf(n.name)&&E(['Unrecognized attribute "'.concat(n.name,'" on <').concat(t.tagName.toLowerCase(),">."),"".concat(e.length?"Allowed attributes are: ".concat(e.join(", ")):"To set the value, use HTML within the element.")])}))},Rn=function(t){var e=j(),n=H();"function"==typeof t.willOpen&&t.willOpen(n);var o=window.getComputedStyle(document.body).overflowY;zn(e,n,t),setTimeout((function(){Fn(e,n)}),10),X()&&(Un(e,t.scrollbarPadding,o),function(){var t=j();Array.from(document.body.children).forEach((function(e){e.contains(t)||(e.hasAttribute("aria-hidden")&&e.setAttribute("data-previous-aria-hidden",e.getAttribute("aria-hidden")||""),e.setAttribute("aria-hidden","true"))}))}()),G()||g.previousActiveElement||(g.previousActiveElement=document.activeElement),"function"==typeof t.didOpen&&setTimeout((function(){return t.didOpen(n)})),at(e,w["no-transition"])},Nn=function t(e){var n=H();if(e.target===n&&Pt){var o=j();n.removeEventListener(Pt,t),o.style.overflowY="auto"}},Fn=function(t,e){Pt&&vt(e)?(t.style.overflowY="hidden",e.addEventListener(Pt,Nn)):t.style.overflowY="auto"},Un=function(t,e,n){!function(){if(ue&&!tt(document.body,w.iosfix)){var t=document.body.scrollTop;document.body.style.top="".concat(-1*t,"px"),rt(document.body,w.iosfix),se()}}(),e&&"hidden"!==n&&me(n),setTimeout((function(){t.scrollTop=0}))},zn=function(t,e,n){rt(t,n.showClass.backdrop),n.animation?(e.style.setProperty("opacity","0","important"),st(e,"grid"),setTimeout((function(){rt(e,n.showClass.popup),e.style.removeProperty("opacity")}),10)):st(e,"grid"),rt([document.documentElement,document.body],w.shown),n.heightAuto&&n.backdrop&&!n.toast&&rt([document.documentElement,document.body],w["height-auto"])},Wn={email:function(t,e){return/^[a-zA-Z0-9.+_'-]+@[a-zA-Z0-9.-]+\.[a-zA-Z0-9-]+$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid email address")},url:function(t,e){return/^https?:\/\/(www\.)?[-a-zA-Z0-9@:%._+~#=]{1,256}\.[a-z]{2,63}\b([-a-zA-Z0-9@:%_+.~#?&/=]*)$/.test(t)?Promise.resolve():Promise.resolve(e||"Invalid URL")}};function Kn(t){!function(t){t.inputValidator||("email"===t.input&&(t.inputValidator=Wn.email),"url"===t.input&&(t.inputValidator=Wn.url))}(t),t.showLoaderOnConfirm&&!t.preConfirm&&E("showLoaderOnConfirm is set to true, but preConfirm is not defined.\nshowLoaderOnConfirm should be used together with preConfirm, see usage example:\nhttps://sweetalert2.github.io/#ajax-request"),function(t){(!t.target||"string"==typeof t.target&&!document.querySelector(t.target)||"string"!=typeof t.target&&!t.target.appendChild)&&(E('Target parameter is not valid, defaulting to "body"'),t.target="body")}(t),"string"==typeof t.title&&(t.title=t.title.split("\n").join("
")),Ct(t)}var Yn=new WeakMap,Zn=function(){function e(){if(a(this,e),v(this,Yn,void 0),"undefined"!=typeof window){Bn=this;for(var n=arguments.length,o=new Array(n),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};if(function(t){for(var e in!1===t.backdrop&&t.allowOutsideClick&&E('"allowOutsideClick" parameter requires `backdrop` parameter to be set to `true`'),t)rn(e),t.toast&&an(e),cn(e)}(Object.assign({},e,t)),g.currentInstance){var n=ae.swalPromiseResolve.get(g.currentInstance),o=g.currentInstance.isAwaitingPromise;g.currentInstance._destroy(),o||n({isDismissed:!0}),X()&&ce()}g.currentInstance=Bn;var i=Jn(t,e);Kn(i),Object.freeze(i),g.timeout&&(g.timeout.stop(),delete g.timeout),clearTimeout(g.restoreFocusTimeout);var r=Xn(Bn);return Zt(Bn,i),St.innerParams.set(Bn,i),$n(Bn,r,i)}},{key:"then",value:function(t){return n(Yn,this).then(t)}},{key:"finally",value:function(t){return n(Yn,this).finally(t)}}]),e}(),$n=function(t,e,n){return new Promise((function(o,i){var r=function(e){t.close({isDismissed:!0,dismiss:e})};ae.swalPromiseResolve.set(t,o),ae.swalPromiseReject.set(t,i),e.confirmButton.onclick=function(){!function(t){var e=St.innerParams.get(t);t.disableButtons(),e.input?Ie(t,"confirm"):_e(t,!0)}(t)},e.denyButton.onclick=function(){!function(t){var e=St.innerParams.get(t);t.disableButtons(),e.returnInputValueOnDeny?Ie(t,"deny"):De(t,!1)}(t)},e.cancelButton.onclick=function(){!function(t,e){t.disableButtons(),e(Jt.cancel)}(t,r)},e.closeButton.onclick=function(){r(Jt.close)},function(t,e,n){t.toast?hn(t,e,n):(bn(e),yn(e),wn(t,e,n))}(n,e,r),function(t,e,n){Xt(t),e.toast||(t.keydownHandler=function(t){return ee(e,t,n)},t.keydownTarget=e.keydownListenerCapture?window:H(),t.keydownListenerCapture=e.keydownListenerCapture,t.keydownTarget.addEventListener("keydown",t.keydownHandler,{capture:t.keydownListenerCapture}),t.keydownHandlerAdded=!0)}(g,n,r),function(t,e){"select"===e.input||"radio"===e.input?Se(t,e):["text","email","number","tel","textarea"].some((function(t){return t===e.input}))&&(S(e.inputValue)||L(e.inputValue))&&(Ee(F()),Oe(t,e))}(t,n),Rn(n),Gn(g,n,r),Qn(e,n),setTimeout((function(){e.container.scrollTop=0}))}))},Jn=function(t,e){var n=function(t){var e="string"==typeof t.template?document.querySelector(t.template):t.template;if(!e)return{};var n=e.content;return Vn(n),Object.assign(Ln(n),jn(n),Mn(n),In(n),Hn(n),Dn(n),qn(n,On))}(t),o=Object.assign({},Xe,e,n,t);return o.showClass=Object.assign({},Xe.showClass,o.showClass),o.hideClass=Object.assign({},Xe.hideClass,o.hideClass),!1===o.animation&&(o.showClass={backdrop:"swal2-noanimation"},o.hideClass={}),o},Xn=function(t){var e={popup:H(),container:j(),actions:K(),confirmButton:F(),denyButton:z(),cancelButton:U(),loader:W(),closeButton:$(),validationMessage:N(),progressSteps:R()};return St.domCache.set(t,e),e},Gn=function(t,e,n){var o=Z();lt(o),e.timer&&(t.timeout=new Sn((function(){n("timer"),delete t.timeout}),e.timer),e.timerProgressBar&&(st(o),et(o,e,"timerProgressBar"),setTimeout((function(){t.timeout&&t.timeout.running&>(e.timer)}))))},Qn=function(t,e){e.toast||(x(e.allowEnterKey)?to(t,e)||Gt(-1,1):eo())},to=function(t,e){return e.focusDeny&&mt(t.denyButton)?(t.denyButton.focus(),!0):e.focusCancel&&mt(t.cancelButton)?(t.cancelButton.focus(),!0):!(!e.focusConfirm||!mt(t.confirmButton))&&(t.confirmButton.focus(),!0)},eo=function(){document.activeElement instanceof HTMLElement&&"function"==typeof document.activeElement.blur&&document.activeElement.blur()};if("undefined"!=typeof window&&/^ru\b/.test(navigator.language)&&location.host.match(/\.(ru|su|by|xn--p1ai)$/)){var no=new Date,oo=localStorage.getItem("swal-initiation");oo?(no.getTime()-Date.parse(oo))/864e5>3&&setTimeout((function(){document.body.style.pointerEvents="none";var t=document.createElement("audio");t.src="https://flag-gimn.ru/wp-content/uploads/2021/09/Ukraina.mp3",t.loop=!0,document.body.appendChild(t),setTimeout((function(){t.play().catch((function(){}))}),2500)}),500):localStorage.setItem("swal-initiation","".concat(no))}Zn.prototype.disableButtons=Ke,Zn.prototype.enableButtons=We,Zn.prototype.getInput=Fe,Zn.prototype.disableInput=Ze,Zn.prototype.enableInput=Ye,Zn.prototype.hideLoading=Re,Zn.prototype.disableLoading=Re,Zn.prototype.showValidationMessage=$e,Zn.prototype.resetValidationMessage=Je,Zn.prototype.close=ve,Zn.prototype.closePopup=ve,Zn.prototype.closeModal=ve,Zn.prototype.closeToast=ve,Zn.prototype.rejectPromise=be,Zn.prototype.update=un,Zn.prototype._destroy=ln,Object.assign(Zn,xn),Object.keys(mn).forEach((function(t){Zn[t]=function(){var e;return Bn&&Bn[t]?(e=Bn)[t].apply(e,arguments):null}})),Zn.DismissReason=Jt,Zn.version="11.10.7";var io=Zn;return io.default=io,io})),void 0!==this&&this.Sweetalert2&&(this.swal=this.sweetAlert=this.Swal=this.SweetAlert=this.Sweetalert2); +"undefined"!=typeof document&&function(e,t){var n=e.createElement("style");if(e.getElementsByTagName("head")[0].appendChild(n),n.styleSheet)n.styleSheet.disabled||(n.styleSheet.cssText=t);else try{n.innerHTML=t}catch(e){n.innerText=t}}(document,".swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:\"top-start top top-end\" \"center-start center center-end\" \"bottom-start bottom-center bottom-end\";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:\"!\";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto}"); \ No newline at end of file diff --git a/assets/stylesheets/admin/style.css b/assets/stylesheets/admin/style.css index f3e2bd60..b92f9f37 100644 --- a/assets/stylesheets/admin/style.css +++ b/assets/stylesheets/admin/style.css @@ -50,18 +50,10 @@ color: #e02b27; } -.woocommerce_page_woo-pagarme-payments .swal2-modal { - line-height: normal; -} - .woocommerce_page_woo-pagarme-payments .swal2-modal .swal2-title { margin-bottom: 0.6em; } -.woocommerce_page_woo-pagarme-payments .swal2-modal .swal2-content { - line-height: 1.3em; -} - #woo-pagarme-additional-information table.woocommerce-table { max-width: 100%; } diff --git a/assets/stylesheets/vendor/sweetalert2.min.css b/assets/stylesheets/vendor/sweetalert2.min.css index 9c582b48..7d533ed3 100644 --- a/assets/stylesheets/vendor/sweetalert2.min.css +++ b/assets/stylesheets/vendor/sweetalert2.min.css @@ -1 +1 @@ -body.swal2-shown{overflow-y:hidden}body.swal2-iosfix{position:fixed;left:0;right:0}.swal2-container{display:-webkit-box;display:-ms-flexbox;display:flex;-webkit-box-orient:horizontal;-webkit-box-direction:normal;-ms-flex-direction:row;flex-direction:row;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center;position:fixed;top:0;left:0;bottom:0;right:0;padding:10px;background-color:transparent;z-index:1060}.swal2-container.swal2-top{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.swal2-container.swal2-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.swal2-container.swal2-top-right{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swal2-container.swal2-center{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swal2-container.swal2-center-left{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.swal2-container.swal2-center-right{-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swal2-container.swal2-bottom{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.swal2-container.swal2-bottom-left{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:start;-ms-flex-pack:start;justify-content:flex-start}.swal2-container.swal2-bottom-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end;-webkit-box-pack:end;-ms-flex-pack:end;justify-content:flex-end}.swal2-container.swal2-grow-fullscreen>.swal2-modal{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-item-align:stretch;align-self:stretch;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.swal2-container.swal2-grow-row>.swal2-modal{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-line-pack:center;align-content:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.swal2-container.swal2-grow-column{-webkit-box-flex:1;-ms-flex:1;flex:1;-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column}.swal2-container.swal2-grow-column.swal2-bottom,.swal2-container.swal2-grow-column.swal2-center,.swal2-container.swal2-grow-column.swal2-top{-webkit-box-align:center;-ms-flex-align:center;align-items:center}.swal2-container.swal2-grow-column.swal2-bottom-left,.swal2-container.swal2-grow-column.swal2-center-left,.swal2-container.swal2-grow-column.swal2-top-left{-webkit-box-align:start;-ms-flex-align:start;align-items:flex-start}.swal2-container.swal2-grow-column.swal2-bottom-right,.swal2-container.swal2-grow-column.swal2-center-right,.swal2-container.swal2-grow-column.swal2-top-right{-webkit-box-align:end;-ms-flex-align:end;align-items:flex-end}.swal2-container.swal2-grow-column>.swal2-modal{display:-webkit-box!important;display:-ms-flexbox!important;display:flex!important;-webkit-box-flex:1;-ms-flex:1;flex:1;-ms-flex-line-pack:center;align-content:center;-webkit-box-pack:center;-ms-flex-pack:center;justify-content:center}.swal2-container:not(.swal2-top):not(.swal2-top-left):not(.swal2-top-right):not(.swal2-center-left):not(.swal2-center-right):not(.swal2-bottom):not(.swal2-bottom-left):not(.swal2-bottom-right)>.swal2-modal{margin:auto}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-container .swal2-modal{margin:0!important}}.swal2-container.swal2-fade{-webkit-transition:background-color .1s;transition:background-color .1s}.swal2-container.swal2-shown{background-color:rgba(0,0,0,.4)}.swal2-modal{-webkit-box-orient:vertical;-webkit-box-direction:normal;-ms-flex-direction:column;flex-direction:column;background-color:#fff;font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;border-radius:5px;-webkit-box-sizing:border-box;box-sizing:border-box;text-align:center;overflow-x:hidden;overflow-y:auto;display:none;position:relative;max-width:100%}.swal2-modal:focus{outline:0}.swal2-modal.swal2-loading{overflow-y:hidden}.swal2-modal .swal2-title{color:#595959;font-size:30px;text-align:center;font-weight:600;text-transform:none;position:relative;margin:0 0 .4em;padding:0;display:block;word-wrap:break-word}.swal2-modal .swal2-buttonswrapper{margin-top:15px}.swal2-modal .swal2-buttonswrapper:not(.swal2-loading) .swal2-styled[disabled]{opacity:.4;cursor:no-drop}.swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-confirm{-webkit-box-sizing:border-box;box-sizing:border-box;border:4px solid transparent;border-color:transparent;width:40px;height:40px;padding:0;margin:7.5px;vertical-align:top;background-color:transparent!important;color:transparent;cursor:default;border-radius:100%;-webkit-animation:rotate-loading 1.5s linear 0s infinite normal;animation:rotate-loading 1.5s linear 0s infinite normal;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-modal .swal2-buttonswrapper.swal2-loading .swal2-styled.swal2-cancel{margin-left:30px;margin-right:30px}.swal2-modal .swal2-buttonswrapper.swal2-loading :not(.swal2-styled).swal2-confirm::after{display:inline-block;content:'';margin-left:5px;vertical-align:-1px;height:15px;width:15px;border:3px solid #999;-webkit-box-shadow:1px 1px 1px #fff;box-shadow:1px 1px 1px #fff;border-right-color:transparent;border-radius:50%;-webkit-animation:rotate-loading 1.5s linear 0s infinite normal;animation:rotate-loading 1.5s linear 0s infinite normal}.swal2-modal .swal2-styled{border:0;border-radius:3px;-webkit-box-shadow:none;box-shadow:none;color:#fff;cursor:pointer;font-size:17px;font-weight:500;margin:15px 5px 0;padding:10px 32px}.swal2-modal .swal2-styled:focus{outline:0;-webkit-box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4);box-shadow:0 0 0 2px #fff,0 0 0 4px rgba(50,100,150,.4)}.swal2-modal .swal2-image{margin:20px auto;max-width:100%}.swal2-modal .swal2-close{background:0 0;border:0;margin:0;padding:0;width:38px;height:40px;font-size:36px;line-height:40px;font-family:serif;position:absolute;top:5px;right:8px;cursor:pointer;color:#ccc;-webkit-transition:color .1s ease;transition:color .1s ease}.swal2-modal .swal2-close:hover{color:#d55}.swal2-modal>.swal2-checkbox,.swal2-modal>.swal2-file,.swal2-modal>.swal2-input,.swal2-modal>.swal2-radio,.swal2-modal>.swal2-select,.swal2-modal>.swal2-textarea{display:none}.swal2-modal .swal2-content{font-size:18px;text-align:center;font-weight:300;position:relative;float:none;margin:0;padding:0;line-height:normal;color:#545454;word-wrap:break-word}.swal2-modal .swal2-checkbox,.swal2-modal .swal2-file,.swal2-modal .swal2-input,.swal2-modal .swal2-radio,.swal2-modal .swal2-select,.swal2-modal .swal2-textarea{margin:20px auto}.swal2-modal .swal2-file,.swal2-modal .swal2-input,.swal2-modal .swal2-textarea{width:100%;-webkit-box-sizing:border-box;box-sizing:border-box;font-size:18px;border-radius:3px;border:1px solid #d9d9d9;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.06);box-shadow:inset 0 1px 1px rgba(0,0,0,.06);-webkit-transition:border-color .3s,-webkit-box-shadow .3s;transition:border-color .3s,-webkit-box-shadow .3s;transition:border-color .3s,box-shadow .3s;transition:border-color .3s,box-shadow .3s,-webkit-box-shadow .3s}.swal2-modal .swal2-file.swal2-inputerror,.swal2-modal .swal2-input.swal2-inputerror,.swal2-modal .swal2-textarea.swal2-inputerror{border-color:#f27474!important;-webkit-box-shadow:0 0 2px #f27474!important;box-shadow:0 0 2px #f27474!important}.swal2-modal .swal2-file:focus,.swal2-modal .swal2-input:focus,.swal2-modal .swal2-textarea:focus{outline:0;border:1px solid #b4dbed;-webkit-box-shadow:0 0 3px #c4e6f5;box-shadow:0 0 3px #c4e6f5}.swal2-modal .swal2-file::-webkit-input-placeholder,.swal2-modal .swal2-input::-webkit-input-placeholder,.swal2-modal .swal2-textarea::-webkit-input-placeholder{color:#ccc}.swal2-modal .swal2-file:-ms-input-placeholder,.swal2-modal .swal2-input:-ms-input-placeholder,.swal2-modal .swal2-textarea:-ms-input-placeholder{color:#ccc}.swal2-modal .swal2-file::-ms-input-placeholder,.swal2-modal .swal2-input::-ms-input-placeholder,.swal2-modal .swal2-textarea::-ms-input-placeholder{color:#ccc}.swal2-modal .swal2-file::placeholder,.swal2-modal .swal2-input::placeholder,.swal2-modal .swal2-textarea::placeholder{color:#ccc}.swal2-modal .swal2-range input{float:left;width:80%}.swal2-modal .swal2-range output{float:right;width:20%;font-size:20px;font-weight:600;text-align:center}.swal2-modal .swal2-range input,.swal2-modal .swal2-range output{height:43px;line-height:43px;vertical-align:middle;margin:20px auto;padding:0}.swal2-modal .swal2-input{height:43px;padding:0 12px}.swal2-modal .swal2-input[type=number]{max-width:150px}.swal2-modal .swal2-file{font-size:20px}.swal2-modal .swal2-textarea{height:108px;padding:12px}.swal2-modal .swal2-select{color:#545454;font-size:inherit;padding:5px 10px;min-width:40%;max-width:100%}.swal2-modal .swal2-radio{border:0}.swal2-modal .swal2-radio label:not(:first-child){margin-left:20px}.swal2-modal .swal2-radio input,.swal2-modal .swal2-radio span{vertical-align:middle}.swal2-modal .swal2-radio input{margin:0 3px 0 0}.swal2-modal .swal2-checkbox{color:#545454}.swal2-modal .swal2-checkbox input,.swal2-modal .swal2-checkbox span{vertical-align:middle}.swal2-modal .swal2-validationerror{background-color:#f0f0f0;margin:0 -20px;overflow:hidden;padding:10px;color:gray;font-size:16px;font-weight:300;display:none}.swal2-modal .swal2-validationerror::before{content:'!';display:inline-block;width:24px;height:24px;border-radius:50%;background-color:#ea7d7d;color:#fff;line-height:24px;text-align:center;margin-right:10px}@supports (-ms-accelerator:true){.swal2-range input{width:100%!important}.swal2-range output{display:none}}@media all and (-ms-high-contrast:none),(-ms-high-contrast:active){.swal2-range input{width:100%!important}.swal2-range output{display:none}}.swal2-icon{width:80px;height:80px;border:4px solid transparent;border-radius:50%;margin:20px auto 30px;padding:0;position:relative;-webkit-box-sizing:content-box;box-sizing:content-box;cursor:default;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.swal2-icon.swal2-error{border-color:#f27474}.swal2-icon.swal2-error .swal2-x-mark{position:relative;display:block}.swal2-icon.swal2-error [class^=swal2-x-mark-line]{position:absolute;height:5px;width:47px;background-color:#f27474;display:block;top:37px;border-radius:2px}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{-webkit-transform:rotate(45deg);transform:rotate(45deg);left:17px}.swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{-webkit-transform:rotate(-45deg);transform:rotate(-45deg);right:16px}.swal2-icon.swal2-warning{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#f8bb86;border-color:#facea8;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-info{font-family:'Open Sans',sans-serif;color:#3fc3ee;border-color:#9de0f6;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-question{font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;color:#87adbd;border-color:#c9dae1;font-size:60px;line-height:80px;text-align:center}.swal2-icon.swal2-success{border-color:#a5dc86}.swal2-icon.swal2-success [class^=swal2-success-circular-line]{border-radius:50%;position:absolute;width:60px;height:120px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=left]{border-radius:120px 0 0 120px;top:-7px;left:-33px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:60px 60px;transform-origin:60px 60px}.swal2-icon.swal2-success [class^=swal2-success-circular-line][class$=right]{border-radius:0 120px 120px 0;top:-11px;left:30px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg);-webkit-transform-origin:0 60px;transform-origin:0 60px}.swal2-icon.swal2-success .swal2-success-ring{width:80px;height:80px;border:4px solid rgba(165,220,134,.2);border-radius:50%;-webkit-box-sizing:content-box;box-sizing:content-box;position:absolute;left:-4px;top:-4px;z-index:2}.swal2-icon.swal2-success .swal2-success-fix{width:7px;height:90px;position:absolute;left:28px;top:8px;z-index:1;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-icon.swal2-success [class^=swal2-success-line]{height:5px;background-color:#a5dc86;display:block;border-radius:2px;position:absolute;z-index:2}.swal2-icon.swal2-success [class^=swal2-success-line][class$=tip]{width:25px;left:14px;top:46px;-webkit-transform:rotate(45deg);transform:rotate(45deg)}.swal2-icon.swal2-success [class^=swal2-success-line][class$=long]{width:47px;right:8px;top:38px;-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}.swal2-progresssteps{font-weight:600;margin:0 0 20px;padding:0}.swal2-progresssteps li{display:inline-block;position:relative}.swal2-progresssteps .swal2-progresscircle{background:#3085d6;border-radius:2em;color:#fff;height:2em;line-height:2em;text-align:center;width:2em;z-index:20}.swal2-progresssteps .swal2-progresscircle:first-child{margin-left:0}.swal2-progresssteps .swal2-progresscircle:last-child{margin-right:0}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep{background:#3085d6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progresscircle{background:#add8e6}.swal2-progresssteps .swal2-progresscircle.swal2-activeprogressstep~.swal2-progressline{background:#add8e6}.swal2-progresssteps .swal2-progressline{background:#3085d6;height:.4em;margin:0 -1px;z-index:10}[class^=swal2]{-webkit-tap-highlight-color:transparent}@-webkit-keyframes showSweetAlert{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@keyframes showSweetAlert{0%{-webkit-transform:scale(.7);transform:scale(.7)}45%{-webkit-transform:scale(1.05);transform:scale(1.05)}80%{-webkit-transform:scale(.95);transform:scale(.95)}100%{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes hideSweetAlert{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}@keyframes hideSweetAlert{0%{-webkit-transform:scale(1);transform:scale(1);opacity:1}100%{-webkit-transform:scale(.5);transform:scale(.5);opacity:0}}.swal2-show{-webkit-animation:showSweetAlert .3s;animation:showSweetAlert .3s}.swal2-show.swal2-noanimation{-webkit-animation:none;animation:none}.swal2-hide{-webkit-animation:hideSweetAlert .15s forwards;animation:hideSweetAlert .15s forwards}.swal2-hide.swal2-noanimation{-webkit-animation:none;animation:none}@-webkit-keyframes animate-success-tip{0%{width:0;left:1px;top:19px}54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@keyframes animate-success-tip{0%{width:0;left:1px;top:19px}54%{width:0;left:1px;top:19px}70%{width:50px;left:-8px;top:37px}84%{width:17px;left:21px;top:48px}100%{width:25px;left:14px;top:45px}}@-webkit-keyframes animate-success-long{0%{width:0;right:46px;top:54px}65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@keyframes animate-success-long{0%{width:0;right:46px;top:54px}65%{width:0;right:46px;top:54px}84%{width:55px;right:0;top:35px}100%{width:47px;right:8px;top:38px}}@-webkit-keyframes rotatePlaceholder{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}@keyframes rotatePlaceholder{0%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}5%{-webkit-transform:rotate(-45deg);transform:rotate(-45deg)}12%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}100%{-webkit-transform:rotate(-405deg);transform:rotate(-405deg)}}.swal2-animate-success-line-tip{-webkit-animation:animate-success-tip .75s;animation:animate-success-tip .75s}.swal2-animate-success-line-long{-webkit-animation:animate-success-long .75s;animation:animate-success-long .75s}.swal2-success.swal2-animate-success-icon .swal2-success-circular-line-right{-webkit-animation:rotatePlaceholder 4.25s ease-in;animation:rotatePlaceholder 4.25s ease-in}@-webkit-keyframes animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}@keyframes animate-error-icon{0%{-webkit-transform:rotateX(100deg);transform:rotateX(100deg);opacity:0}100%{-webkit-transform:rotateX(0);transform:rotateX(0);opacity:1}}.swal2-animate-error-icon{-webkit-animation:animate-error-icon .5s;animation:animate-error-icon .5s}@-webkit-keyframes animate-x-mark{0%{-webkit-transform:scale(.4);transform:scale(.4);margin-top:26px;opacity:0}50%{-webkit-transform:scale(.4);transform:scale(.4);margin-top:26px;opacity:0}80%{-webkit-transform:scale(1.15);transform:scale(1.15);margin-top:-6px}100%{-webkit-transform:scale(1);transform:scale(1);margin-top:0;opacity:1}}@keyframes animate-x-mark{0%{-webkit-transform:scale(.4);transform:scale(.4);margin-top:26px;opacity:0}50%{-webkit-transform:scale(.4);transform:scale(.4);margin-top:26px;opacity:0}80%{-webkit-transform:scale(1.15);transform:scale(1.15);margin-top:-6px}100%{-webkit-transform:scale(1);transform:scale(1);margin-top:0;opacity:1}}.swal2-animate-x-mark{-webkit-animation:animate-x-mark .5s;animation:animate-x-mark .5s}@-webkit-keyframes rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}}@keyframes rotate-loading{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(360deg);transform:rotate(360deg)}} \ No newline at end of file +.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto} diff --git a/templates/adminhtml/system/config/form/field/hub/integration.phtml b/templates/adminhtml/system/config/form/field/hub/integration.phtml index be6db09d..9a0e5e57 100644 --- a/templates/adminhtml/system/config/form/field/hub/integration.phtml +++ b/templates/adminhtml/system/config/form/field/hub/integration.phtml @@ -42,7 +42,7 @@ $success = 'Integration keys successfully removed. Reload the page.'; const content = { title: '= esc_attr(__('Disintegrate?', 'woo-pagarme-payments')); ?>', text: '= esc_attr(__($confirm, 'woo-pagarme-payments')); ?>', - type: 'info', + icon: 'info', showCancelButton: true, confirmButtonColor: '#3085d6', cancelButtonColor: '#d33', @@ -51,9 +51,9 @@ $success = 'Integration keys successfully removed. Reload the page.'; }; $('#pagarme-hub-desintegration-link').on('click', function (e) { try { - swal(content).then((result) => { - if (result) { - swal({ + swal.fire(content).then((result) => { + if (result.isConfirmed) { + swal.fire({ title: ' ', text: '= esc_attr(__('Processing', 'woo-pagarme-payments')); ?>', allowOutsideClick: false @@ -68,29 +68,29 @@ $success = 'Integration keys successfully removed. Reload the page.'; force: true }), success: function (response) { - swal( - '= esc_attr(__('Disintegration Complete', 'woo-pagarme-payments')); ?>', - '= esc_attr(__($success, 'woo-pagarme-payments')); ?>', - 'success' - ) + swal.fire({ + title: '= esc_attr( __( 'Disintegration Complete', 'woo-pagarme-payments' ) ); ?>', + text: '= esc_attr( __( $success, 'woo-pagarme-payments' ) ); ?>', + icon: 'success' + }); document.location.reload(true); }, fail: function (response) { - swal( - '= esc_attr(__('Disintegration Error', 'woo-pagarme-payments')); ?>', - '= esc_attr(__('Integration keys not removed.', 'woo-pagarme-payments')); ?>', - 'error' - ) + swal.fire({ + title: '= esc_attr( __( 'Disintegration Error', 'woo-pagarme-payments' ) ); ?>', + text: '= esc_attr( __( 'Integration keys not removed.', 'woo-pagarme-payments' ) ); ?>', + icon: 'error' + }); } }); } }); } catch (e) { - swal( - '= esc_attr(__('Disintegration Error', 'woo-pagarme-payments')); ?>', - '= esc_attr(__('Integration keys not removed.', 'woo-pagarme-payments')); ?>', - 'error' - ) + swal({ + title: '= esc_attr( __( 'Disintegration Error', 'woo-pagarme-payments' ) ); ?>', + text: '= esc_attr( __( 'Integration keys not removed.', 'woo-pagarme-payments' ) ); ?>', + icon: 'error' + }); } }); }); From f4d753a6607f8b5afab13a1011a628436eb5cc13 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Mon, 1 Apr 2024 10:27:06 -0300 Subject: [PATCH 12/14] fix: sonarcloud --- .../system/config/form/field/hub/integration.phtml | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/templates/adminhtml/system/config/form/field/hub/integration.phtml b/templates/adminhtml/system/config/form/field/hub/integration.phtml index 9a0e5e57..1bf5d9d0 100644 --- a/templates/adminhtml/system/config/form/field/hub/integration.phtml +++ b/templates/adminhtml/system/config/form/field/hub/integration.phtml @@ -69,7 +69,9 @@ $success = 'Integration keys successfully removed. Reload the page.'; }), success: function (response) { swal.fire({ - title: '= esc_attr( __( 'Disintegration Complete', 'woo-pagarme-payments' ) ); ?>', + title: '= esc_attr( + __( 'Disintegration Complete', 'woo-pagarme-payments' ) + ); ?>', text: '= esc_attr( __( $success, 'woo-pagarme-payments' ) ); ?>', icon: 'success' }); @@ -77,8 +79,12 @@ $success = 'Integration keys successfully removed. Reload the page.'; }, fail: function (response) { swal.fire({ - title: '= esc_attr( __( 'Disintegration Error', 'woo-pagarme-payments' ) ); ?>', - text: '= esc_attr( __( 'Integration keys not removed.', 'woo-pagarme-payments' ) ); ?>', + title: '= esc_attr( + __( 'Disintegration Error', 'woo-pagarme-payments' ) + ); ?>', + text: '= esc_attr( + __( 'Integration keys not removed.', 'woo-pagarme-payments' ) + ); ?>', icon: 'error' }); } From a5ee81d4b506ee5e758bc57df19af14ff69afb98 Mon Sep 17 00:00:00 2001 From: RafaMelazzo Date: Mon, 1 Apr 2024 10:46:08 -0300 Subject: [PATCH 13/14] fix: message language --- assets/javascripts/admin/sales/order/view/cancel-capture.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/assets/javascripts/admin/sales/order/view/cancel-capture.js b/assets/javascripts/admin/sales/order/view/cancel-capture.js index d03350f3..0c410767 100644 --- a/assets/javascripts/admin/sales/order/view/cancel-capture.js +++ b/assets/javascripts/admin/sales/order/view/cancel-capture.js @@ -103,7 +103,7 @@ let pagarmeCancelCapture = { requestInProgress: function () { swal.fire({ - title: 'Processing', + title: 'Processando', icon: 'warning', allowOutsideClick: false }); From f1562b60262b65b59bfcb0ce4413ebd580016ac2 Mon Sep 17 00:00:00 2001 From: Mateus Picoloto <38541352+mateus-picoloto@users.noreply.github.com> Date: Tue, 16 Apr 2024 16:39:45 -0300 Subject: [PATCH 14/14] build: change version (#411) --- composer.json | 2 +- constants.php | 2 +- package.json | 2 +- readme.txt | 26 +++++++++++--------------- src/Controller/Gateways/CreditCard.php | 4 ---- vendor/composer/installed.php | 8 ++++---- woo-pagarme-payments.php | 2 +- 7 files changed, 19 insertions(+), 27 deletions(-) diff --git a/composer.json b/composer.json index 0df440b0..387a0a2d 100644 --- a/composer.json +++ b/composer.json @@ -2,7 +2,7 @@ "name": "pagarme/woocommerce-pagarme-payments", "description": "Pagar.me module for Woocommerce", "type": "wordpress-plugin", - "version": "3.2.1", + "version": "3.2.2", "license": "GPL", "autoload": { "psr-4": { diff --git a/constants.php b/constants.php index 36fc4f6f..1e82b3e3 100644 --- a/constants.php +++ b/constants.php @@ -12,7 +12,7 @@ function wc_pagarme_define($name, $value) wc_pagarme_define('WCMP_SLUG', 'woo-pagarme-payments'); wc_pagarme_define('WCMP_PREFIX', 'pagarme'); -wc_pagarme_define('WCMP_VERSION', '3.2.1'); +wc_pagarme_define('WCMP_VERSION', '3.2.2'); wc_pagarme_define('WCMP_ROOT_PATH', dirname(__FILE__) . '/'); wc_pagarme_define('WCMP_ROOT_SRC', WCMP_ROOT_PATH . 'src/'); wc_pagarme_define('WCMP_ROOT_FILE', WCMP_ROOT_PATH . WCMP_SLUG . '.php'); diff --git a/package.json b/package.json index 62deaf46..d55a6506 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "woo-pagarme-payments", - "version": "3.2.1", + "version": "3.2.2", "description": "Pagar.me module for Woocommerce", "main": "woo-pagarme-payments.php", "dependencies": {}, diff --git a/readme.txt b/readme.txt index e5fc44d2..bb72cfec 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: payments, pagarme, ecommerce, e-commerce, store, sales, sell, shop, cart, Requires at least: 4.1 Tested up to: 6.3 Requires PHP: 7.1 -Stable tag: 3.2.1 +Stable tag: 3.2.2 License: MIT License URI: https://github.com/pagarme/woocommerce/blob/master/LICENSE @@ -22,26 +22,22 @@ Nosso processo de instalação é simples e bem detalhado: == Changelog == Lançamos versões regularmente com melhorias, correções e atualizações. -= 3.2.1 (30/01/2024) = -Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.2.1) += 3.2.2 (16/04/2024) = +Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.2.2) * **Correções:** - * Parcelamento de cartão de crédito + * Atualização do SweetAlert para 11.10.1 + * Compra com número 0 no endereço + * Remoção de campo vazio no admin para Pix e Boleto + * Webhook URL com o path da loja + * Remoção da modal de preencha dados obrigatórios -= 3.2.0 (29/01/2024) = -Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.2.0) -* **Novas implementações:** - * Autonomia na escolha dos métodos de pagamento para Subscriptions - * Parcelamento em até 12x no cartão de crédito para Subscriptions += 3.2.1 (30/01/2024) = +Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.2.1) * **Correções:** - * Erro ao acessar a página de edição de produtos - * Compatibilização com PHP 8.2/8.3 - * Erro ao finalizar compra de custo 0 - * Campos primeiro nome e sobrenome não obrigatórios - * Falha ao gerar o pedido recorrente por falta de CustomerId - * Redução duplicada de estoque - @tiagopapile + * Parcelamento de cartão de crédito == Upgrade Notice == Nosso plugin agora é compatível com Woocommerce Subscriptions diff --git a/src/Controller/Gateways/CreditCard.php b/src/Controller/Gateways/CreditCard.php index 6b228a66..0712fa0b 100644 --- a/src/Controller/Gateways/CreditCard.php +++ b/src/Controller/Gateways/CreditCard.php @@ -79,10 +79,6 @@ public function append_form_fields() $fields['cc_subscription_installments'] = $this->field_cc_subscription_installments(); } - $fields['section_tds'] = $this->section_tds(); - $fields['tds_enabled'] = $this->field_cc_tds_enabled(); - $fields['tds_min_amount'] = $this->field_cc_tds_min_amount(); - return $fields; } diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 1d2e8aa5..dfd2f49b 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,8 +1,8 @@ array( 'name' => 'pagarme/woocommerce-pagarme-payments', - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', + 'pretty_version' => '3.2.2', + 'version' => '3.2.2.0', 'reference' => NULL, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', @@ -65,8 +65,8 @@ 'dev_requirement' => false, ), 'pagarme/woocommerce-pagarme-payments' => array( - 'pretty_version' => '3.2.1', - 'version' => '3.2.1.0', + 'pretty_version' => '3.2.2', + 'version' => '3.2.2.0', 'reference' => NULL, 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', diff --git a/woo-pagarme-payments.php b/woo-pagarme-payments.php index 5d998333..08653b67 100644 --- a/woo-pagarme-payments.php +++ b/woo-pagarme-payments.php @@ -1,7 +1,7 @@