This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit c9eee1a
Showing
153 changed files
with
72,984 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
indent_style = space | ||
indent_size = 4 | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.yml] | ||
indent_style = space | ||
indent_size = 2 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/docs export-ignore | ||
/docker-magento2 export-ignore | ||
/package.sh export-ignore | ||
/.travis.yml export-ignore | ||
/.gitattributes export-ignore | ||
/.gitignore export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.DS_Store | ||
/.idea | ||
.idea | ||
docker-magento2/src/** | ||
plugin-transbank-onepay-**.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
<?php | ||
|
||
namespace Transbank\Webpay\Block\System\Config; | ||
|
||
use Magento\Backend\Block\Template\Context; | ||
use Magento\Config\Block\System\Config\Form\Field; | ||
use Magento\Framework\Data\Form\Element\AbstractElement; | ||
use Transbank\Webpay\Model\Libwebpay\HealthCheck; | ||
use Transbank\Webpay\Model\Libwebpay\LogHandler; | ||
use Magento\App\Framework\Route\Config; | ||
|
||
|
||
class TbkButton extends Field | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $_template = 'Transbank_Webpay::system/config/button.phtml'; | ||
|
||
/** | ||
* @param Context $context | ||
* @param array $data | ||
*/ | ||
public function __construct(Context $context, array $data = [] ) { | ||
parent::__construct($context, $data); | ||
$this->ecommerce = 'magento'; | ||
$this->context = $context; | ||
|
||
$this->args = array( | ||
"ECOMMERCE" => $this->ecommerce, | ||
"MODO" => $this->_scopeConfig->getValue('payment/webpay/security_parameters/environment'), | ||
"PRIVATE_KEY" => $this->_scopeConfig->getValue('payment/webpay/security_parameters/private_key'), | ||
"PUBLIC_CERT" => $this->_scopeConfig->getValue('payment/webpay/security_parameters/public_cert'), | ||
"WEBPAY_CERT" => $this->_scopeConfig->getValue('payment/webpay/security_parameters/webpay_cert'), | ||
"COMMERCE_CODE" => $this->_scopeConfig->getValue('payment/webpay/security_parameters/commerce_code') | ||
); | ||
$this->logH = new loghandler($this->args['ECOMMERCE']); | ||
$this->healthcheck = new HealthCheck($this->args); | ||
$datos_hc = json_decode($this->healthcheck->printFullResume()); | ||
$this->tbk_data = array( | ||
'cert_vs_private' =>$datos_hc->validate_certificates->consistency->cert_vs_private_key, | ||
'commerce_code_validate' => $datos_hc->validate_certificates->consistency->commerce_code_validate, | ||
'subject_commerce_code' => $datos_hc->validate_certificates->cert_info->subject_commerce_code, | ||
'cert_version' => $datos_hc->validate_certificates->cert_info->version, | ||
'cert_is_valid' => $datos_hc->validate_certificates->cert_info->is_valid, | ||
'valid_from' => $datos_hc->validate_certificates->cert_info->valid_from, | ||
'valid_to' => $datos_hc->validate_certificates->cert_info->valid_to, | ||
'init_status' => null, //$datos_hc->validate_init_transaction->status->string, | ||
'init_error_error' => null, // (isset($datos_hc->validate_init_transaction->response->error)) ? $datos_hc->validate_init_transaction->response->error : NULL, | ||
'init_error_detail' => null, // (isset($datos_hc->validate_init_transaction->response->detail)) ? $datos_hc->validate_init_transaction->response->detail : NULL, | ||
'init_success_url' => null, // (isset($datos_hc->validate_init_transaction->response->url)) ? $datos_hc->validate_init_transaction->response->url : NULL, | ||
'init_success_token' => null, // (isset($datos_hc->validate_init_transaction->response->token_ws)) ? $datos_hc->validate_init_transaction->response->token_ws : NULL, | ||
'php_status' =>$datos_hc->server_resume->php_version->status, | ||
'php_version' =>$datos_hc->server_resume->php_version->version, | ||
'server_version' =>$datos_hc->server_resume->server_version->server_software, | ||
'ecommerce' =>$datos_hc->server_resume->plugin_info->ecommerce, | ||
'ecommerce_version' =>$datos_hc->server_resume->plugin_info->ecommerce_version, | ||
'current_plugin_version' =>$datos_hc->server_resume->plugin_info->current_plugin_version, | ||
'last_plugin_version' =>$datos_hc->server_resume->plugin_info->last_plugin_version, | ||
'openssl_status' =>$datos_hc->php_extensions_status->openssl->status, | ||
'openssl_version' =>$datos_hc->php_extensions_status->openssl->version, | ||
'SimpleXML_status' =>$datos_hc->php_extensions_status->SimpleXML->status, | ||
'SimpleXML_version' =>$datos_hc->php_extensions_status->SimpleXML->version, | ||
'soap_status' =>$datos_hc->php_extensions_status->soap->status, | ||
'soap_version' =>$datos_hc->php_extensions_status->soap->version, | ||
'mcrypt_status' =>$datos_hc->php_extensions_status->mcrypt->status, | ||
'mcrypt_version' =>$datos_hc->php_extensions_status->mcrypt->version, | ||
'dom_status' =>$datos_hc->php_extensions_status->dom->status, | ||
'dom_version' =>$datos_hc->php_extensions_status->dom->version, | ||
'php_info' =>$datos_hc->php_info->string->content, | ||
'lockfile' => json_decode($this->logH->getLockFile(),true)['status'], | ||
'logs' => (isset( json_decode($this->logH->getLastLog(),true)['log_content'])) ? json_decode($this->logH->getLastLog(),true)['log_content'] : NULL, | ||
'log_file' => (isset( json_decode($this->logH->getLastLog(),true)['log_file'])) ? json_decode($this->logH->getLastLog(),true)['log_file'] : NULL, | ||
'log_weight' => (isset( json_decode($this->logH->getLastLog(),true)['log_weight'])) ? json_decode($this->logH->getLastLog(),true)['log_weight'] : NULL, | ||
'log_regs_lines' => (isset( json_decode($this->logH->getLastLog(),true)['log_regs_lines'])) ? json_decode($this->logH->getLastLog(),true)['log_regs_lines'] : NULL, | ||
'log_days' => $this->logH->getValidateLockFile()['max_logs_days'], | ||
'log_size' => $this->logH->getValidateLockFile()['max_log_weight'], | ||
'log_dir' => json_decode($this->logH->getResume(),true)['log_dir'], | ||
'logs_count' => json_decode($this->logH->getResume(),true)['logs_count']['log_count'], | ||
'logs_list' => (isset(json_decode($this->logH->getResume(),true)['logs_list'])) ?json_decode($this->logH->getResume(),true)['logs_list'] : array('no hay archivos de registro') , | ||
); | ||
} | ||
|
||
|
||
/** | ||
* Return element html | ||
* | ||
* @param AbstractElement $element | ||
* @return string | ||
*/ | ||
protected function _getElementHtml(AbstractElement $element) | ||
{ | ||
return $this->_toHtml(); | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Changelog | ||
Todos los cambios notables a este proyecto serán documentados en este archivo. | ||
|
||
El formato está basado en [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
y este proyecto adhiere a [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [3.1.1] - 2018-08-24 | ||
### Changed | ||
- Se modifica código de comercio y certificados. | ||
|
||
## [3.1.0] - 2018-07-11 | ||
### Added | ||
- Se agregan validaciones de depencias en instalacion a través de composer | ||
### Modificado | ||
- Se modifica herramienta de diagnostico, metodo es desde ahora ondemand. | ||
- Se realizan correcciones a obtencion de orden de compra. | ||
- Se realizan correcciones a flujo de compra considerando anulacion por parte del cliente. | ||
|
||
## [3.0.4] - 2018-05-28 | ||
### Changed | ||
- Se modifica certificado de servidor para ambiente de integracion. | ||
|
||
## [3.0.3] - 2018-05-18 | ||
### Modificado | ||
- Se corrige SOAP para registrar versiones. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php | ||
namespace Transbank\Webpay\Controller\Adminhtml\CallLogHandler; | ||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Transbank\Webpay\Model\Libwebpay\LogHandler; | ||
class Index extends Action | ||
{ | ||
/** | ||
* @var \Magento\Framework\View\Result\PageFactory | ||
*/ | ||
protected $resultPageFactory; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param \Magento\Backend\App\Action\Context $context | ||
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
\Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
) { | ||
parent::__construct($context); | ||
// $this->resultPageFactory = $resultPageFactory; | ||
} | ||
|
||
/** | ||
* Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml | ||
* | ||
* @return \Magento\Framework\View\Result\Page | ||
*/ | ||
public function execute() | ||
{ | ||
if (!isset($_COOKIE["action_check"])) { | ||
die; | ||
} | ||
$log = new loghandler('magento'); | ||
|
||
if ($_COOKIE["action_check"] == 'true') { | ||
$log->setLockStatus(true); | ||
$log->setnewconfig($_COOKIE['days'] , $_COOKIE['size']); | ||
} | ||
else | ||
$log->setLockStatus(false); | ||
|
||
echo "<script>window.close();</script>"; | ||
} | ||
} | ||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
namespace Transbank\Webpay\Controller\Adminhtml\CreatePdf; | ||
|
||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Transbank\Webpay\Model\Libwebpay\HealthCheck; | ||
use Transbank\Webpay\Model\Libwebpay\tcpdf\reportPDFlog; | ||
|
||
class Index extends Action | ||
{ | ||
/** | ||
* @var \Magento\Framework\View\Result\PageFactory | ||
*/ | ||
protected $resultPageFactory; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param \Magento\Backend\App\Action\Context $context | ||
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
\Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
) { | ||
parent::__construct($context); | ||
// $this->resultPageFactory = $resultPageFactory; | ||
} | ||
|
||
/** | ||
* Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml | ||
* | ||
* @return \Magento\Framework\View\Result\Page | ||
*/ | ||
public function execute() | ||
{ | ||
if (!isset($_COOKIE["ambient"])) { | ||
die; | ||
} | ||
// var_dump($_COOKIE); | ||
$ecommerce = 'magento'; | ||
$arg = array('MODO' => $_COOKIE["ambient"], | ||
'COMMERCE_CODE' => $_COOKIE["storeID"], | ||
'PUBLIC_CERT' => $_COOKIE["certificate"], | ||
'PRIVATE_KEY' => $_COOKIE["secretCode"], | ||
'WEBPAY_CERT' => $_COOKIE["certificateTransbank"], | ||
'ECOMMERCE' => $ecommerce); | ||
$document = $_COOKIE["document"]; | ||
|
||
setcookie("ambient", "", time()-3600, '/'); | ||
setcookie("storeID", "", time()-3600, '/'); | ||
setcookie("certificate", "", time()-3600, '/'); | ||
setcookie("secretCode", "", time()-3600, '/'); | ||
setcookie("certificateTransbank", "", time()-3600, '/'); | ||
setcookie("document", "", time()-3600, '/'); | ||
|
||
|
||
unset($_COOKIE['ambient']); | ||
unset($_COOKIE['storeID']); | ||
unset($_COOKIE['certificate']); | ||
unset($_COOKIE['secretCode']); | ||
unset($_COOKIE['certificateTransbank']); | ||
unset($_COOKIE['document']); | ||
|
||
$healthcheck = new HealthCheck($arg); | ||
$json =$healthcheck->printFullResume(); | ||
$rl = new reportPDFlog($ecommerce, $document); | ||
$temp = json_decode($json); | ||
if ($document == "report") { | ||
unset($temp->php_info); | ||
} else { | ||
$temp = array('php_info' => $temp->php_info); | ||
} | ||
$json = json_encode($temp); | ||
$rl->getReport($json); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
<?php | ||
namespace Transbank\Webpay\Controller\Adminhtml\Request; | ||
|
||
use Magento\Backend\App\Action; | ||
use Magento\Backend\App\Action\Context; | ||
use Transbank\Webpay\Model\Libwebpay\HealthCheck; | ||
|
||
class Index extends Action | ||
{ | ||
/** | ||
* @var \Magento\Framework\View\Result\PageFactory | ||
*/ | ||
protected $resultPageFactory; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param \Magento\Backend\App\Action\Context $context | ||
* @param \Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
*/ | ||
public function __construct( | ||
Context $context, | ||
\Magento\Framework\View\Result\PageFactory $resultPageFactory | ||
) { | ||
parent::__construct($context); | ||
// $this->resultPageFactory = $resultPageFactory; | ||
} | ||
|
||
/** | ||
* Load the page defined in view/adminhtml/layout/exampleadminnewpage_helloworld_index.xml | ||
* | ||
* @return \Magento\Framework\View\Result\Page | ||
*/ | ||
public function execute() | ||
{ | ||
if (!isset($_COOKIE["ambient"])) { | ||
die; | ||
} | ||
|
||
$type = $_POST['type']; | ||
|
||
switch($type) | ||
{ | ||
case 'checkInit': | ||
|
||
$response = []; | ||
|
||
$arg = []; | ||
|
||
$arg = [ | ||
'MODO' => $_POST['MODE'], | ||
'COMMERCE_CODE' => $_POST['C_CODE'], | ||
'PUBLIC_CERT' => $_POST['PUBLIC_CERT'], | ||
'PRIVATE_KEY' => $_POST['PRIVATE_KEY'], | ||
'WEBPAY_CERT' => $_POST['WEBPAY_CERT'], | ||
'ECOMMERCE' => 'magento' | ||
]; | ||
|
||
$healthcheck = new HealthCheck($arg); | ||
|
||
try | ||
{ | ||
|
||
$response = $healthcheck->getInitTransaction(); | ||
|
||
echo json_encode(['success' => true, 'msg' => json_decode($response)]); | ||
} | ||
catch (Exception $e) | ||
{ | ||
echo json_encode(['success' => false, 'msg' => $e->getMessage()]); | ||
} | ||
|
||
break; | ||
} | ||
|
||
} | ||
} |
Oops, something went wrong.