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 #100 from mercadopago/back_url
Browse files Browse the repository at this point in the history
Removed checkout validation when creating back_url
  • Loading branch information
falehenrique authored Sep 26, 2018
2 parents 5a4db4d + 35a22ee commit 8e8adc5
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 14 deletions.
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-component",
"version": "2.2.0",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
14 changes: 5 additions & 9 deletions src/MercadoPago/Core/Model/Standard/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -314,15 +314,11 @@ public function makePreference()

$url = $this->_helperData->getSuccessUrl();
$arr['back_urls']['success'] = $this->_urlBuilder->getUrl($url);

$typeCheckout = $this->_scopeConfig->getValue('payment/mercadopago_standard/type_checkout', \Magento\Store\Model\ScopeInterface::SCOPE_STORE);
if ($typeCheckout == 'redirect') {
$arr['back_urls']['pending'] = $this->_urlBuilder->getUrl($url);
if (!$this->_scopeConfig->getValue(\MercadoPago\Core\Helper\Data::XML_PATH_USE_SUCCESSPAGE_MP, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)){
$arr['back_urls']['failure'] = $this->_urlBuilder->getUrl('checkout/onepage/failure');
}else{
$arr['back_urls']['failure'] = $this->_urlBuilder->getUrl('mercadopago/standard/failure');
}
$arr['back_urls']['pending'] = $this->_urlBuilder->getUrl($url);
if (!$this->_scopeConfig->getValue(\MercadoPago\Core\Helper\Data::XML_PATH_USE_SUCCESSPAGE_MP, \Magento\Store\Model\ScopeInterface::SCOPE_STORE)){
$arr['back_urls']['failure'] = $this->_urlBuilder->getUrl('checkout/onepage/failure');
}else{
$arr['back_urls']['failure'] = $this->_urlBuilder->getUrl('mercadopago/standard/failure');
}

$arr['notification_url'] = $this->_urlBuilder->getUrl("mercadopago/notifications/standard");
Expand Down
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/module-core",
"description": "Mercado Pago payment method module",
"type": "magento2-module",
"version": "2.2.0",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
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="2.2.0">
<module name="MercadoPago_Core" setup_version="2.2.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/MercadoEnvios/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"php": "~5.5.0|~5.6.0|~7.0.0"
},
"type": "magento2-module",
"version": "2.2.0",
"version": "2.2.1",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand Down
2 changes: 1 addition & 1 deletion src/MercadoPago/MercadoEnvios/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_MercadoEnvios" setup_version="2.2.0">
<module name="MercadoPago_MercadoEnvios" setup_version="2.2.1">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Payment"/>
Expand Down

0 comments on commit 8e8adc5

Please sign in to comment.