Skip to content

Commit a800f20

Browse files
committed
Merge branch 'release/4.45.0'
2 parents 5290ded + 5edec21 commit a800f20

File tree

16 files changed

+1877
-124
lines changed

16 files changed

+1877
-124
lines changed

admin/views/html-settings-page.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
<a href="https://pbintegracoes.com/connect/autorizar/?utm_source=wordpressadmin" onclick="window.open(this.href, '_blank'); return false;" class="button button-secondary"><?php esc_html_e('Obter Connect Key', 'pagbank-connect') ?></a>
3939
<a href="https://pbintegracoes.com/connect/sandbox/?utm_source=wordpressadmin" onclick="window.open(this.href, '_blank'); return false;" class="button button-secondary"><?php esc_html_e('Obter Connect Key para Testes', 'pagbank-connect') ?></a>
4040
<a href="https://ajuda.pbintegracoes.com/hc/pt-br/?utm_source=wordpressadmin" target="_blank" class="button button-secondary" title="<?php esc_html_e('Ir para central de ajuda. Lá você pode encontrar resposta para a maioria dos problemas e perguntas, ou entrar em contato conosco.', 'pagbank-connect');?>"><?php esc_html_e('Obter ajuda', 'pagbank-connect') ?></a>
41+
<a href="<?php echo admin_url( 'admin.php?page=wc-settings&tab=shipping&section=rm_enviofacil' ) ?>" class="button button-secondary" title="<?php esc_html_e('Economize no Frete com Envio Fácil', 'pagbank-connect');?>"><?php esc_html_e('📦 Envio Fácil', 'pagbank-connect') ?></a>
4142
<?php endif; ?>
4243
<?php echo '<table class="form-table">' . $this->generate_settings_html( $this->get_form_fields(), false ) . '</table>'; // WPCS: XSS ok. ?>
4344
</fieldset>

