Changeset 3093489
- Timestamp:
- 05/27/2024 09:05:33 PM (23 months ago)
- Location:
- pix-por-piggly
- Files:
-
- 8 edited
- 100 copied
-
tags/2.1.1 (copied) (copied from pix-por-piggly/trunk)
-
tags/2.1.1/LICENSE (copied) (copied from pix-por-piggly/trunk/LICENSE)
-
tags/2.1.1/assets (copied) (copied from pix-por-piggly/trunk/assets)
-
tags/2.1.1/assets/css/pix-por-piggly.front.css (copied) (copied from pix-por-piggly/trunk/assets/css/pix-por-piggly.front.css)
-
tags/2.1.1/assets/js/pgly-pix-por-piggly.front.js (copied) (copied from pix-por-piggly/trunk/assets/js/pgly-pix-por-piggly.front.js)
-
tags/2.1.1/assets/js/pgly-pix-por-piggly.settings.js (copied) (copied from pix-por-piggly/trunk/assets/js/pgly-pix-por-piggly.settings.js)
-
tags/2.1.1/assets/js/pgly.pix.checkout.js (copied) (copied from pix-por-piggly/trunk/assets/js/pgly.pix.checkout.js)
-
tags/2.1.1/composer.json (copied) (copied from pix-por-piggly/trunk/composer.json) (1 diff)
-
tags/2.1.1/libs (copied) (copied from pix-por-piggly/trunk/libs)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Common (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Common)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/AlphaNum.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/AlphaNum.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/Byte.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/Byte.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/ECI.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/ECI.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/Hanzi.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/Hanzi.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/Kanji.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/Kanji.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/Number.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/Number.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/QRCodeDataException.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/QRCodeDataException.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/QRData.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/QRData.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/QRDataModeAbstract.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/QRDataModeAbstract.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/QRDataModeInterface.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/QRDataModeInterface.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/QRMatrix.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/QRMatrix.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Data/ReedSolomonEncoder.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Data/ReedSolomonEncoder.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Decoder (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Decoder)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Detector (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Detector)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRCodeOutputException.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QREps.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QREps.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRFpdf.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRFpdf.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImage.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImage.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImageBMP.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImageBMP.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImageGIF.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImageGIF.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImageJPEG.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImageJPEG.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImagePNG.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImagePNG.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRGdImageWEBP.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRImage.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRImage.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRImagick.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRImagick.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRMarkup.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRMarkup.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRMarkupHTML.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRMarkupHTML.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRMarkupSVG.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRMarkupSVG.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QROutputAbstract.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QROutputAbstract.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QROutputInterface.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QROutputInterface.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRString.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRString.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRStringJSON.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRStringJSON.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/Output/QRStringText.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/Output/QRStringText.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/QRCode.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/QRCode.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/QRCodeException.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/QRCodeException.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/QROptions.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/QROptions.php)
-
tags/2.1.1/libs/chillerlan/php-qrcode/src/QROptionsTrait.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-qrcode/src/QROptionsTrait.php)
-
tags/2.1.1/libs/chillerlan/php-settings-container/src/SettingsContainerAbstract.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-settings-container/src/SettingsContainerAbstract.php)
-
tags/2.1.1/libs/chillerlan/php-settings-container/src/SettingsContainerInterface.php (copied) (copied from pix-por-piggly/trunk/libs/chillerlan/php-settings-container/src/SettingsContainerInterface.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/DateTimeImmutable.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/DateTimeImmutable.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/ErrorHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/ErrorHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Formatter/LineFormatter.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Formatter/LineFormatter.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Formatter/NormalizerFormatter.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/FilterHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/FilterHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/SamplingHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/SamplingHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/Slack/SlackRecord.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/StreamHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/StreamHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Handler/TelegramBotHandler.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Logger.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Logger.php)
-
tags/2.1.1/libs/monolog/monolog/src/Monolog/Processor/WebProcessor.php (copied) (copied from pix-por-piggly/trunk/libs/monolog/monolog/src/Monolog/Processor/WebProcessor.php)
-
tags/2.1.1/libs/piggly/php-pix/src/AbstractPayload.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/AbstractPayload.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Cob.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Cob.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Amount.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Amount.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Calendar.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Calendar.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/DueAmountModality.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/DueAmountModality.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Location.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Location.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Person.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Person.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Pix.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Pix.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/PixComponentAmount.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/PixComponentAmount.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/Refund.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/Refund.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Api/Payloads/Entities/RequestedRefund.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Api/Payloads/Entities/RequestedRefund.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Emv/MPM.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Emv/MPM.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Utils/Cast.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Utils/Cast.php)
-
tags/2.1.1/libs/piggly/php-pix/src/Utils/Helper.php (copied) (copied from pix-por-piggly/trunk/libs/piggly/php-pix/src/Utils/Helper.php)
-
tags/2.1.1/readme.txt (copied) (copied from pix-por-piggly/trunk/readme.txt) (2 diffs)
-
tags/2.1.1/src (copied) (copied from pix-por-piggly/trunk/src)
-
tags/2.1.1/src/Core/Gateway/PixBlockGateway.php (copied) (copied from pix-por-piggly/trunk/src/Core/Gateway/PixBlockGateway.php)
-
tags/2.1.1/src/Core/Gateway/PixGateway.php (copied) (copied from pix-por-piggly/trunk/src/Core/Gateway/PixGateway.php)
-
tags/2.1.1/src/Core/Processors/ReceiptProcessor.php (copied) (copied from pix-por-piggly/trunk/src/Core/Processors/ReceiptProcessor.php) (12 diffs)
-
tags/2.1.1/src/Core/Woocommerce.php (copied) (copied from pix-por-piggly/trunk/src/Core/Woocommerce.php)
-
tags/2.1.1/src/Data/OrdersTable.php (copied) (copied from pix-por-piggly/trunk/src/Data/OrdersTable.php)
-
tags/2.1.1/templates (copied) (copied from pix-por-piggly/trunk/templates)
-
tags/2.1.1/templates/admin/metabox.php (copied) (copied from pix-por-piggly/trunk/templates/admin/metabox.php)
-
tags/2.1.1/templates/admin/pages/support.php (copied) (copied from pix-por-piggly/trunk/templates/admin/pages/support.php)
-
tags/2.1.1/templates/admin/pages/test.php (copied) (copied from pix-por-piggly/trunk/templates/admin/pages/test.php)
-
tags/2.1.1/templates/woocommerce/html-woocommerce-payment-instructions.php (copied) (copied from pix-por-piggly/trunk/templates/woocommerce/html-woocommerce-payment-instructions.php)
-
tags/2.1.1/vendor (copied) (copied from pix-por-piggly/trunk/vendor)
-
tags/2.1.1/vendor/autoload.php (copied) (copied from pix-por-piggly/trunk/vendor/autoload.php) (1 diff)
-
tags/2.1.1/vendor/composer/ClassLoader.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/ClassLoader.php)
-
tags/2.1.1/vendor/composer/InstalledVersions.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/InstalledVersions.php)
-
tags/2.1.1/vendor/composer/autoload_classmap.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/autoload_classmap.php)
-
tags/2.1.1/vendor/composer/autoload_namespaces.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/autoload_namespaces.php)
-
tags/2.1.1/vendor/composer/autoload_psr4.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/autoload_psr4.php)
-
tags/2.1.1/vendor/composer/autoload_real.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/autoload_real.php) (2 diffs)
-
tags/2.1.1/vendor/composer/autoload_static.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/autoload_static.php) (2 diffs)
-
tags/2.1.1/vendor/composer/installed.json (copied) (copied from pix-por-piggly/trunk/vendor/composer/installed.json)
-
tags/2.1.1/vendor/composer/installed.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/installed.php) (2 diffs)
-
tags/2.1.1/vendor/composer/platform_check.php (copied) (copied from pix-por-piggly/trunk/vendor/composer/platform_check.php)
-
tags/2.1.1/wc-piggly-pix.php (copied) (copied from pix-por-piggly/trunk/wc-piggly-pix.php) (3 diffs)
-
trunk/composer.json (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/src/Core/Processors/ReceiptProcessor.php (modified) (12 diffs)
-
trunk/vendor/autoload.php (modified) (1 diff)
-
trunk/vendor/composer/autoload_real.php (modified) (2 diffs)
-
trunk/vendor/composer/autoload_static.php (modified) (2 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/wc-piggly-pix.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pix-por-piggly/tags/2.1.1/composer.json
r3089716 r3093489 64 64 ] 65 65 }, 66 "version": "2.1. 0"66 "version": "2.1.1" 67 67 } -
pix-por-piggly/tags/2.1.1/readme.txt
r3089716 r3093489 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.5 8 Stable tag: 2.1. 08 Stable tag: 2.1.1 9 9 License: GPLv2 or later 10 10 Language: pt_BR 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 12 13 == Pix por Piggly v2.1. 0==13 == Pix por Piggly v2.1.1 == 14 14 15 15 > Compatível com WooCommerce Blocks e PHP 8.0+. … … 267 267 == Changelog == 268 268 269 = 2.1.1 = 270 271 - Corrigido os problemas de envio do comprovante. 272 269 273 = 2.1.0 = 270 274 -
pix-por-piggly/tags/2.1.1/src/Core/Processors/ReceiptProcessor.php
r3089716 r3093489 10 10 * The receipt processor will process the file sent 11 11 * and attach it to the Pix Entity 12 * 12 * 13 13 * @package \Piggly\WooPixGateway 14 14 * @subpackage \Piggly\WooPixGateway\Core\Processors … … 26 26 * Return the receipt data. Which include 27 27 * a URl and path. 28 * 28 * 29 29 * It will return null if receipt is not 30 30 * valid or dangerous. … … 45 45 if ( \file_exists($data['path']) ) 46 46 { \unlink($data['path']); } 47 47 48 48 return $this->new($pix); 49 49 } … … 61 61 { 62 62 $FILE_NAME = \sanitize_file_name($_FILES['pgly_pix_receipt']['name']); 63 $FILE_TMPNAME = \sanitize_file_name($_FILES['pgly_pix_receipt']['tmp_name']);63 $FILE_TMPNAME = $_FILES['pgly_pix_receipt']['tmp_name']; 64 64 65 65 $expName = \explode('.', $FILE_NAME); … … 79 79 $mime = finfo_file($finfo, $FILE_TMPNAME ); 80 80 finfo_close($finfo); 81 81 82 82 // Validate mime type 83 83 $mimeValidation = \in_array($mime, ['image/jpg','image/jpeg','image/png','application/pdf']); … … 85 85 } 86 86 catch ( Exception $e ) 87 { 87 { 88 88 CoreConnector::debugger()->force()->error(\sprintf(CoreConnector::__translate('O usuário tentou realizar o upload, mas o arquivo não foi encontrado em `%s`. Verifique as configurações do PHP e as permissões da pasta. Verifique, ainda, a biblioteca MAGIC e a extensão file do PHP.'), $FILE_TMPNAME )); 89 throw new Exception(CoreConnector::__translate('O arquivo não pode ser enviado no momento. Tente novamente mais tarde.')); 89 throw new Exception(CoreConnector::__translate('O arquivo não pode ser enviado no momento. Tente novamente mais tarde.')); 90 90 } 91 91 … … 104 104 // Validate extension 105 105 $validateExt = \in_array($pathExt, ['jpg','jpeg','png','pdf']) || \in_array($nameExt, ['jpg','jpeg','png','pdf']); 106 106 107 107 if ( !$validateExt && !$mimeValidation ) 108 108 { throw new Exception(CoreConnector::__translate('O nome do arquivo não indica uma imagem ou um PDF compatível.')); } … … 110 110 if ( !$mimeValidation ) 111 111 { throw new Exception(CoreConnector::__translate('O comprovante foi enviado em um tipo de arquivo não compatível. Envie uma imagem ou um PDF.')); } 112 112 113 113 // Check file size 114 if ($_FILES['pgly_pix_receipt']['size'] > 2000000) 114 if ($_FILES['pgly_pix_receipt']['size'] > 2000000) 115 115 { throw new Exception(CoreConnector::__translate('O tamanho máximo permitido para o arquivo é 2MB, envie um arquivo menor.')); } 116 116 … … 118 118 // Fix extension 119 119 $extension = $validateExt ? $pathExt ?? $nameExt : $mapExt[$mime]; 120 120 121 121 $upload = wp_upload_dir(); 122 122 $dirname = dirname(CoreConnector::plugin()->getBasename()); … … 126 126 $file = $uploadPath.$fileName; 127 127 128 if ( !\file_exists( $uploadPath ) ) 128 if ( !\file_exists( $uploadPath ) ) 129 129 { wp_mkdir_p($uploadPath); } 130 130 131 131 if ( !\move_uploaded_file($FILE_TMPNAME , $file) ) 132 { 132 { 133 133 CoreConnector::debugger()->force()->error(\sprintf(CoreConnector::__translate('Não foi mover o arquivo de upload de `%s` para `%s`.'), $FILE_TMPNAME , $file)); 134 throw new Exception(CoreConnector::__translate('Não foi possível enviar o comprovante agora.')); 134 throw new Exception(CoreConnector::__translate('Não foi possível enviar o comprovante agora.')); 135 135 } 136 136 137 137 /** @var KeyingBucket $settings */ 138 138 $settings = CoreConnector::settings()->get('orders', new KeyingBucket()); 139 139 140 140 $order = $pix->getOrder(); 141 141 $pix->setReceipt($uploadUrl.$fileName, $file); … … 149 149 150 150 if ( !$order->has_status([$settings->get('receipt_status', 'on-hold')]) ) 151 { 152 $order->update_status( 151 { 152 $order->update_status( 153 153 $settings->get('receipt_status', 'on-hold'), 154 ); 154 ); 155 155 } 156 156 … … 166 166 // Do after save order 167 167 do_action('pgly_wc_piggly_pix_after_save_receipt', $pix, $order, $order->get_id()); 168 168 169 169 return [ 170 'url' => $uploadUrl.$fileName, 170 'url' => $uploadUrl.$fileName, 171 171 'path' => $file 172 172 ]; -
pix-por-piggly/tags/2.1.1/vendor/autoload.php
r3089716 r3093489 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf::getLoader();25 return ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4::getLoader(); -
pix-por-piggly/tags/2.1.1/vendor/composer/autoload_real.php
r3089716 r3093489 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf5 class ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
pix-por-piggly/tags/2.1.1/vendor/composer/autoload_static.php
r3089716 r3093489 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf7 class ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 261 261 { 262 262 return \Closure::bind(function () use ($loader) { 263 $loader->prefixLengthsPsr4 = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$prefixLengthsPsr4;264 $loader->prefixDirsPsr4 = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$prefixDirsPsr4;265 $loader->classMap = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$classMap;263 $loader->prefixLengthsPsr4 = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$prefixLengthsPsr4; 264 $loader->prefixDirsPsr4 = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$prefixDirsPsr4; 265 $loader->classMap = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$classMap; 266 266 267 267 }, null, ClassLoader::class); -
pix-por-piggly/tags/2.1.1/vendor/composer/installed.php
r3089716 r3093489 2 2 'root' => array( 3 3 'name' => 'piggly/pix-por-piggly', 4 'pretty_version' => '2.1. 0',5 'version' => '2.1. 0.0',4 'pretty_version' => '2.1.1', 5 'version' => '2.1.1.0', 6 6 'reference' => null, 7 7 'type' => 'wordpress-plugin', … … 48 48 ), 49 49 'piggly/pix-por-piggly' => array( 50 'pretty_version' => '2.1. 0',51 'version' => '2.1. 0.0',50 'pretty_version' => '2.1.1', 51 'version' => '2.1.1.0', 52 52 'reference' => null, 53 53 'type' => 'wordpress-plugin', -
pix-por-piggly/tags/2.1.1/wc-piggly-pix.php
r3089716 r3093489 3 3 * @link https://studio.piggly.com.br/ 4 4 * @since 2.0.0 5 * @version 2.1. 05 * @version 2.1.1 6 6 * @package \Piggly\WooPixGateway 7 7 * @author Caique Araujo <caique@piggly.com.br> … … 18 18 * Requires at least: 6.0 19 19 * Requires PHP: 8.0 20 * Version: 2.1. 020 * Version: 2.1.1 21 21 * Author: Piggly Lab 22 22 * Author URI: https://studio.piggly.com.br/ … … 41 41 42 42 /** @var string Currently plugin version. Start at version 1.0.0 and use SemVer - https://semver.org */ 43 if (!defined('PGLY_PIX_GATEWAY_VERSION')) define( 'PGLY_PIX_GATEWAY_VERSION', '2.1. 0' );43 if (!defined('PGLY_PIX_GATEWAY_VERSION')) define( 'PGLY_PIX_GATEWAY_VERSION', '2.1.1' ); 44 44 45 45 /** @var string Currently plugin version. Start at version 1.0.0 and use SemVer - https://semver.org */ -
pix-por-piggly/trunk/composer.json
r3089716 r3093489 64 64 ] 65 65 }, 66 "version": "2.1. 0"66 "version": "2.1.1" 67 67 } -
pix-por-piggly/trunk/readme.txt
r3089716 r3093489 6 6 Requires PHP: 8.0 7 7 Tested up to: 6.5 8 Stable tag: 2.1. 08 Stable tag: 2.1.1 9 9 License: GPLv2 or later 10 10 Language: pt_BR 11 11 License URI: http://www.gnu.org/licenses/gpl-2.0.html 12 12 13 == Pix por Piggly v2.1. 0==13 == Pix por Piggly v2.1.1 == 14 14 15 15 > Compatível com WooCommerce Blocks e PHP 8.0+. … … 267 267 == Changelog == 268 268 269 = 2.1.1 = 270 271 - Corrigido os problemas de envio do comprovante. 272 269 273 = 2.1.0 = 270 274 -
pix-por-piggly/trunk/src/Core/Processors/ReceiptProcessor.php
r3089716 r3093489 10 10 * The receipt processor will process the file sent 11 11 * and attach it to the Pix Entity 12 * 12 * 13 13 * @package \Piggly\WooPixGateway 14 14 * @subpackage \Piggly\WooPixGateway\Core\Processors … … 26 26 * Return the receipt data. Which include 27 27 * a URl and path. 28 * 28 * 29 29 * It will return null if receipt is not 30 30 * valid or dangerous. … … 45 45 if ( \file_exists($data['path']) ) 46 46 { \unlink($data['path']); } 47 47 48 48 return $this->new($pix); 49 49 } … … 61 61 { 62 62 $FILE_NAME = \sanitize_file_name($_FILES['pgly_pix_receipt']['name']); 63 $FILE_TMPNAME = \sanitize_file_name($_FILES['pgly_pix_receipt']['tmp_name']);63 $FILE_TMPNAME = $_FILES['pgly_pix_receipt']['tmp_name']; 64 64 65 65 $expName = \explode('.', $FILE_NAME); … … 79 79 $mime = finfo_file($finfo, $FILE_TMPNAME ); 80 80 finfo_close($finfo); 81 81 82 82 // Validate mime type 83 83 $mimeValidation = \in_array($mime, ['image/jpg','image/jpeg','image/png','application/pdf']); … … 85 85 } 86 86 catch ( Exception $e ) 87 { 87 { 88 88 CoreConnector::debugger()->force()->error(\sprintf(CoreConnector::__translate('O usuário tentou realizar o upload, mas o arquivo não foi encontrado em `%s`. Verifique as configurações do PHP e as permissões da pasta. Verifique, ainda, a biblioteca MAGIC e a extensão file do PHP.'), $FILE_TMPNAME )); 89 throw new Exception(CoreConnector::__translate('O arquivo não pode ser enviado no momento. Tente novamente mais tarde.')); 89 throw new Exception(CoreConnector::__translate('O arquivo não pode ser enviado no momento. Tente novamente mais tarde.')); 90 90 } 91 91 … … 104 104 // Validate extension 105 105 $validateExt = \in_array($pathExt, ['jpg','jpeg','png','pdf']) || \in_array($nameExt, ['jpg','jpeg','png','pdf']); 106 106 107 107 if ( !$validateExt && !$mimeValidation ) 108 108 { throw new Exception(CoreConnector::__translate('O nome do arquivo não indica uma imagem ou um PDF compatível.')); } … … 110 110 if ( !$mimeValidation ) 111 111 { throw new Exception(CoreConnector::__translate('O comprovante foi enviado em um tipo de arquivo não compatível. Envie uma imagem ou um PDF.')); } 112 112 113 113 // Check file size 114 if ($_FILES['pgly_pix_receipt']['size'] > 2000000) 114 if ($_FILES['pgly_pix_receipt']['size'] > 2000000) 115 115 { throw new Exception(CoreConnector::__translate('O tamanho máximo permitido para o arquivo é 2MB, envie um arquivo menor.')); } 116 116 … … 118 118 // Fix extension 119 119 $extension = $validateExt ? $pathExt ?? $nameExt : $mapExt[$mime]; 120 120 121 121 $upload = wp_upload_dir(); 122 122 $dirname = dirname(CoreConnector::plugin()->getBasename()); … … 126 126 $file = $uploadPath.$fileName; 127 127 128 if ( !\file_exists( $uploadPath ) ) 128 if ( !\file_exists( $uploadPath ) ) 129 129 { wp_mkdir_p($uploadPath); } 130 130 131 131 if ( !\move_uploaded_file($FILE_TMPNAME , $file) ) 132 { 132 { 133 133 CoreConnector::debugger()->force()->error(\sprintf(CoreConnector::__translate('Não foi mover o arquivo de upload de `%s` para `%s`.'), $FILE_TMPNAME , $file)); 134 throw new Exception(CoreConnector::__translate('Não foi possível enviar o comprovante agora.')); 134 throw new Exception(CoreConnector::__translate('Não foi possível enviar o comprovante agora.')); 135 135 } 136 136 137 137 /** @var KeyingBucket $settings */ 138 138 $settings = CoreConnector::settings()->get('orders', new KeyingBucket()); 139 139 140 140 $order = $pix->getOrder(); 141 141 $pix->setReceipt($uploadUrl.$fileName, $file); … … 149 149 150 150 if ( !$order->has_status([$settings->get('receipt_status', 'on-hold')]) ) 151 { 152 $order->update_status( 151 { 152 $order->update_status( 153 153 $settings->get('receipt_status', 'on-hold'), 154 ); 154 ); 155 155 } 156 156 … … 166 166 // Do after save order 167 167 do_action('pgly_wc_piggly_pix_after_save_receipt', $pix, $order, $order->get_id()); 168 168 169 169 return [ 170 'url' => $uploadUrl.$fileName, 170 'url' => $uploadUrl.$fileName, 171 171 'path' => $file 172 172 ]; -
pix-por-piggly/trunk/vendor/autoload.php
r3089716 r3093489 23 23 require_once __DIR__ . '/composer/autoload_real.php'; 24 24 25 return ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf::getLoader();25 return ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4::getLoader(); -
pix-por-piggly/trunk/vendor/composer/autoload_real.php
r3089716 r3093489 3 3 // autoload_real.php @generated by Composer 4 4 5 class ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf5 class ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4 6 6 { 7 7 private static $loader; … … 25 25 require __DIR__ . '/platform_check.php'; 26 26 27 spl_autoload_register(array('ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf', 'loadClassLoader'), true, true);27 spl_autoload_register(array('ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4', 'loadClassLoader'), true, true); 28 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); 29 spl_autoload_unregister(array('ComposerAutoloaderInit 3178f3c6ef85f2d9452fca83c91ededf', 'loadClassLoader'));29 spl_autoload_unregister(array('ComposerAutoloaderInitfe5ac95f715204f2f250faa992ee26b4', 'loadClassLoader')); 30 30 31 31 require __DIR__ . '/autoload_static.php'; 32 call_user_func(\Composer\Autoload\ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::getInitializer($loader));32 call_user_func(\Composer\Autoload\ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::getInitializer($loader)); 33 33 34 34 $loader->register(true); -
pix-por-piggly/trunk/vendor/composer/autoload_static.php
r3089716 r3093489 5 5 namespace Composer\Autoload; 6 6 7 class ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf7 class ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4 8 8 { 9 9 public static $prefixLengthsPsr4 = array ( … … 261 261 { 262 262 return \Closure::bind(function () use ($loader) { 263 $loader->prefixLengthsPsr4 = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$prefixLengthsPsr4;264 $loader->prefixDirsPsr4 = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$prefixDirsPsr4;265 $loader->classMap = ComposerStaticInit 3178f3c6ef85f2d9452fca83c91ededf::$classMap;263 $loader->prefixLengthsPsr4 = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$prefixLengthsPsr4; 264 $loader->prefixDirsPsr4 = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$prefixDirsPsr4; 265 $loader->classMap = ComposerStaticInitfe5ac95f715204f2f250faa992ee26b4::$classMap; 266 266 267 267 }, null, ClassLoader::class); -
pix-por-piggly/trunk/vendor/composer/installed.php
r3089716 r3093489 2 2 'root' => array( 3 3 'name' => 'piggly/pix-por-piggly', 4 'pretty_version' => '2.1. 0',5 'version' => '2.1. 0.0',4 'pretty_version' => '2.1.1', 5 'version' => '2.1.1.0', 6 6 'reference' => null, 7 7 'type' => 'wordpress-plugin', … … 48 48 ), 49 49 'piggly/pix-por-piggly' => array( 50 'pretty_version' => '2.1. 0',51 'version' => '2.1. 0.0',50 'pretty_version' => '2.1.1', 51 'version' => '2.1.1.0', 52 52 'reference' => null, 53 53 'type' => 'wordpress-plugin', -
pix-por-piggly/trunk/wc-piggly-pix.php
r3089716 r3093489 3 3 * @link https://studio.piggly.com.br/ 4 4 * @since 2.0.0 5 * @version 2.1. 05 * @version 2.1.1 6 6 * @package \Piggly\WooPixGateway 7 7 * @author Caique Araujo <caique@piggly.com.br> … … 18 18 * Requires at least: 6.0 19 19 * Requires PHP: 8.0 20 * Version: 2.1. 020 * Version: 2.1.1 21 21 * Author: Piggly Lab 22 22 * Author URI: https://studio.piggly.com.br/ … … 41 41 42 42 /** @var string Currently plugin version. Start at version 1.0.0 and use SemVer - https://semver.org */ 43 if (!defined('PGLY_PIX_GATEWAY_VERSION')) define( 'PGLY_PIX_GATEWAY_VERSION', '2.1. 0' );43 if (!defined('PGLY_PIX_GATEWAY_VERSION')) define( 'PGLY_PIX_GATEWAY_VERSION', '2.1.1' ); 44 44 45 45 /** @var string Currently plugin version. Start at version 1.0.0 and use SemVer - https://semver.org */
Note: See TracChangeset
for help on using the changeset viewer.