Skip to content

Commit

Permalink
Release v7.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Mercado Pago committed Dec 18, 2024
1 parent bb1f5cb commit 438b30b
Show file tree
Hide file tree
Showing 124 changed files with 12,625 additions and 1,832 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

clover.xml
coverage
coverage.xml

/.idea/
/.vscode/
Expand All @@ -13,3 +14,5 @@ coverage
woocommerce-mercadopago.zip

qit-env.yml

.env
19 changes: 9 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,25 @@
repos:
# Websec hook is MANDATORY, DO NOT comment it.
- repo: [email protected]-emu:melisource/fury_websec-git-hooks
- repo: [email protected]:melisource/fury_websec-git-hooks
rev: v2.0.0
hooks:
- id: pre_commit_hook
stages: [commit]
stages: [ commit ]
- id: post_commit_hook
stages: [post-commit]
stages: [ post-commit ]

- repo: [email protected]-emu:melisource/fury_datasec-git-hooks.git
rev: 1.2.0
- repo: [email protected]:melisource/fury_datasec-git-hooks
rev: 1.2.1
hooks:
- id: pre_commit_hook
stages: [commit]
verbose: true
stages: [ pre-commit ]
- id: post_commit_hook
stages: [post-commit]
stages: [ post-commit ]

- repo: local
hooks:
- id: add-index
name: Add index.php
stages: [pre-commit]
stages: [ pre-commit ]
language: script
entry: ./bin/add-index.sh
entry: ./bin/add-index.sh
27 changes: 27 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [7.9.1] - 2024-12-17
### Fixed
- The number input on the ticket row now takes precedence over the "no number" button.
- On checkout, some users were unable to select the payment method on the ticket row; this issue has been fixed.
- Due to compatibility issues with the latest WooCommerce releases, we've updated the method by which we check and load scripts and styles.

## [7.9.0] - 2024-12-16
### Added
- The plugin now explicitly declares its dependency on WooCommerce.
- The ticket row for Brazil now requires the billing address from your customers due to regulatory reasons.
### Fixed
- Improved the reusability of some classes in the codebase.
- Removed unused code from styles, scripts, and PHP files.
- Removed certain images from the plugin and now access them via MercadoLibre's CDN.
- Eliminated unused files from the MercadoPago SDK in the release build.
- Adjusted default credits row name in MLB.
### Changed
- Added a check to ensure wp_query is present before calling is_checkout.
- A warning is now shown when there is an error with installments on card form.
- Combined Spanish translations into a single file.
- Reduced the package size by 6MB (from 7.2mb to 1.2mb).
- GIFs are now loaded from URLs instead of local files in the admin panel.

## [7.8.2] - 2024-11-07
### Fixed
- **Initializing array for transaction listItems** to fix acessing not initialized property.

## [7.8.1] - 2024-10-07

### Added
Expand Down
44 changes: 42 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ Welcome to the readme for Mercado Pago Payment Gateway Plugin. This guide is int

