Skip to content

Commit

Permalink
Release v6.4.0 (#322)
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanniCavallari authored Dec 7, 2022
1 parent eeb33d8 commit 51ff44f
Show file tree
Hide file tree
Showing 128 changed files with 6,648 additions and 2,607 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ node_modules
.vscode
.idea
.idea/
vendor/
/vendor/
woocommerce-mercadopago.zip
15 changes: 15 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@ 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).

## [6.4.0] - 2022-12-07

### Added
- Added Mercado Pago PHP SDK
- Added min width for checkout select inputs
- Added nonce validation to avoid CSRF Vulnerabilities

### Changed
- Changed notification flow to use PHP SDK
- Changed payments and preferences flow to use PHP SDK

### Fixed
- Fixed plugin translations
- Fixed plugin configuration page links

## [6.3.1] - 2022-10-13

### Changed
Expand Down
6 changes: 0 additions & 6 deletions assets/css/components_mercadopago.css
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,11 @@
display: flex;
margin: 32px 0px 32px 0px;
}

.mp-alert-color-sucess {
width: 6px;
background: #009ee3;
border-radius: 6px 0 0 6px;
}

.mp-alert-color-alert {
width: 6px;
background: #ff7733;
Expand Down Expand Up @@ -202,7 +200,6 @@
height: 20px;
padding-left: 10px;
}

.mp-text-title {
font-family: "Proxima Nova", -apple-system, "Helvetica Neue", Helvetica,
"Roboto", Arial, sans-serif;
Expand All @@ -214,7 +211,6 @@
margin: 4px 0px;
font-weight: bold;
}

.mp-text-subtitle {
font-family: "Proxima Nova", -apple-system, "Helvetica Neue", Helvetica,
"Roboto", Arial, sans-serif;
Expand Down Expand Up @@ -251,14 +247,12 @@
-webkit-transition: background-color 0.2s ease-in;
transition: background-color 0.2s ease-in;
}

.mp-button-payments:focus {
outline: 0;
box-shadow: 0 0 0 0.1875em rgb(27 135 201 / 30%);
-webkit-transition: box-shadow 0.25s ease-in;
transition: box-shadow 0.25s ease-in;
}

