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

Commit

Permalink
refactor magento2
Browse files Browse the repository at this point in the history
  • Loading branch information
gmatsuoka committed Nov 9, 2018
1 parent 8e8adc5 commit d90dd38
Show file tree
Hide file tree
Showing 119 changed files with 5,006 additions and 12,455 deletions.
8 changes: 3 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
}
],
"type": "magento2-component",
"version": "2.2.1",
"version": "3.0.0",
"license": [
"OSL-3.0",
"AFL-3.0"
Expand All @@ -34,12 +34,10 @@
},
"autoload": {
"psr-4": {
"MercadoPago\\Core\\": "src/MercadoPago/Core",
"MercadoPago\\MercadoEnvios\\": "src/MercadoPago/MercadoEnvios"
"MercadoPago\\Core\\": "src/MercadoPago/Core"
},
"files": [
"src/MercadoPago/Core/registration.php",
"src/MercadoPago/MercadoEnvios/registration.php"
"src/MercadoPago/Core/registration.php"
]
}
}
16 changes: 9 additions & 7 deletions src/MercadoPago/Core/Block/AbstractSuccess.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,17 +122,19 @@ public function getInfoPayment()
/**
* Return a message to show in success page
*
* @param string $status
* @param string $status_detail
* @param string $payment_method
* @param float $amount
* @param integer $installment
* @param object $payment
*
* @return string
*/
public function getMessageByStatus($status, $status_detail, $payment_method, $amount, $installment)
public function getMessageByStatus($payment)
{
return $this->_coreFactory->create()->getMessageByStatus($status, $status_detail, $payment_method, $amount, $installment);
$status = $payment['status'] != "" ? $payment['status'] : '';
$status_detail = $payment['status_detail'] != "" ? $payment['status_detail'] : '';
$payment_method = $payment['payment_method_id'] != "" ? $payment['payment_method_id'] : '';
$amount = $payment['transaction_amount'] != "" ? $payment['transaction_amount'] : '';
$installments = $payment['installments'] != "" ? $payment['installments'] : '';

return $this->_coreFactory->create()->getMessageByStatus($status, $status_detail, $payment_method, $installments, $amount);
}

/**
Expand Down
57 changes: 57 additions & 0 deletions src/MercadoPago/Core/Block/Adminhtml/System/Config/Version.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
<?php
namespace MercadoPago\Core\Block\Adminhtml\System\Config;
/**
* Config backend model for version display.
*/
class Version extends \Magento\Framework\App\Config\Value
{
/**
* @var \Magento\Framework\Module\ResourceInterface
*/
protected $moduleResource;

/**
* @param \Magento\Framework\Model\Context $context
* @param \Magento\Framework\Registry $registry
* @param \Magento\Framework\App\Config\ScopeConfigInterface $config
* @param \Magento\Framework\App\Cache\TypeListInterface $cacheTypeList
* @param \Magento\Framework\Module\ResourceInterface $moduleResource
* @param \Magento\Framework\Model\ResourceModel\AbstractResource $resource
* @param \Magento\Framework\Data\Collection\AbstractDb $resourceCollection
* @param array $data
*/
public function __construct(
\Magento\Framework\Model\Context $context,
\Magento\Framework\Registry $registry,
\Magento\Framework\App\Config\ScopeConfigInterface $config,
\Magento\Framework\App\Cache\TypeListInterface $cacheTypeList,
\Magento\Framework\Module\ResourceInterface $moduleResource,
\Magento\Framework\Model\ResourceModel\AbstractResource $resource = null,
\Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
array $data = []
) {
$this->moduleResource = $moduleResource;

parent::__construct(
$context,
$registry,
$config,
$cacheTypeList,
$resource,
$resourceCollection,
$data
);
}

/**
* Inject current installed module version as the config value.
*
* @return void
*/
public function afterLoad()
{
$version = $this->moduleResource->getDbVersion('MercadoPago_Core');

$this->setValue($version);
}
}
80 changes: 0 additions & 80 deletions src/MercadoPago/Core/Block/Calculator/CalculatorForm.php

This file was deleted.

137 changes: 0 additions & 137 deletions src/MercadoPago/Core/Block/Calculator/CalculatorLink.php

This file was deleted.

Loading

0 comments on commit d90dd38

Please sign in to comment.