8. [Contributing](#contributing)

9. [Support and Issues](#support-and-issues)
9. [Running Tests](#running-tests)

10. [Support and Issues](#support-and-issues)



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

You can see more on the github wiki page.


## Running Tests

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.

### Requirements

Ensure that all dependencies are installed by running:

```bash
composer install
```

### Test Commands

To run all project tests and generate HTML code coverage reports, you can use the pre-configured commands in `composer.json`.

- Run all tests:

```bash
composer phpunit
```
This command will execute all tests in the project and display results in the terminal.

- Run a specific test file:
```bash
composer phpunit-file path/to/your/testfile.php
```
This command allows you to focus on a single test file, which is useful for development and debugging.

### Code Coverage Reports
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.

### How to mock Wordpress

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.

For more information, refer to the [WP_Mock documentation](https://wp-mock.gitbook.io/documentation).

## Support and Issues


Expand Down
2 changes: 1 addition & 1 deletion assets/css/checkouts/mp-plugins-components.min.css

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions assets/js/blocks/components/InputDocument.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
const InputDocument = ({
labelMessage,
helperMessage,
helperInvalid,
helperEmpty,
helperWrong,
inputName,
hiddenId,
inputDataCheckout,
Expand All @@ -14,7 +16,9 @@ const InputDocument = ({
<div className="mp-checkout-ticket-input-document">
<input-document
label-message={labelMessage}
helper-message={helperMessage}
helper-invalid={helperInvalid}
helper-empty={helperEmpty}
helper-wrong={helperWrong}
input-name={inputName}
hidden-id={hiddenId}
input-data-checkout={inputDataCheckout}
Expand Down
41 changes: 8 additions & 33 deletions assets/js/blocks/components/RowImageSelect.js
Original file line number Diff line number Diff line change
@@ -1,35 +1,10 @@
const RowImageSelect = ({text, imgSrc}) => {
return (
<div style={
{
height: "18px",
display: "flex",
justifyContent: "space-between",
alignContent: "center",
alignItems: "center",
flexDirection: "row"
}
}>
<img
style={
{
marginRight: "8px",
height: "25px",
width: "30px",
padding: 0
}
}
src={imgSrc}
/>
<p style={
{
fontFamily: '"Proxima Nova", -apple-system, "Helvetica Neue", Helvetica, "Roboto", Arial, sans-serif',
fontSize: "18px",
padding: 0
}
}>{text}</p>
</div>
);
const RowImageSelect = ({ text, imgSrc, id }) => {
return (
<div id={id} className="row-image-select">
<img src={imgSrc} />
<p>{text}</p>
</div>
);
}

export default RowImageSelect;
export default RowImageSelect;
2 changes: 1 addition & 1 deletion assets/js/blocks/components/TestMode.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
const TestMode = ({ title, description, linkText, linkSrc }) => (
<div className="mp-checkout-pro-test-mode">
<div className="mp-test-mode-container">
<test-mode title={title} description={description} link-text={linkText} link-src={linkSrc} />
</div>
);
Expand Down
10 changes: 7 additions & 3 deletions assets/js/blocks/custom.block.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,9 @@ const Content = (props) => {
card_security_code_input_label,
card_security_code_input_helper,
card_document_input_label,
card_document_input_helper,
card_input_document_helper_invalid,
card_input_document_helper_empty,
card_input_document_helper_wrong,
card_installments_title,
card_issuer_input_label,
card_installments_input_helper,
Expand Down Expand Up @@ -249,7 +251,7 @@ const Content = (props) => {
<div className={'mp-checkout-container'}>
<div className={'mp-checkout-custom-container'}>
{test_mode ? (
<div className={'mp-checkout-pro-test-mode'}>
<div className={'mp-test-mode-container'}>
<TestMode
title={test_mode_title}
description={test_mode_description}
Expand Down Expand Up @@ -369,7 +371,9 @@ const Content = (props) => {
<div id={'mp-doc-div'} className={'mp-checkout-custom-input-document'} style={{ display: 'none' }}>
<InputDocument
labelMessage={card_document_input_label}
helperMessage={card_document_input_helper}
helperInvalid={card_input_document_helper_invalid}
helperEmpty={card_input_document_helper_empty}
helperWrong={card_input_document_helper_wrong}
inputName={'identificationNumber'}
hiddenId={'form-checkout__identificationNumber'}
inputDataCheckout={'docNumber'}
Expand Down
8 changes: 6 additions & 2 deletions assets/js/blocks/pse.block.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,9 @@ const Content = (props) => {
test_mode_link_text,
test_mode_link_src,
input_document_label,
input_document_helper,
input_document_helper_empty,
input_document_helper_invalid,
input_document_helper_wrong,
pse_text_label,
person_type_label,
amount,
Expand Down Expand Up @@ -110,7 +112,9 @@ const Content = (props) => {

let inputDocumentConfig = {
labelMessage: input_document_label,
helperMessage: input_document_helper,
helperInvalid: input_document_helper_invalid,
helperEmpty: input_document_helper_empty,
helperWrong: input_document_helper_wrong,
validate: 'true',
selectId: 'doc_type',
flagError: 'mercadopago_pse[docNumberError]',
Expand Down
Loading

0 comments on commit 438b30b

Please sign in to comment.