admin/views/settings/general-fields.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -27,19 +27,6 @@
2727
'desc' => '',
2828
'id' => 'wc_pagseguro_connect_general_options',
2929
],
30-
// 'standalone' => [
31-
// 'title' => esc_html(__( 'Separar meios de pagamento', 'pagbank-connect')),
32-
// 'label' => esc_html(__('Mostrar meios de pagamento de forma individual', 'pagbank-connect')),
33-
// 'type' => 'checkbox',
34-
// 'desc_tip' => true,
35-
// 'description' => esc_html(
36-
// __(
37-
// 'Recomendável se você aceita outros gateways de pagamento. É apenas uma configuração visual.',
38-
// 'pagbank-connect'
39-
// )),
40-
// 'default' => 'yes',
41-
// 'id' => 'wc_pagseguro_connect_together_options',
42-
// ],
4330
'hide_if_unavailable' => [
4431
'title' => esc_html(__( 'Ocultar meios de pagamento', 'pagbank-connect')),
4532
'label' => esc_html(__('Ocultar meios de pagamento para pedidos com total menor que R$ 1,00', 'pagbank-connect')),
@@ -76,17 +63,6 @@
7663
'maxlength' => 40,
7764
]
7865
],
79-
// 'title_display' => [
80-
// 'title' => __('Exibir Título', 'pagbank-connect'),
81-
// 'type' => 'select',
82-
// 'description' => __('Exibir ou não o título do meio de pagamento no checkout.', 'pagbank-connect'),
83-
// 'default' => 'logo_only',
84-
// 'options' => [
85-
// 'logo_only' => __('Somente o Logo', 'pagbank-connect'),
86-
// 'text_only' => __('Somente o Texto', 'pagbank-connect'),
87-
// 'both' => __('Ambos', 'pagbank-connect'),
88-
// ],
89-
// ],
9066
'shipping_param' => [
9167
'title' => __('Endereço de Entrega', 'pagbank-connect'),
9268
'type' => 'select',

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "ricardomartins/pagbank-woocommerce",
33
"description": "Integração PagBank (PagSeguro) WooCommerce com desconto nas taxas oficiais",
44
"type": "wordpress-plugin",
5-
"version": "4.44.4",
5+
"version": "4.45.0",
66
"license": "GPL-3.0",
77
"autoload": {
88
"psr-4": {

public/css/admin/boxes.css

Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
/**
2+
* Style crud boxes admin
3+
*
4+
* @package PagBank Connect
5+
* @author Ricardo Martins
6+
*/
7+
8+
/* Estilos para a listagem de caixas */
9+
.wp-list-table .column-reference {
10+
width: 15%;
11+
}
12+
13+
.wp-list-table .column-dimensions {
14+
width: 25%;
15+
}
16+
17+
.wp-list-table .column-weight {
18+
width: 15%;
19+
}
20+
21+
.wp-list-table .column-cost {
22+
width: 10%;
23+
}
24+
25+
.wp-list-table .column-is_available {
26+
width: 10%;
27+
}
28+
29+
.wp-list-table .column-created_at {
30+
width: 15%;
31+
}
32+
33+
/* Estilos para o formulário de caixa */
34+
.form-table th {
35+
width: 200px;
36+
}
37+
38+
.form-table h3 {
39+
margin: 20px 0 10px 0;
40+
padding: 10px 0;
41+
border-bottom: 1px solid #ddd;
42+
color: #23282d;
43+
}
44+
45+
.form-table h3:first-child {
46+
margin-top: 0;
47+
}
48+
49+
/* Estilos para campos numéricos */
50+
.form-table input[type="number"] {
51+
width: 80px;
52+
}
53+
54+
.form-table .description {
55+
font-style: italic;
56+
color: #666;
57+
margin-left: 5px;
58+
}
59+
60+
/* Estilos para notificações */
61+
.notice {
62+
margin: 15px 0;
63+
}
64+
65+
/* Estilos para botões de ação */
66+
.page-title-action {
67+
margin-left: 10px;
68+
}
69+
70+
/* Estilos para ícones de status */
71+
.dashicons-yes-alt {
72+
color: #46b450 !important;
73+
}
74+
75+
.dashicons-dismiss {
76+
color: #dc3232 !important;
77+
}
78+
79+
/* Estilos para filtros */
80+
.alignleft.actions {
81+
margin-bottom: 10px;
82+
}
83+
84+
.alignleft.actions select {
85+
margin-right: 10px;
86+
}
87+
88+
/* Estilos responsivos */
89+
@media screen and (max-width: 782px) {
90+
.wp-list-table .column-dimensions,
91+
.wp-list-table .column-weight {
92+
display: none;
93+
}
94+
95+
.form-table th {
96+
width: auto;
97+
}
98+
99+
.form-table input[type="number"] {
100+
width: 100%;
101+
max-width: 120px;
102+
}
103+
}
104+
105+
/* Estilos para validação de formulário */
106+
.form-table input:invalid {
107+
border-color: #dc3232;
108+
}
109+
110+
.form-table input:valid {
111+
border-color: #46b450;
112+
}
113+
114+
/* Estilos para campos obrigatórios */
115+
.required {
116+
color: #dc3232;
117+
}
118+
119+
/* Estilos para seções do formulário */
120+
.form-table tr[colspan="2"] th {
121+
background-color: #f1f1f1;
122+
font-weight: bold;
123+
padding: 15px 10px;
124+
}
125+
126+
/* Estilos para tooltips */
127+
[title] {
128+
cursor: help;
129+
}
130+
131+
/* Estilos para mensagens de erro */
132+
.notice-error p {
133+
color: #dc3232;
134+
font-weight: bold;
135+
}
136+
137+
/* Estilos para mensagens de sucesso */
138+
.notice-success p {
139+
color: #46b450;
140+
font-weight: bold;
141+
}
142+
143+
/* Estilos para a tabela de listagem */
144+
.wp-list-table tbody tr:hover {
145+
background-color: #f9f9f9;
146+
}
147+
148+
/* Estilos para ações em lote */
149+
.bulk-actions {
150+
margin-bottom: 10px;
151+
}
152+
153+
/* Estilos para paginação */
154+
.tablenav-pages {
155+
margin-top: 10px;
156+
}
157+
158+
/* Estilos para busca */
159+
.search-box {
160+
margin-bottom: 10px;
161+
}
162+
163+
/* Estilos para ordenação */
164+
.wp-list-table .sortable a {
165+
text-decoration: none;
166+
}
167+
168+
.wp-list-table .sortable a:hover {
169+
text-decoration: underline;
170+
}
171+
172+
/* Estilos para checkboxes */
173+
.wp-list-table .check-column {
174+
width: 2.2em;
175+
}
176+
177+
/* Estilos para links de ação */
178+
.row-actions {
179+
color: #ddd;
180+
font-size: 11px;
181+
margin-left: 0;
182+
padding: 2px 0 0;
183+
visibility: hidden;
184+
}
185+
186+
.wp-list-table tr:hover .row-actions {
187+
visibility: visible;
188+
}
189+
190+
.row-actions span {
191+
display: inline;
192+
}
193+
194+
.row-actions .edit a {
195+
color: #0073aa;
196+
}
197+
198+
.row-actions .delete a {
199+
color: #a00;
200+
}
201+
202+
.row-actions .delete a:hover {
203+
color: #dc3232;
204+
}

public/js/blocks/components/SavedCardInstallments.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
import React, { useState, useEffect } from 'react';
22
import { __ } from '@wordpress/i18n';
33
import InstallmentsOptions from './InstallmentsOptions';
4+
import RecurringInfo from './RecurringInfo';
45

56
const SavedCardInstallments = (props) => {
67
const { token, emitResponse, eventRegistration, billing } = props;
7-
const { onPaymentSetup, onCheckoutValidation: onCheckoutValidation, onCheckoutSuccess, onCheckoutFail } = eventRegistration;
8+
const total = billing?.cartTotal?.value || 0;
9+
const showInstallments = Number(total) > 0;
10+
const { onPaymentSetup, onCheckoutValidation: onCheckoutValidation, onCheckoutSuccess, onCheckoutFail } = eventRegistration;
811
// Example: fetch installments by saved card BIN
912
const [installments, setInstallments] = useState([]);
1013
const [selectedInstallment, setSelectedInstallment] = useState('1'); // default to 1 installment
1114

1215
// Function to fetch installments based on BIN and total amount
1316
const fetchInstallments = (bin, total) => {
14-
if (!bin || bin.length < 6) return;
17+
if (!bin || bin.length < 6 || !total || Number(total) <= 0) return;
1518
jQuery.ajax({
1619
url: window.wc.wcSettings.getSetting('rm-pagbank-cc_data', {}).ajax_url,
1720
method: 'POST',
@@ -86,12 +89,17 @@ const SavedCardInstallments = (props) => {
8689

8790
}, [selectedInstallment, token, onPaymentSetup]);
8891

92+
const settings = window.wc.wcSettings.getSetting('rm-pagbank-cc_data', {});
93+
if (!showInstallments) {
94+
return settings.isCartRecurring ? <RecurringInfo /> : null;
95+
}
8996
return (
9097
<div style={{ marginTop: '1em' }}>
9198
<InstallmentsOptions
9299
installments={installments}
93100
onChange={e => setSelectedInstallment(e.target.value)}
94101
/>
102+
{settings.isCartRecurring ? <RecurringInfo /> : null}
95103
</div>
96104
);
97105
};

readme.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Donate link: https://github.com/sponsors/r-martins
55
Requires at least: 4.0
66
Tested up to: 6.8
77
Requires PHP: 7.4
8-
Stable tag: 4.44.4
8+
Stable tag: 4.45.0
99
License: GPLv3
1010
License URI: https://www.gnu.org/licenses/gpl-3.0.html
1111
PagBank com PIX, Cartão de Crédito, Boleto, Recorrência + Envio Fácil e com Menos Taxas no PagSeguro.
@@ -211,6 +211,9 @@ Você deve fazer isso através de Pull Requests ao [repositório oficial no gith
211211

212212
== Changelog ==
213213

214+
= 4.45.0 =
215+
* Envio Fácil ficou mais inteligente. Agora é possível cadastrar as suas embalagens disponíveis, e o sistema calculará automaticamente que embalagens devem ser usadas para cada carrinho, incluindo o uso de múltiplas embalagens para um único pedido.
216+
214217
= 4.44.4 =
215218
* Correção: melhoria na segurança. Um administrador poderia modificar algumas queries de forma arbitrária. CVE-2025-10142
216219

rm-pagbank.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Plugin Name: PagBank Connect
1212
* Plugin URI: https://pbintegracoes.com
1313
* Description: Integra seu WooCommerce com as APIs PagSeguro v4 através da aplicação de Ricardo Martins (com descontos nas taxas oficiais), com suporte a PIX transparente e muito mais.
14-
* Version: 4.44.4
14+
* Version: 4.45.0
1515
* Requires at least: 5.2
1616
* Tested up to: 6.8
1717
* Requires PHP: 7.4
@@ -33,7 +33,7 @@
3333
defined( 'ABSPATH' ) || die( 'No direct script access allowed!' );
3434

3535
// Plugin constants.
36-
define( 'WC_PAGSEGURO_CONNECT_VERSION', '4.44.4' );
36+
define( 'WC_PAGSEGURO_CONNECT_VERSION', '4.45.0' );
3737
define( 'WC_PAGSEGURO_CONNECT_PLUGIN_FILE', __FILE__ );
3838
define( 'WC_PAGSEGURO_CONNECT_BASE_DIR', __DIR__ );
3939
define( 'WC_PAGSEGURO_CONNECT_TEMPLATES_DIR', WC_PAGSEGURO_CONNECT_BASE_DIR . '/src/templates/' );

src/Connect.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,36 @@ public static function upgrade()
514514
$wpdb->query($sql);
515515
update_option('pagbank_db_version', '4.28');
516516
}
517+
518+
if (version_compare($stored_version, '4.29', '<')) {
519+
require_once ABSPATH . 'wp-admin/includes/upgrade.php';
520+
521+
$boxesTable = $wpdb->prefix . 'pagbank_ef_boxes';
522+
$sql = "CREATE TABLE IF NOT EXISTS $boxesTable
523+
(
524+
box_id int NOT NULL AUTO_INCREMENT,
525+
reference varchar(30) NOT NULL,
526+
is_available tinyint NOT NULL DEFAULT '1',
527+
outer_width varchar(30) NOT NULL,
528+
outer_depth varchar(30) NOT NULL,
529+
outer_length varchar(30) NOT NULL,
530+
thickness varchar(30) NOT NULL DEFAULT 0.20,
531+
inner_length varchar(30) NOT NULL,
532+
inner_width varchar(30) NOT NULL,
533+
inner_depth decimal(30) NOT NULL,
534+
max_weight int NOT NULL,
535+
empty_weight int NOT NULL,
536+
cost float(4,2) DEFAULT '0.00',
537+
created_at datetime DEFAULT CURRENT_TIMESTAMP,
538+
updated_at datetime DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
539+
PRIMARY KEY (box_id),
540+
UNIQUE KEY reference (reference)
541+
)
542+
ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Boxes related to Envio Fácil Shipping';";
543+
544+
dbDelta($sql);
545+
update_option('pagbank_db_version', '4.29');
546+
}
517547
}
518548

519549
public static function uninstall()

0 commit comments

Comments
 (0)