diff --git a/CHANGELOG.md b/CHANGELOG.md index 4e25892..d8d3b26 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,12 @@ 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). +# [2.2.1] - 2024-04-22 +## Fixed +- Se corrige el valor de path_config para que sea aceptado desde las versiones 2.4.6 en adelante. +- Se corrige el test de conexión en entorno de producción. +- Se corrige el registro de los datos de la transacción en la base de datos para Oneclick. + # [2.2.0] - 2024-04-12 ## Fixed - Se corrige el retorno de una inscripción Oneclick cuando es rechazada por el usuario. diff --git a/Controller/Transaction/AuthorizeOneclick.php b/Controller/Transaction/AuthorizeOneclick.php index 0148e70..d71190d 100644 --- a/Controller/Transaction/AuthorizeOneclick.php +++ b/Controller/Transaction/AuthorizeOneclick.php @@ -2,16 +2,30 @@ namespace Transbank\Webpay\Controller\Transaction; +use Magento\Checkout\Model\Cart; +use Magento\Checkout\Model\Session; +use Transbank\Webpay\Model\Oneclick; +use Magento\Framework\App\Action\Action; +use Magento\Framework\App\Action\Context; +use Magento\Framework\App\ObjectManager; use Transbank\Webpay\Helper\PluginLogger; +use Magento\Framework\App\ResponseInterface; +use Magento\Framework\Controller\Result\Json; +use Transbank\Webpay\Model\Config\ConfigProvider; +use Magento\Framework\Message\ManagerInterface; +use Magento\Framework\Controller\ResultInterface; use Transbank\Webpay\Model\TransbankSdkWebpayRest; -use Transbank\Webpay\Model\Oneclick; +use Transbank\Webpay\Model\WebpayOrderDataFactory; +use Magento\Sales\Model\Order\Payment\Transaction; use Transbank\Webpay\Model\OneclickInscriptionData; +use Magento\Framework\Controller\Result\JsonFactory; +use Transbank\Webpay\Model\OneclickInscriptionDataFactory; /** * Controller for create Oneclick Inscription. */ -class AuthorizeOneclick extends \Magento\Framework\App\Action\Action +class AuthorizeOneclick extends Action { protected $configProvider; @@ -22,58 +36,54 @@ class AuthorizeOneclick extends \Magento\Framework\App\Action\Action '-99' => 'La transacción ha sido rechazada porque se superó la cantidad máxima de pagos diarios.', ]; - protected $cart; - protected $checkoutSession; - protected $resultJsonFactory; - protected $quoteManagement; - protected $storeManager; - protected $oneclickInscriptionDataFactory; - protected $log; - protected $webpayOrderDataFactory; + private $cart; + private $checkoutSession; + private $resultJsonFactory; + private $oneclickInscriptionDataFactory; + private $log; + private $webpayOrderDataFactory; + protected $messageManager; + private $oneclickConfig; /** * AuthorizeOneclick constructor. * - * @param \Magento\Framework\App\Action\Context $context - * @param \Magento\Checkout\Model\Cart $cart - * @param \Magento\Checkout\Model\Session $checkoutSession - * @param \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory - * @param \Magento\Quote\Model\QuoteManagement $quoteManagement - * @param \Magento\Store\Model\StoreManagerInterface $storeManager - * @param \Transbank\Webpay\Model\Config\ConfigProvider $configProvider - * @param \Transbank\Webpay\Model\OneclickInscriptionDataFactory $oneclickInscriptionDataFactory - * @param \Transbank\Webpay\Model\WebpayOrderDataFactory $webpayOrderDataFactory + * @param Context $context + * @param Cart $cart + * @param Session $checkoutSession + * @param JsonFactory $resultJsonFactory + * @param ConfigProvider $configProvider + * @param OneclickInscriptionDataFactory $oneclickInscriptionDataFactory + * @param WebpayOrderDataFactory $webpayOrderDataFactory + * @param ManagerInterface $messageManager */ public function __construct( - \Magento\Framework\App\Action\Context $context, - \Magento\Checkout\Model\Cart $cart, - \Magento\Checkout\Model\Session $checkoutSession, - \Magento\Framework\Controller\Result\JsonFactory $resultJsonFactory, - \Magento\Quote\Model\QuoteManagement $quoteManagement, - \Magento\Store\Model\StoreManagerInterface $storeManager, - \Transbank\Webpay\Model\Config\ConfigProvider $configProvider, - \Transbank\Webpay\Model\OneclickInscriptionDataFactory $oneclickInscriptionDataFactory, - \Transbank\Webpay\Model\WebpayOrderDataFactory $webpayOrderDataFactory, - \Magento\Framework\Message\ManagerInterface $messageManager + Context $context, + Cart $cart, + Session $checkoutSession, + JsonFactory $resultJsonFactory, + ConfigProvider $configProvider, + OneclickInscriptionDataFactory $oneclickInscriptionDataFactory, + WebpayOrderDataFactory $webpayOrderDataFactory, + ManagerInterface $messageManager ) { parent::__construct($context); $this->cart = $cart; $this->checkoutSession = $checkoutSession; $this->resultJsonFactory = $resultJsonFactory; - $this->quoteManagement = $quoteManagement; - $this->storeManager = $storeManager; $this->configProvider = $configProvider; $this->messageManager = $messageManager; $this->oneclickInscriptionDataFactory = $oneclickInscriptionDataFactory; $this->webpayOrderDataFactory = $webpayOrderDataFactory; $this->log = new PluginLogger(); + $this->oneclickConfig = $configProvider->getPluginConfigOneclick(); } /** * @throws \Exception * - * @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\Result\Json|\Magento\Framework\Controller\ResultInterface + * @return ResponseInterface|Json|ResultInterface */ public function execute() { @@ -91,9 +101,9 @@ public function execute() return $resultJson->setData(['status' => 'error', 'message' => 'Error autorizando transacción', 'flag' => 0]); } - list($username, $tbkUser) = $this->getOneclickInscriptionData($inscriptionId); - - $config = $this->configProvider->getPluginConfigOneclick(); + $inscription = $this->getOneclickInscriptionData($inscriptionId); + $username = $inscription->getUsername(); + $tbkUser = $inscription->getTbkUser(); $this->checkoutSession->restoreQuote(); @@ -109,20 +119,14 @@ public function execute() $quote->save(); - $transbankSdkWebpay = new TransbankSdkWebpayRest($config); + $transbankSdkWebpay = new TransbankSdkWebpayRest($this->oneclickConfig); - $this->log->logError(json_encode($order)); - - $this->log->logError($config['CHILD_COMMERCE_CODE']); - $this->log->logError($orderId); - $this->log->logError($grandTotal); - - $buyOrder = "100000".$orderId; - $childBuyOrder = "200000".$orderId; + $buyOrder = "100000" . $orderId; + $childBuyOrder = "200000" . $orderId; $details = [ [ - "commerce_code" => $config['CHILD_COMMERCE_CODE'], + "commerce_code" => $this->oneclickConfig['CHILD_COMMERCE_CODE'], "buy_order" => $childBuyOrder, "amount" => $grandTotal, "installments_number" => 1 @@ -152,12 +156,12 @@ public function execute() $this->checkoutSession->getQuote()->setIsActive(true)->save(); $this->cart->getQuote()->setIsActive(true)->save(); - $orderLogs = '