.mp-button-payments:active {
border-color: transparent;
background-color: #005e88;
Expand Down
5 changes: 3 additions & 2 deletions assets/css/mp-plugins-components.css
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,8 @@ div div .mp-checkout-ticket-content .mp-checkout-ticket-text {
margin: 0 8px !important;
min-height: 20px !important;
outline: none !important;
padding: 0 !important
padding: 0 !important;
min-width: 10px !important
}

.mp-input-document .mp-input .mp-vertical-line {
Expand Down Expand Up @@ -1279,4 +1280,4 @@ div div .mp-checkout-ticket-content .mp-checkout-ticket-text {
.mp-test-mode-link:hover {
color: #7249a5 !important;
transition: all .3ms !important
}
}
2 changes: 1 addition & 1 deletion assets/css/mp-plugins-components.min.css

Large diffs are not rendered by default.

83 changes: 62 additions & 21 deletions assets/js/mercadopago-settings/mercadopago_settings.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/* globals jQuery, ajaxurl, mercadopago_settings_javascript_vars */

function mp_settings_accordion_start() {
var i;
var acc = document.getElementsByClassName("mp-settings-title-align");
Expand Down Expand Up @@ -31,22 +33,28 @@ function mp_settings_accordion_start() {
}

function mp_get_requirements() {
jQuery.post(ajaxurl, { action: "mp_get_requirements" }, function (response) {
const requirements = {
ssl: document.getElementById("mp-req-ssl"),
gd_ext: document.getElementById("mp-req-gd"),
curl_ext: document.getElementById("mp-req-curl"),
};

for (let i in requirements) {
let requirement = requirements[i];
requirement.style = "";
if (!response.data[i]) {
requirement.classList.remove("mp-settings-icon-success");
requirement.classList.add("mp-settings-icon-warning");
jQuery.post(
ajaxurl,
{
action: "mp_get_requirements",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (response) {
const requirements = {
ssl: document.getElementById("mp-req-ssl"),
gd_ext: document.getElementById("mp-req-gd"),
curl_ext: document.getElementById("mp-req-curl"),
};

for (let i in requirements) {
let requirement = requirements[i];
requirement.style = "";
if (!response.data[i]) {
requirement.classList.remove("mp-settings-icon-success");
requirement.classList.add("mp-settings-icon-warning");
}
}
}
});
});
}

function mp_verify_alert_test_mode() {
Expand Down Expand Up @@ -74,6 +82,7 @@ function mp_validate_credentials() {
access_token: this.value,
is_test: false,
action: "mp_validate_credentials",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -106,6 +115,7 @@ function mp_validate_credentials() {
access_token: this.value,
is_test: true,
action: "mp_validate_credentials",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -140,6 +150,7 @@ function mp_validate_credentials() {
public_key: this.value,
is_test: true,
action: "mp_validate_credentials",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -170,6 +181,7 @@ function mp_validate_credentials() {
public_key: this.value,
is_test: false,
action: "mp_validate_credentials",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -207,6 +219,7 @@ function mp_update_option_credentials() {
public_key_prod: document.getElementById("mp-public-key-prod").value,
public_key_test: document.getElementById("mp-public-key-test").value,
action: "mp_update_option_credentials",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -263,6 +276,7 @@ function mp_update_store_information() {
store_integrator_id: document.getElementById("mp-store-integrator-id").value,
store_debug_mode: document.querySelector("#mp-store-debug-mode:checked")?.value,
action: "mp_update_store_information",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
Expand Down Expand Up @@ -398,9 +412,12 @@ button.addEventListener("click", function () {
jQuery
.post(
ajaxurl,
{ input_mode_value: mode_value,
{
input_mode_value: mode_value,
input_verify_alert_test_mode: alert_validate,
action: "mp_store_mode" },
action: "mp_store_mode",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
.done(function (response) {
Expand All @@ -422,7 +439,14 @@ button.addEventListener("click", function () {

function mp_get_payment_properties() {
jQuery
.post(ajaxurl, { action: "mp_get_payment_properties" }, function (data) {})
.post(
ajaxurl,
{
action: "mp_get_payment_properties",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
.done(function (response) {
const payment = document.getElementById("mp-payment");

Expand Down Expand Up @@ -483,7 +507,10 @@ function mp_validate_credentials_tips() {
jQuery
.post(
ajaxurl,
{ action: "mp_validate_credentials_tips" },
{
action: "mp_validate_credentials_tips",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
.done(function (response) {
Expand All @@ -502,7 +529,14 @@ function mp_validate_credentials_tips() {
function mp_validate_store_tips() {
var icon_store = document.getElementById("mp-settings-icon-store");
jQuery
.post(ajaxurl, { action: "mp_validate_store_tips" }, function (data) {})
.post(
ajaxurl,
{
action: "mp_validate_store_tips",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
.done(function (response) {
if (response.success) {
icon_store.classList.remove("mp-settings-icon-store");
Expand All @@ -519,7 +553,14 @@ function mp_validate_store_tips() {
function mp_validate_payment_tips() {
var icon_payment = document.getElementById("mp-settings-icon-payment");
jQuery
.post(ajaxurl, { action: "mp_validate_payment_tips" }, function (data) {})
.post(
ajaxurl,
{
action: "mp_validate_payment_tips",
nonce: mercadopago_settings_javascript_vars.nonce,
},
function (data) {}
)
.done(function (response) {
if (response.success) {
icon_payment.classList.remove("mp-settings-icon-payment");
Expand Down
Loading

0 comments on commit 51ff44f

Please sign in to comment.