Skip to content

Commit

Permalink
Release 3.3.3 #477
Browse files Browse the repository at this point in the history
  • Loading branch information
RafaMelazzo authored Aug 14, 2024
2 parents 51629d8 + e31672b commit 7286f4c
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 33 deletions.
2 changes: 1 addition & 1 deletion assets/javascripts/front/checkout/model/payment/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ let pagarmeCard = {
title: value.brandName,
type: value.brandName,
gaps: value.gaps,
lengths: value.lenghts,
lengths: value.lengths,
image: value.brandImage,
mask: value.mask,
size: value.size,
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "pagarme/woocommerce-pagarme-payments",
"description": "Pagar.me module for Woocommerce",
"type": "wordpress-plugin",
"version": "3.3.2",
"version": "3.3.3",
"license": "GPL",
"autoload": {
"psr-4": {
Expand Down
2 changes: 1 addition & 1 deletion constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.2');
wc_pagarme_define('WCMP_VERSION', '3.3.3');
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');
Expand Down
16 changes: 14 additions & 2 deletions docs/filters-actions/split.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,21 @@ function realizarConfiguracaoMarketplace($marketplaceConfig)
Adicione o filtro `pagarme_split_order` para editar as regras de Split :

```php
add_filter("pagarme_split_order", 'alimentarSplit', 10, 1);
add_filter("pagarme_split_order", 'alimentarSplit', 10, 2);

function alimentarSplit($splitArray)
function alimentarSplit(\WC_Order $order, $paymentMethod)
{
/**
* Pode utilizar os valores do pedido e o tipo de pagamento para realizar o split
*/

$splitArray = [
'sellers' => [],
'marketplace' => [
'totalCommission' => null
]
];

/**
* Todos os valores monetários precisam ser inteiros e em centavos.
* Exemplo: R$ 4,00 você deve passar 400;
Expand All @@ -54,6 +65,7 @@ function alimentarSplit($splitArray)
'commission' => 800, // Comissão do recebedor
'pagarmeId' => 're_xxxxxxxxx0x00000xxxx000xx' // Id do recebedor
];

return $splitArray;
}
```
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "woo-pagarme-payments",
"version": "3.3.2",
"version": "3.3.3",
"description": "Pagar.me module for Woocommerce",
"main": "woo-pagarme-payments.php",
"devDependencies": {
Expand Down
21 changes: 10 additions & 11 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Tags: payment, pagarme, ecommerce, brasil, woocommerce
Requires at least: 4.1
Tested up to: 6.5.5
Requires PHP: 7.1
Stable tag: 3.3.2
Stable tag: 3.3.3
License: MIT
License URI: https://github.com/pagarme/woocommerce/blob/master/LICENSE

Expand All @@ -25,21 +25,20 @@ Nosso processo de instalação é simples e bem detalhado:
== Changelog ==
Lançamos versões regularmente com melhorias, correções e atualizações.

= 3.3.2 (03/07/2024) =
Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.3.2)
= 3.3.3 (14/08/2024) =
Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.3.3)

* **Correções:**
* Exibe uma parcela (à vista) quando o valor do carrinho é menhor que a configuraação de valor mínimo de parcelas
* **Melhorias:**
* Passando pedido e meio de pagamento para o cálculo do split

= 3.3.1 (02/07/2024) =
Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.3.1)
* **Correções:**
* Perdendo informação de bandeira ao trocar meios de pagamento no checkout

* **Melhorias:**
* Adição nova lógica de juros 1.0
= 3.3.2 (03/07/2024) =
Você pode conferir essas atualizações aqui: [Github](https://github.com/pagarme/woocommerce/releases/tag/3.3.2)

* **Correções:**
* Campo "Nome impresso no cartão" aceitando carácter especial
* Cobrar imposto quando preço do produto não incluir a taxa
* Exibe uma parcela (à vista) quando o valor do carrinho é menor que a configuração de valor mínimo de parcelas

== Upgrade Notice ==
Nosso plugin agora é compatível com Woocommerce Subscriptions
11 changes: 4 additions & 7 deletions src/Concrete/WoocommercePlatformOrderDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -1200,13 +1200,10 @@ public function handleSplitOrder()
return null;
}

$splitDataFromOrder = [
'sellers' => [],
'marketplace' => [
'totalCommission' => null
]
];
$splitDataFromOrder = apply_filters('pagarme_split_order', $splitDataFromOrder);
$order = $this->getPlatformOrder();
$paymentMethod = $this->getPaymentMethodPlatform();

$splitDataFromOrder = apply_filters('pagarme_split_order', $order, $paymentMethod);
$this->validateSellerArray($splitDataFromOrder);
$splitData = new Split();
$splitData->setSellersData($splitDataFromOrder['sellers']);
Expand Down
4 changes: 2 additions & 2 deletions templates/checkout/form/card.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ wp_localize_script(
data-mask="0000 0000 0000 0000" placeholder="•••• •••• •••• ••••"
data-required="true" data-pagarme-element="number">
</span>
<input type="hidden" name="<?= $this->getElementId('brand'); ?>"
data-pagarme-element="brand-input"/>
<input type="hidden" name="<?= $this->getElementId('brand'); ?>"
id="<?= $this->getElementId('brand'); ?>" data-pagarme-element="brand-input"/>
</p>
<p class="form-row form-row-first">
<label for="<?= $this->getElementId('card-expiry'); ?>">
Expand Down
8 changes: 4 additions & 4 deletions tests/Concrete/WoocommercePlatformOrderDecoratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function testHandleSplitOrderWithCallFilter()
{
require_once("vendor/wordpress/wordpress/src/wp-includes/plugin.php");
$platformOrderDecorator = $this->returnBasicPlatformOrderDecorator();
add_filter('pagarme_split_order', function($data){
add_filter('pagarme_split_order', function($order, $paymentMethod){
return [
'sellers' => [
[
Expand All @@ -86,7 +86,7 @@ public function testHandleSplitOrderWithCallFilter()
'totalCommission' => 400
]
];
});
}, 10, 2);
$splitReturn = $platformOrderDecorator->handleSplitOrder();
$this->assertInstanceOf(Split::class, $splitReturn);
}
Expand All @@ -96,7 +96,7 @@ public function testHandleSplitOrderWithWrongCallFilter()
$this->expectException(\InvalidArgumentException::class);
require_once("vendor/wordpress/wordpress/src/wp-includes/plugin.php");
$platformOrderDecorator = $this->returnBasicPlatformOrderDecorator();
add_filter('pagarme_split_order', function($data){
add_filter('pagarme_split_order', function($order, $paymentMethod){
return [
'sellers' => [
[
Expand All @@ -108,7 +108,7 @@ public function testHandleSplitOrderWithWrongCallFilter()
'totalCommission' => 400
]
];
});
}, 10, 2);
$platformOrderDecorator->handleSplitOrder();
}

Expand Down
6 changes: 3 additions & 3 deletions woo-pagarme-payments.php
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<?php
/*
* Plugin Name: Pagar.me for WooCommerce
* Version: 3.3.2
* Version: 3.3.3
* Author: Pagar.me
* Author URI: https://pagar.me
* License: GPL2
* Description: Enable Pagar.me Gateway for WooCommerce
* Requires at least: 4.1
* Tested up to: 6.5.5
* Tested up to: 6.6.1
* WC requires at least: 3.9.0
* WC tested up to: 9.0.2
* WC tested up to: 9.1.4
* Domain Path: /languages
* Requires Plugins: woocommerce
* Text Domain: woo-pagarme-payments
Expand Down

0 comments on commit 7286f4c

Please sign in to comment.