Skip to content

Commit 438b30b

Browse files
author
Mercado Pago
committed
Release v7.9.1
1 parent bb1f5cb commit 438b30b

File tree

124 files changed

+12625
-1832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

124 files changed

+12625
-1832
lines changed

.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
clover.xml
55
coverage
6+
coverage.xml
67

78
/.idea/
89
/.vscode/
@@ -13,3 +14,5 @@ coverage
1314
woocommerce-mercadopago.zip
1415

1516
qit-env.yml
17+
18+
.env

.pre-commit-config.yaml

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
11
repos:
22
# Websec hook is MANDATORY, DO NOT comment it.
3-
- repo: [email protected]-emu:melisource/fury_websec-git-hooks
3+
- repo: [email protected]:melisource/fury_websec-git-hooks
44
rev: v2.0.0
55
hooks:
66
- id: pre_commit_hook
7-
stages: [commit]
7+
stages: [ commit ]
88
- id: post_commit_hook
9-
stages: [post-commit]
9+
stages: [ post-commit ]
1010

11-
- repo: [email protected]-emu:melisource/fury_datasec-git-hooks.git
12-
rev: 1.2.0
11+
- repo: [email protected]:melisource/fury_datasec-git-hooks
12+
rev: 1.2.1
1313
hooks:
1414
- id: pre_commit_hook
15-
stages: [commit]
16-
verbose: true
15+
stages: [ pre-commit ]
1716
- id: post_commit_hook
18-
stages: [post-commit]
17+
stages: [ post-commit ]
1918

2019
- repo: local
2120
hooks:
2221
- id: add-index
2322
name: Add index.php
24-
stages: [pre-commit]
23+
stages: [ pre-commit ]
2524
language: script
26-
entry: ./bin/add-index.sh
25+
entry: ./bin/add-index.sh

CHANGELOG.md

+27
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,33 @@ 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+
## [7.9.1] - 2024-12-17
9+
### Fixed
10+
- The number input on the ticket row now takes precedence over the "no number" button.
11+
- On checkout, some users were unable to select the payment method on the ticket row; this issue has been fixed.
12+
- Due to compatibility issues with the latest WooCommerce releases, we've updated the method by which we check and load scripts and styles.
13+
14+
## [7.9.0] - 2024-12-16
15+
### Added
16+
- The plugin now explicitly declares its dependency on WooCommerce.
17+
- The ticket row for Brazil now requires the billing address from your customers due to regulatory reasons.
18+
### Fixed
19+
- Improved the reusability of some classes in the codebase.
20+
- Removed unused code from styles, scripts, and PHP files.
21+
- Removed certain images from the plugin and now access them via MercadoLibre's CDN.
22+
- Eliminated unused files from the MercadoPago SDK in the release build.
23+
- Adjusted default credits row name in MLB.
24+
### Changed
25+
- Added a check to ensure wp_query is present before calling is_checkout.
26+
- A warning is now shown when there is an error with installments on card form.
27+
- Combined Spanish translations into a single file.
28+
- Reduced the package size by 6MB (from 7.2mb to 1.2mb).
29+
- GIFs are now loaded from URLs instead of local files in the admin panel.
30+
31+
## [7.8.2] - 2024-11-07
32+
### Fixed
33+
- **Initializing array for transaction listItems** to fix acessing not initialized property.
34+
835
## [7.8.1] - 2024-10-07
936

1037
### Added

README.md

+42-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ Welcome to the readme for Mercado Pago Payment Gateway Plugin. This guide is int
2424

