Skip to content
This repository has been archived by the owner on Aug 28, 2023. It is now read-only.

Commit

Permalink
Merge pull request #193 from PluginAndPartners/main
Browse files Browse the repository at this point in the history
Release v3.16.0 from branch Main P&P to Main MP
  • Loading branch information
katelucena-meli authored May 9, 2022
2 parents 0b5d4e0 + a8d88e0 commit a099a7d
Show file tree
Hide file tree
Showing 26 changed files with 272 additions and 155 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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).

## [3.16.0] - 2022-05-05

### Added
- Added Mercado pago payment infos into Magento's default success template

## [3.15.0] - 2022-03-21

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
</a>
</p>

# Magento 2 - Mercado Pago Module (v3.15.0)
# Magento 2 - Mercado Pago Module (v3.16.0)

The Mercado Pago plugin for Magento 2 allows you to expand the functionalities of your online store and offer a unique payment experience for your customers.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"type": "magento2-module",
"version": "3.15.0",
"version": "3.16.0",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
11 changes: 11 additions & 0 deletions src/MercadoPago/Core/Block/AbstractSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -226,4 +226,15 @@ public function getCheckoutUrl()
{
return $this->_assetRepo->getUrl('MercadoPago_Core::images/desktop-logo-mercadopago.png');
} //end getLogoMP()

public function checkExistCallback()
{
$callback = $this->getRequest()->getParam('callback');

if (is_null($callback)) {
return false;
} else {
return true;
}
}
} //end class
11 changes: 1 addition & 10 deletions src/MercadoPago/Core/Block/CustomBankTransfer/Success.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ protected function _construct()
{
parent::_construct();
$this->setTemplate('custom_bank_transfer/success.phtml');
$this->checkExistCallback();
}

public function getRedirectUserStatus()
Expand All @@ -25,14 +26,4 @@ public function getRedirectUserStatus()
return $redirectUser;
}

public function checkExistCallback()
{
$callback = $this->getRequest()->getParam('callback');

if (is_null($callback)) {
return false;
} else {
return true;
}
}
}
35 changes: 35 additions & 0 deletions src/MercadoPago/Core/Block/Success.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

namespace MercadoPago\Core\Block;

class Success extends AbstractSuccess
{
/**
* Constructor
*/
protected function _construct()
{
parent::_construct();

if ($this->getPaymentMethod() == 'mercadopago_basic') {
return $this->setTemplate('basic/success.phtml');
}

if ($this->getPaymentMethod() == 'mercadopago_custom_pix') {
return $this->setTemplate('custom_pix/success.phtml');
}

if ($this->getPaymentMethod() == 'mercadopago_customticket') {
return $this->setTemplate('custom_ticket/success.phtml');
}

if ($this->getPaymentMethod() == 'mercadopago_custom') {
return $this->setTemplate('custom/success.phtml');
}

if ($this->getPaymentMethod() == 'mercadopago_custom_bank_transfer') {
$this->setTemplate('custom_bank_transfer/success.phtml');
}

}
}
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "mercadopago/core",
"description": "Mercado Pago Magento 2 Plugin",
"type": "magento2-module",
"version": "3.15.0",
"version": "3.16.0",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
4 changes: 2 additions & 2 deletions src/MercadoPago/Core/etc/adminhtml/system/advanced.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
<label>Use Mercado Pago Success Page</label>
<source_model>Magento\Config\Model\Config\Source\Yesno</source_model>
<config_path>payment/mercadopago/use_successpage_mp</config_path>
<comment>The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.</comment>
<comment>The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.</comment>
</field>

<field id="consider_discount" translate="label comment" type="select" sortOrder="40" showInDefault="1" showInStore="0" showInWebsite="1">
Expand All @@ -39,7 +39,7 @@
<config_path>payment/mercadopago/integrator_id</config_path>
<comment><![CDATA[With this number, we identify all your transactions and know how many sales we process with your account. Become a certified Mercado Pago partner and request your integrator_id <a href="https://docs.google.com/forms/d/1EeO__nZuqHf4cb81NpwtDSybPT7COluSZVrXR4A8F7Q/viewform?edit_requested=true" target="_blank">here</a>.]]></comment>
</field>

<field id="heading_email" translate="label" sortOrder="50" showInDefault="1" showInWebsite="1">
<label>Email Options</label>
<frontend_model>Magento\Config\Block\System\Config\Form\Field\Heading</frontend_model>
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/etc/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
<order_status_partially_refunded>pending</order_status_partially_refunded>
<refund_available>0</refund_available>
<cancel_payment>0</cancel_payment>
<use_successpage_mp>1</use_successpage_mp>
<use_successpage_mp>0</use_successpage_mp>
<financing_cost>0</financing_cost>
<consider_discount>0</consider_discount>
<integrator_id></integrator_id>
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/etc/module.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="MercadoPago_Core" setup_version="3.15.0">
<module name="MercadoPago_Core" setup_version="3.16.0">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_AR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_CL.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_CO.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_MX.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_PE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/es_UY.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configuración de tienda"
"Category of your store","Categoría de tu tienda"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline. Si utilizas la página de Magento, deberás personalizar para mostrar el botón de pago de los medios de pago offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","La página de sucesso de pago de Mercado Pago está preparada para mostrar mensajes para cada estado de pago, esta página también esta preparada para mostrar el botón de pago para medios offline."
"Show Discount Coupon","Mostrar valor del cupón de descuento"
"Enabling this option will show the discount coupon amount in the order details","Si habilitas esta opción se mostrará el monto del cupón de descuento en el detalle de la orden"
"Integrator ID","Integrator ID"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/Core/i18n/pt_BR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"Store Settings","Configurações da Loja"
"Category of your store","Categoria da sua Loja"
"Use Mercado Pago Success Page","Utilizar página de resultado de pago de Mercado Pago"
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket. If you use the default page of Magento, you will have to customize it to show the button for payment of the Ticket.","A página de sucesso de pagamento do Mercado Pago está preparada para mostrar mensagens para cada status de pagamento. Essa página também está preparada para mostrar o botão de pagamento para métodos de pagamento offline. Se você usar a página do Magento, você terá que personalizar a página para mostrar o botão de pagamento dos meios de pagamento offline."
"The successful page of the Mercado Pago module is prepared to show messages for each Payment status, this page is also prepared to show the payment button with ticket.","A página de sucesso de pagamento do Mercado Pago está preparada para mostrar mensagens para cada status de pagamento. Essa página também está preparada para mostrar o botão de pagamento para métodos de pagamento offline."
"Show Discount Coupon","Mostrar valor do cupom de desconto"
"Enabling this option will show the discount coupon amount in the order details","Se você habilitar essa opção, o valor do cupom de desconto será mostrado no total do pedido."
"Integrator ID","Integrator ID"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column"
xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<head>
<css src="MercadoPago_Core::css/style-success.css"/>
</head>
<body>
<referenceContainer name="order.success.additional.info">
<block class="MercadoPago\Core\Block\Success" name="mercadopago_custom_success" cacheable="false" />
</referenceContainer>
</body>
</page>
Loading

0 comments on commit a099a7d

Please sign in to comment.