Pago autorizado exitosamente con '.$oneclickTitle.'


'.json_encode($dataLog); + $orderLogs = '

Pago autorizado exitosamente con ' . $oneclickTitle . '


' . json_encode($dataLog); $payment = $order->getPayment(); $payment->setLastTransId($response->details[0]->authorizationCode); $payment->setTransactionId($response->details[0]->authorizationCode); - $payment->setAdditionalInformation([\Magento\Sales\Model\Order\Payment\Transaction::RAW_DETAILS => (array) $response->details[0]]); + $payment->setAdditionalInformation([Transaction::RAW_DETAILS => (array) $response->details[0]]); $order->setState($orderStatusSuccess)->setStatus($orderStatusSuccess); $order->addStatusToHistory($order->getStatus(), $orderLogs); @@ -172,12 +176,10 @@ public function execute() 'message' => $message ] ); - return $resultJson->setData(['status' => 'success', 'response' => $response, '$webpayOrderData' => $webpayOrderData]); - } else { $webpayOrderData = $this->saveWebpayData( - $config['CHILD_COMMERCE_CODE'], + $this->oneclickConfig['CHILD_COMMERCE_CODE'], $grandTotal, OneclickInscriptionData::PAYMENT_STATUS_FAILED, $orderId, @@ -185,7 +187,7 @@ public function execute() ); $order->setStatus($orderStatusCanceled); - $message = '

