Skip to content

Commit 1c7bfd1

Browse files
Merge pull request #409 from mercadopago/release/8.5.5
Release v8.5.5
2 parents 51bc07d + 8673617 commit 1c7bfd1

26 files changed

+630
-113
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [8.5.5] - 2025-10-03
9+
### Fixed
10+
- Fix issue with checkout session data not being properly merged in blocks and classic checkout
11+
812
## [8.5.4] - 2025-10-02
913
### Fixed
1014
- Add status validation to prevent unnecessary metadata updates

assets/js/blocks/credits.block.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const updateCart = (props) => {
2424

2525
const unsubscribe = onPaymentSetup(() => {
2626
return {
27-
type: emitResponse.responseTypes.SUCCESS.Content,
27+
type: emitResponse.responseTypes.SUCCESS,
2828
meta: {
2929
paymentMethodData: {...window.mpHiddenInputDataFromBlocksCheckout},
3030
},

build/credits.block.asset.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities'), 'version' => 'da11ea7305df5e30d19e');
1+
<?php return array('dependencies' => array('react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-html-entities'), 'version' => 'f65c62c2c94cc9e73b26');

build/credits.block.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

changelog.log

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
CHANGELOG:
22
== Changelog ==
33

4+
= v8.5.5 (03/10/2025) =
5+
* Fixed
6+
- Fix issue with checkout session data not being properly merged in blocks and classic checkout
7+
48
= v8.5.4 (02/10/2025) =
59
* Fixed
610
- Add status validation to prevent unnecessary metadata updates

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "woocommerce-mercadopago",
33
"description": "Woocommerce MercadoPago Payment Gateway",
4-
"version": "8.5.4",
4+
"version": "8.5.5",
55
"main": "main.js",
66
"repository": {
77
"type": "git",

readme.txt

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Tags: ecommerce, mercadopago, woocommerce
44
Requires at least: 6.3
55
Tested up to: 6.8.1
66
Requires PHP: 7.4
7-
Stable tag: 8.5.4
7+
Stable tag: 8.5.5
88
License: GPLv2 or later
99
License URI: https://www.gnu.org/licenses/gpl-2.0.html
1010

@@ -134,12 +134,8 @@ Set up both the plugin and the checkouts you want to activate on your payment av
134134

135135
Check out our <a href="https://www.mercadopago.com.br/developers/pt/plugins_sdks/plugins/official/woo-commerce/">official documentation</a> for more information on the specific fields to configure.
136136

137-
= v8.5.4 (02/10/2025) =
137+
= v8.5.5 (03/10/2025) =
138138
* Fixed
139-
- Add status validation to prevent unnecessary metadata updates
140-
- Fixed location id in melidata tracks for admin pages
141-
- Fix order-pay form validation error with Checkout Transparent payment method
142-
* Added
143-
- Improve plugin checkout metrics
139+
- Fix issue with checkout session data not being properly merged in blocks and classic checkout
144140

145141
[See changelog for all versions](https://github.com/mercadopago/cart-woocommerce/blob/main/CHANGELOG.md).

src/Gateways/AbstractGateway.php

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,22 @@ public function validate_fields(): bool
412412
return true;
413413
}
414414

415+
public function setCheckoutSessionDataOnSessionHelperByOrderId(string $orderId)
416+
{
417+
$checkoutSessionData = [];
418+
if (isset($_POST['mercadopago_checkout_session'])) {
419+
// Classic Checkout
420+
$checkoutSessionData = Form::sanitizedPostData('mercadopago_checkout_session');
421+
} else {
422+
// Blocks Checkout
423+
$checkoutSessionData = $this->processBlocksCheckoutData('mercadopago_checkout_session', Form::sanitizedPostData());
424+
}
425+
426+
if (!empty($checkoutSessionData)) {
427+
$this->mercadopago->helpers->session->setSession('mp_checkout_session_' . $orderId, $checkoutSessionData);
428+
}
429+
}
430+
415431
/**
416432
* Process payment and create woocommerce order
417433
*
@@ -449,6 +465,8 @@ public function process_payment($order_id): array
449465
$this->mercadopago->orderMetadata->setCommissionData($order, $feeText);
450466
}
451467

468+
$this->setCheckoutSessionDataOnSessionHelperByOrderId($order->get_id());
469+
452470
return $this->proccessPaymentInternal($order);
453471
} catch (Exception $e) {
454472
return $this->processReturnFail(

src/Gateways/CustomGateway.php

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -453,20 +453,6 @@ public function proccessPaymentInternal($order): array
453453
case 'wallet_button':
454454
$this->mercadopago->logs->file->info('Preparing to render wallet button checkout', self::LOG_SOURCE);
455455

456-
// Store checkout session data for wallet button
457-
$checkoutSessionData = [];
458-
if (isset($_POST['mercadopago_checkout_session'])) {
459-
// Classic Checkout
460-
$checkoutSessionData = Form::sanitizedPostData('mercadopago_checkout_session');
461-
} else {
462-
// Blocks Checkout
463-
$checkoutSessionData = $this->processBlocksCheckoutData('mercadopago_checkout_session', Form::sanitizedPostData());
464-
}
465-
466-
if (!empty($checkoutSessionData)) {
467-
$this->mercadopago->helpers->session->setSession('mp_wallet_checkout_session_' . $order->get_id(), $checkoutSessionData);
468-
}
469-
470456
return [
471457
'result' => 'success',
472458
'redirect' => $this->mercadopago->helpers->url->setQueryVar(
@@ -581,20 +567,12 @@ private function getWalletButtonPreviewUrl(): string
581567
public function renderOrderForm($orderId): void
582568
{
583569
if ($this->mercadopago->helpers->url->validateQueryVar('wallet_button')) {
584-
$order = wc_get_order($orderId);
585-
$checkoutSessionData = $this->mercadopago->helpers->session->getSession('mp_wallet_checkout_session_' . $orderId);
570+
$order = wc_get_order($orderId);
586571

587572
$this->transaction = new WalletButtonTransaction($this, $order);
588573

589-
// Set checkout data if available
590-
if (!empty($checkoutSessionData)) {
591-
$this->transaction->setCheckoutData($checkoutSessionData);
592-
}
593-
594574
$preference = $this->transaction->createPreference();
595575

596-
$this->mercadopago->helpers->session->deleteSession('mp_wallet_checkout_session_' . $orderId);
597-
598576
$this->mercadopago->hooks->template->getWoocommerceTemplate(
599577
'public/receipt/preference-modal.php',
600578
[

0 commit comments

Comments
 (0)