2525
8. [Contributing](#contributing)
2626

27-
9. [Support and Issues](#support-and-issues)
27+
9. [Running Tests](#running-tests)
28+
29+
10. [Support and Issues](#support-and-issues)
2830

2931

3032

@@ -114,7 +116,45 @@ class ExamplePaymentTransaction extends AbstractPaymentTransaction {
114116
In this example, the `ExamplePaymentTransaction` class extends the payment transaction functionality and can be customized as needed.
115117

116118
You can see more on the github wiki page.
117-
119+
120+
## Running Tests
121+
122+
This project uses [PHPUnit](https://phpunit.de/) for automated testing and generating code coverage reports. Follow the instructions below to run tests and generate coverage reports.
123+
124+
### Requirements
125+
126+
Ensure that all dependencies are installed by running:
127+
128+
```bash
129+
composer install
130+
```
131+
132+
### Test Commands
133+
134+
To run all project tests and generate HTML code coverage reports, you can use the pre-configured commands in `composer.json`.
135+
136+
- Run all tests:
137+
138+
```bash
139+
composer phpunit
140+
```
141+
This command will execute all tests in the project and display results in the terminal.
142+
143+
- Run a specific test file:
144+
```bash
145+
composer phpunit-file path/to/your/testfile.php
146+
```
147+
This command allows you to focus on a single test file, which is useful for development and debugging.
148+
149+
### Code Coverage Reports
150+
After running the tests, a coverage directory will be generated in the project root, containing the reports in HTML format. You can view the reports by opening coverage/index.html in a browser.
151+
152+
### How to mock Wordpress
153+
154+
To mock WordPress functions and classes in your unit tests, you can use the `WP_Mock` library. It simplifies the creation of mocks and stubs for WordPress functions, allowing you to test your code in isolation.
155+
156+
For more information, refer to the [WP_Mock documentation](https://wp-mock.gitbook.io/documentation).
157+
118158
## Support and Issues
119159

120160

assets/css/checkouts/mp-plugins-components.min.css

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

assets/js/blocks/components/InputDocument.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
const InputDocument = ({
22
labelMessage,
3-
helperMessage,
3+
helperInvalid,
4+
helperEmpty,
5+
helperWrong,
46
inputName,
57
hiddenId,
68
inputDataCheckout,
@@ -14,7 +16,9 @@ const InputDocument = ({
1416
<div className="mp-checkout-ticket-input-document">
1517
<input-document
1618
label-message={labelMessage}
17-
helper-message={helperMessage}
19+
helper-invalid={helperInvalid}
20+
helper-empty={helperEmpty}
21+
helper-wrong={helperWrong}
1822
input-name={inputName}
1923
hidden-id={hiddenId}
2024
input-data-checkout={inputDataCheckout}
+8-33
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,10 @@
1-
const RowImageSelect = ({text, imgSrc}) => {
2-
return (
3-
<div style={
4-
{
5-
height: "18px",
6-
display: "flex",
7-
justifyContent: "space-between",
8-
alignContent: "center",
9-
alignItems: "center",
10-
flexDirection: "row"
11-
}
12-
}>
13-
<img
14-
style={
15-
{
16-
marginRight: "8px",
17-
height: "25px",
18-
width: "30px",
19-
padding: 0
20-
}
21-
}
22-
src={imgSrc}
23-
/>
24-
<p style={
25-
{
26-
fontFamily: '"Proxima Nova", -apple-system, "Helvetica Neue", Helvetica, "Roboto", Arial, sans-serif',
27-
fontSize: "18px",
28-
padding: 0
29-
}
30-
}>{text}</p>
31-
</div>
32-
);
1+
const RowImageSelect = ({ text, imgSrc, id }) => {
2+
return (
3+
<div id={id} className="row-image-select">
4+
<img src={imgSrc} />
5+
<p>{text}</p>
6+
</div>
7+
);
338
}
349

35-
export default RowImageSelect;
10+
export default RowImageSelect;

assets/js/blocks/components/TestMode.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
const TestMode = ({ title, description, linkText, linkSrc }) => (
2-
<div className="mp-checkout-pro-test-mode">
2+
<div className="mp-test-mode-container">
33
<test-mode title={title} description={description} link-text={linkText} link-src={linkSrc} />
44
</div>
55
);

assets/js/blocks/custom.block.js

+7-3
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,9 @@ const Content = (props) => {
7878
card_security_code_input_label,
7979
card_security_code_input_helper,
8080
card_document_input_label,
81-
card_document_input_helper,
81+
card_input_document_helper_invalid,
82+
card_input_document_helper_empty,
83+
card_input_document_helper_wrong,
8284
card_installments_title,
8385
card_issuer_input_label,
8486
card_installments_input_helper,
@@ -249,7 +251,7 @@ const Content = (props) => {
249251
<div className={'mp-checkout-container'}>
250252
<div className={'mp-checkout-custom-container'}>
251253
{test_mode ? (
252-
<div className={'mp-checkout-pro-test-mode'}>
254+
<div className={'mp-test-mode-container'}>
253255
<TestMode
254256
title={test_mode_title}
255257
description={test_mode_description}
@@ -369,7 +371,9 @@ const Content = (props) => {
369371
<div id={'mp-doc-div'} className={'mp-checkout-custom-input-document'} style={{ display: 'none' }}>
370372
<InputDocument
371373
labelMessage={card_document_input_label}
372-
helperMessage={card_document_input_helper}
374+
helperInvalid={card_input_document_helper_invalid}
375+
helperEmpty={card_input_document_helper_empty}
376+
helperWrong={card_input_document_helper_wrong}
373377
inputName={'identificationNumber'}
374378
hiddenId={'form-checkout__identificationNumber'}
375379
inputDataCheckout={'docNumber'}

assets/js/blocks/pse.block.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,9 @@ const Content = (props) => {
8282
test_mode_link_text,
8383
test_mode_link_src,
8484
input_document_label,
85-
input_document_helper,
85+
input_document_helper_empty,
86+
input_document_helper_invalid,
87+
input_document_helper_wrong,
8688
pse_text_label,
8789
person_type_label,
8890
amount,
@@ -110,7 +112,9 @@ const Content = (props) => {
110112

111113
let inputDocumentConfig = {
112114
labelMessage: input_document_label,
113-
helperMessage: input_document_helper,
115+
helperInvalid: input_document_helper_invalid,
116+
helperEmpty: input_document_helper_empty,
117+
helperWrong: input_document_helper_wrong,
114118
validate: 'true',
115119
selectId: 'doc_type',
116120
flagError: 'mercadopago_pse[docNumberError]',

0 commit comments

Comments
 (0)