Error en Inscripción con Oneclick


'.json_encode($response); + $message = '

Error en Inscripción con Oneclick


' . json_encode($response); $order->addStatusToHistory($order->getStatus(), $message); $order->cancel(); @@ -199,9 +201,8 @@ public function execute() // return $this->resultRedirectFactory->create()->setPath('checkout/cart'); return $resultJson->setData(['status' => 'error', 'response' => $response, 'flag' => 1]); } - } catch (\Exception $e) { - $message = 'Error al crear transacción: '.$e->getMessage(); + $message = 'Error al crear transacción: ' . $e->getMessage(); $this->log->logError($message); $response = ['error' => $message]; @@ -216,7 +217,6 @@ public function execute() $this->messageManager->addErrorMessage($e->getMessage()); return $resultJson->setData(['status' => 'error', 'response' => $response, 'flag' => 2]); } - } /** @@ -230,10 +230,9 @@ private function getOrder() return null; } - $objectManager = \Magento\Framework\App\ObjectManager::getInstance(); + $objectManager = ObjectManager::getInstance(); return $objectManager->create('\Magento\Sales\Model\Order')->load($orderId); - } catch (\Exception $e) { return null; } @@ -246,14 +245,10 @@ private function getOrder() * * @return OneclickInscriptionData */ - protected function getOneclickInscriptionData($inscriptionId) + protected function getOneclickInscriptionData($inscriptionId): OneclickInscriptionData { $oneclickInscriptionDataModel = $this->oneclickInscriptionDataFactory->create(); - $oneclickInscriptionData = $oneclickInscriptionDataModel->load($inscriptionId, 'id'); - $tbkUser = $oneclickInscriptionData->getTbkUser(); - $username = $oneclickInscriptionData->getUsername(); - - return [$username, $tbkUser]; + return $oneclickInscriptionDataModel->load($inscriptionId, 'id'); } /** @@ -282,13 +277,15 @@ protected function saveWebpayData($authorizeResponse, $amount, $payment_status, $webpayOrderData->setData([ 'buy_order' => $authorizeResponse->getBuyOrder(), 'child_buy_order' => $authorizeResponse->getDetails()[0]->getBuyOrder(), - 'commerce_code' => $authorizeResponse->getDetails()[0]->getCommerceCode(), + 'commerce_code' => $this->oneclickConfig['COMMERCE_CODE'], 'child_commerce_code' => $authorizeResponse->getDetails()[0]->getCommerceCode(), 'payment_status' => $payment_status, 'order_id' => $order_id, 'quote_id' => $quote_id, 'amount' => $amount, 'metadata' => json_encode($authorizeResponse), + 'environment' => $this->oneclickConfig['ENVIRONMENT'], + 'product' => Oneclick::PRODUCT_NAME ]); $webpayOrderData->save(); @@ -327,10 +324,10 @@ protected function getSuccessMessage($transactionResult, $oneclickTitle) • Order de Compra: {$transactionResult->details[0]->buyOrder}
- • Fecha de la Transacción: ".date('d-m-Y', strtotime($transactionResult->transactionDate)).' + • Fecha de la Transacción: " . date('d-m-Y', strtotime($transactionResult->transactionDate)) . '
- • Hora de la Transacción: '.date('H:i:s', strtotime($transactionResult->transactionDate))." + • Hora de la Transacción: ' . date('H:i:s', strtotime($transactionResult->transactionDate)) . "
• Tarjeta: **** **** **** {$transactionResult->cardNumber} @@ -355,8 +352,8 @@ protected function getRejectMessage($transactionResult, $oneclickTitle) Respuesta de la Transacción: {$this->responseCodeArray[$transactionResult->details[0]->responseCode]}
Monto: $ {$transactionResult->details[0]->amount}
Order de Compra: {$transactionResult->details[0]->buyOrder}
- Fecha de la Transacción: ".date('d-m-Y', strtotime($transactionResult->transactionDate)).'
- Hora de la Transacción: '.date('H:i:s', strtotime($transactionResult->transactionDate))."
+ Fecha de la Transacción: " . date('d-m-Y', strtotime($transactionResult->transactionDate)) . '
+ Hora de la Transacción: ' . date('H:i:s', strtotime($transactionResult->transactionDate)) . "
Tarjeta: **** **** **** {$transactionResult->cardNumber}

"; diff --git a/Model/Config/ConfigProvider.php b/Model/Config/ConfigProvider.php index 4324c99..8e2e0d5 100644 --- a/Model/Config/ConfigProvider.php +++ b/Model/Config/ConfigProvider.php @@ -4,11 +4,11 @@ class ConfigProvider implements \Magento\Checkout\Model\ConfigProviderInterface { - const SECURITY_CONFIGS_ROUTE = 'payment/transbank_webpay/security/'; - const ORDER_CONFIGS_ROUTE = 'payment/transbank_webpay/general_parameters/'; - - const SECURITY_CONFIGS_ROUTE_ONECLICK = 'payment/transbank_oneclick/security/'; - const ORDER_CONFIGS_ROUTE_ONECLICK = 'payment/transbank_oneclick/general_parameters/'; + const SECURITY_CONFIGS_ROUTE = 'payment/transbank_webpay/'; + const ORDER_CONFIGS_ROUTE = 'payment/transbank_webpay/'; + + const SECURITY_CONFIGS_ROUTE_ONECLICK = 'payment/transbank_oneclick/'; + const ORDER_CONFIGS_ROUTE_ONECLICK = 'payment/transbank_oneclick/'; const CC_VAULT_CODE = 'transbank_oneclick_cc_vault'; diff --git a/Model/HealthCheck.php b/Model/HealthCheck.php index 5947174..62f99f4 100755 --- a/Model/HealthCheck.php +++ b/Model/HealthCheck.php @@ -99,7 +99,7 @@ public function __construct($config) */ private function getValidatePHP() { - if (version_compare(phpversion(), '7.2.1', '<=') && version_compare(phpversion(), '5.5.0', '>=')) { + if (version_compare(phpversion(), '7.4.33', '<=') && version_compare(phpversion(), '5.5.0', '>=')) { $this->versionInfo = [ 'status' => 'OK', 'version' => phpversion(), diff --git a/Model/Oneclick.php b/Model/Oneclick.php index 9602b37..0026f78 100755 --- a/Model/Oneclick.php +++ b/Model/Oneclick.php @@ -5,6 +5,7 @@ class Oneclick extends \Magento\Payment\Model\Method\AbstractMethod { const CODE = 'transbank_oneclick'; + const PRODUCT_NAME = 'webpay_oneclick'; /** * Payment code. diff --git a/Observer/SaveConfigObserver.php b/Observer/SaveConfigObserver.php index 68c12a3..273706f 100644 --- a/Observer/SaveConfigObserver.php +++ b/Observer/SaveConfigObserver.php @@ -14,10 +14,10 @@ class SaveConfigObserver implements ObserverInterface { - const TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS = 'payment/transbank_webpay/general_parameters/payment_successful_status'; - const TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS = 'payment/transbank_oneclick/general_parameters/payment_successful_status'; - const TRANSBANK_ONECLICK_INVOICE_SETTINGS = 'payment/transbank_oneclick/general_parameters/invoice_settings'; - const TRANSBANK_WEBPAY_INVOICE_SETTINGS = 'payment/transbank_webpay/general_parameters/invoice_settings'; + const TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS = 'payment/transbank_webpay/payment_successful_status'; + const TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS = 'payment/transbank_oneclick/payment_successful_status'; + const TRANSBANK_ONECLICK_INVOICE_SETTINGS = 'payment/transbank_oneclick/invoice_settings'; + const TRANSBANK_WEBPAY_INVOICE_SETTINGS = 'payment/transbank_webpay/invoice_settings'; protected $request; protected $configWriter; @@ -26,13 +26,13 @@ class SaveConfigObserver implements ObserverInterface protected ScopeConfigInterface $scopeConfig; protected StoreManagerInterface $storeManager; - public function __construct ( + public function __construct( LoggerInterface $logger, RequestInterface $request, WriterInterface $configWriter, ScopeConfigInterface $scopeConfig, - StoreManagerInterface $storeManager) - { + StoreManagerInterface $storeManager + ) { $this->request = $request; $this->_logger = $logger; $this->configWriter = $configWriter; @@ -46,13 +46,28 @@ public function execute(EventObserver $observer) $websiteId = $this->getWebsiteId(); $params = $this->request->getParam('groups'); - - if( isset($params['transbank_webpay']['groups']['general_parameters']['fields']['payment_successful_status']['value']) ){ - $orderStatus = $params['transbank_webpay']['groups']['general_parameters']['fields']['payment_successful_status']['value']; - } elseif (empty($this->scopeConfig->getValue(self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS,ScopeInterface::SCOPE_WEBSITE, $websiteId ))) { - $orderStatus = $this->scopeConfig->getValue(self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS,ScopeConfigInterface::SCOPE_TYPE_DEFAULT); + $transbankParams = $params['transbank']['groups']; + $webpayFields = $transbankParams['transbank_webpay']['fields']; + $oneclickFields = $transbankParams['transbank_oneclick']['fields']; + + if (isset($webpayFields['payment_successful_status']['value'])) { + $orderStatus = $webpayFields['payment_successful_status']['value']; + } elseif (empty($this->scopeConfig->getValue( + self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS, + ScopeInterface::SCOPE_WEBSITE, + $websiteId + ))) { + $orderStatus = $this->scopeConfig->getValue( + self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + $websiteId + ); } else { - $orderStatus = $this->scopeConfig->getValue(self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS,ScopeInterface::SCOPE_WEBSITE, $websiteId ); + $orderStatus = $this->scopeConfig->getValue( + self::TRANSBANK_WEBPAY_PAYMENT_SUCCESSFUL_STATUS, + ScopeInterface::SCOPE_WEBSITE, + $websiteId + ); } if ($orderStatus !== 'processing') { @@ -60,12 +75,24 @@ public function execute(EventObserver $observer) $this->configWriter->save(self::TRANSBANK_WEBPAY_INVOICE_SETTINGS, $value); } - if(isset($params['transbank_oneclick']['groups']['general_parameters']['fields']['payment_successful_status']['value']) ) { - $oneclickOrderStatus = $params['transbank_oneclick']['groups']['general_parameters']['fields']['payment_successful_status']['value']; - }elseif (empty($this->scopeConfig->getValue(self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS,ScopeInterface::SCOPE_WEBSITE, $websiteId))) { - $oneclickOrderStatus = $this->scopeConfig->getValue(self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS,ScopeConfigInterface::SCOPE_TYPE_DEFAULT); - }else { - $oneclickOrderStatus = $this->scopeConfig->getValue(self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS,ScopeInterface::SCOPE_WEBSITE, $websiteId); + if (isset($oneclickFields['payment_successful_status']['value'])) { + $oneclickOrderStatus = $oneclickFields['payment_successful_status']['value']; + } elseif (empty($this->scopeConfig->getValue( + self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS, + ScopeInterface::SCOPE_WEBSITE, + $websiteId + ))) { + $oneclickOrderStatus = $this->scopeConfig->getValue( + self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS, + ScopeConfigInterface::SCOPE_TYPE_DEFAULT, + $websiteId + ); + } else { + $oneclickOrderStatus = $this->scopeConfig->getValue( + self::TRANSBANK_ONECLICK_PAYMENT_SUCCESSFUL_STATUS, + ScopeInterface::SCOPE_WEBSITE, + $websiteId + ); } if ($oneclickOrderStatus !== 'processing') { @@ -88,4 +115,3 @@ public function getWebsiteId(): int return $websiteId; } } - diff --git a/Setup/UpgradeData.php b/Setup/UpgradeData.php new file mode 100644 index 0000000..873b8ef --- /dev/null +++ b/Setup/UpgradeData.php @@ -0,0 +1,78 @@ +configInterface = $configInterface; + $this->scopeConfigInterface = $scopeConfigInterface; + } + + public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface $context) + { + $setup->startSetup(); + + if (version_compare($context->getVersion(), '2.2.1', '<')) { + $this->updateConfigData(); + } + + $setup->endSetup(); + } + + private function updateConfigData() + { + $newConfigValues = [ + 'payment/transbank_webpay/general_parameters/payment_successful_status' => + 'payment/transbank_webpay/payment_successful_status', + 'payment/transbank_webpay/general_parameters/payment_error_status' => + 'payment/transbank_webpay/payment_error_status', + 'payment/transbank_webpay/general_parameters/new_order_status' => + 'payment/transbank_webpay/new_order_status', + 'payment/transbank_webpay/general_parameters/invoice_settings' => + 'payment/transbank_webpay/invoice_settings', + 'payment/transbank_webpay/general_parameters/sort_order' => 'payment/transbank_webpay/sort_order', + 'payment/transbank_webpay/general_parameters/new_email_order' => + 'payment/transbank_webpay/new_email_order', + 'payment/transbank_webpay/security/environment' => 'payment/transbank_webpay/environment', + 'payment/transbank_webpay/security/commerce_code' => 'payment/transbank_webpay/commerce_code', + 'payment/transbank_webpay/security/api_key' => 'payment/transbank_webpay/api_key', + 'payment/transbank_oneclick/general_parameters/payment_successful_status' => + 'payment/transbank_oneclick/payment_successful_status', + 'payment/transbank_oneclick/general_parameters/payment_error_status' => + 'payment/transbank_oneclick/payment_error_status', + 'payment/transbank_oneclick/general_parameters/invoice_settings' => + 'payment/transbank_oneclick/invoice_settings', + 'payment/transbank_oneclick/general_parameters/new_order_status' => + 'payment/transbank_oneclick/new_order_status', + 'payment/transbank_oneclick/general_parameters/sort_order' => 'payment/transbank_oneclick/sort_order', + 'payment/transbank_oneclick/general_parameters/new_email_order' => + 'payment/transbank_oneclick/new_email_order', + 'payment/transbank_oneclick/security/environment' => 'payment/transbank_oneclick/environment', + 'payment/transbank_oneclick/security/commerce_code' => 'payment/transbank_oneclick/commerce_code', + 'payment/transbank_oneclick/security/child_commerce_code' => + 'payment/transbank_oneclick/child_commerce_code', + 'payment/transbank_oneclick/security/transaction_max_amount' => + 'payment/transbank_oneclick/transaction_max_amount', + 'payment/transbank_oneclick/security/api_key' => 'payment/transbank_oneclick/api_key', + ]; + + foreach ($newConfigValues as $key => $value) { + $currentConfigValue = $this->scopeConfigInterface->getValue($key); + $this->configInterface->deleteConfig($key); + $this->configInterface->saveConfig($value, $currentConfigValue); + } + } +} diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml index d705629..7507c5f 100644 --- a/etc/adminhtml/system.xml +++ b/etc/adminhtml/system.xml @@ -22,54 +22,54 @@ Transbank\Webpay\Model\Config\Environment - payment/transbank_webpay/security/environment + payment/transbank_webpay/environment Identificador único del comercio, asegurate de que comience con 5970 - payment/transbank_webpay/security/commerce_code + payment/transbank_webpay/commerce_code Llave secreta utilizada para conectarse a la API ¡asegúrate de no compartir su contenido! - payment/transbank_webpay/security/api_key + payment/transbank_webpay/api_key Transbank\Webpay\Model\Config\OrderStatus - payment/transbank_webpay/general_parameters/payment_successful_status + payment/transbank_webpay/payment_successful_status Transbank\Webpay\Model\Config\OrderStatus - payment/transbank_webpay/general_parameters/payment_error_status + payment/transbank_webpay/payment_error_status Magento\Sales\Model\Config\Source\Order\Status\NewStatus - payment/transbank_webpay/general_parameters/new_order_status + payment/transbank_webpay/new_order_status validate-number Posición en la que aparecerá la opción de pago, debe ser menor a otros medios de pago para que aparezca primero - payment/transbank_webpay/general_parameters/sort_order + payment/transbank_webpay/sort_order Transbank\Webpay\Model\Config\ConfigEmail Al seleccionar 'Default' el correo electrónico se enviará al crear el pedido y no al procesar la compra - payment/transbank_webpay/general_parameters/new_email_order + payment/transbank_webpay/new_email_order @@ -77,7 +77,7 @@ Transbank\Webpay\Model\Config\ConfigInvoice Para modificar esta opción es necesario que el estado de Pago Exitoso sea "Processing" Transbank\Webpay\Helper\Disable - payment/transbank_webpay/general_parameters/invoice_settings + payment/transbank_webpay/invoice_settings @@ -99,21 +99,21 @@ Transbank\Webpay\Model\Config\Environment - payment/transbank_oneclick/security/environment + payment/transbank_oneclick/environment Identificador único del comercio, asegurate de que comience con 5970 - payment/transbank_oneclick/security/commerce_code + payment/transbank_oneclick/commerce_code Identificador único del comercio asignado por Transbank para la tienda perteneciente al mall, asegurate de que comience con 5970 - payment/transbank_oneclick/security/child_commerce_code + payment/transbank_oneclick/child_commerce_code @@ -126,14 +126,14 @@ fraude o contracargo. Independiente del monto que definas en esta configuración, en tu contrato de Oneclick, existe un límite de cantidad de transacciones diarias, un monto máximo por transacción y monto acumulado diario. Si un cliente supera ese límite, su transacción será rechazada. - payment/transbank_oneclick/security/transaction_max_amount + payment/transbank_oneclick/transaction_max_amount Llave secreta utilizada para conectarse a la API ¡asegúrate de no compartir su contenido! - payment/transbank_oneclick/security/api_key + payment/transbank_oneclick/api_key @@ -141,33 +141,33 @@ Transbank\Webpay\Model\Config\OrderStatus Para reversar o anular una transacción el estado de pago exitoso debe de ser Processing. - payment/transbank_oneclick/general_parameters/payment_successful_status + payment/transbank_oneclick/payment_successful_status Transbank\Webpay\Model\Config\OrderStatus - payment/transbank_oneclick/general_parameters/payment_error_status + payment/transbank_oneclick/payment_error_status Magento\Sales\Model\Config\Source\Order\Status\NewStatus - payment/transbank_oneclick/general_parameters/new_order_status + payment/transbank_oneclick/new_order_status validate-number Posición en la que aparecerá la opción de pago, debe ser menor a otros medios de pago para que aparezca primero - payment/transbank_oneclick/general_parameters/sort_order + payment/transbank_oneclick/sort_order Transbank\Webpay\Model\Config\ConfigEmail Al seleccionar 'Default' el correo electrónico se enviará al crear el pedido y no al procesar la compra - payment/transbank_oneclick/general_parameters/new_email_order + payment/transbank_oneclick/new_email_order @@ -175,7 +175,7 @@ Transbank\Webpay\Model\Config\ConfigInvoice Para modificar esta opción es necesario que el estado de Pago Exitoso sea "Processing" Transbank\Webpay\Helper\Disable - payment/transbank_oneclick/general_parameters/invoice_settings + payment/transbank_oneclick/invoice_settings diff --git a/etc/config.xml b/etc/config.xml index 574af18..652b8e1 100644 --- a/etc/config.xml +++ b/etc/config.xml @@ -6,39 +6,31 @@ Transbank\Webpay\Model\Webpay Webpay Plus 1 - - complete - canceled - pending - 0 - default - default - - - TEST - 597055555532 - 579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C - + complete + canceled + pending + 0 + default + default + TEST + 597055555532 + 579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C Transbank\Webpay\Model\Oneclick Oneclick 1 - - complete - canceled - pending - 1 - default - default - - - TEST - 597055555541 - 597055555542 - 0 - 579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C - + complete + canceled + pending + 1 + default + default + TEST + 597055555541 + 597055555542 + 0 + 579B532A7440BB0C9079DED94D31EA1615BACEB56610332264630D42D0A36B1C diff --git a/etc/module.xml b/etc/module.xml index 95469cd..9d5188d 100644 --- a/etc/module.xml +++ b/etc/module.xml @@ -1,6 +1,6 @@ - +