Skip to content

Commit

Permalink
Merge pull request #6 from khipu/heads/2.4.8
Browse files Browse the repository at this point in the history
Mejoras a la extensión 2.4.8
  • Loading branch information
JKacicM authored Jan 25, 2024
2 parents 985407c + 082a98e commit 6f7f665
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 8 deletions.
14 changes: 10 additions & 4 deletions Model/Simplified.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

class Simplified extends \Magento\Payment\Model\Method\AbstractMethod
{
const KHIPU_MAGENTO_VERSION = "2.4.7";
const KHIPU_MAGENTO_VERSION = "2.4.8";
protected $_code = 'simplified';
protected $_isInitializeNeeded = true;
protected $urlBuilder;
Expand Down Expand Up @@ -225,10 +225,16 @@ public function validateKhipuCallback(Order $order, $notificationToken, $apiVers
$responseTxt .= 'Payer Name: ' . $paymentResponse->getPayerName() . '<br>';
$responseTxt .= 'Payer Email: ' . $paymentResponse->getPayerEmail() . '<br>';
$responseTxt .= 'Personal Identifier: ' . $paymentResponse->getPersonalIdentifier() . '<br>';

$invoice = $order->prepareInvoice();
$invoice->register();
$invoice->save();

$order->setState(Order::STATE_PROCESSING, TRUE);
$order->setStatus($order->getConfig()->getStateDefaultStatus(Order::STATE_PROCESSING));
$order->addStatusToHistory(Order::STATE_PROCESSING, $responseTxt);
$paymentCompleteStatus = $this->getConfigData('payment_complete_status');

$order->setState($paymentCompleteStatus, true);
$order->setStatus($order->getConfig()->getStateDefaultStatus($paymentCompleteStatus));
$order->addStatusToHistory($paymentCompleteStatus, $responseTxt);
$order->save();
}
}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# Magento 2 Khipu Plugin

khipu payment gateway Magento 2.4.7 plugin.
khipu payment gateway Magento 2.4.8 plugin.

This version is compatible with Magento 2.3 to 2.6

You can sign up for khipu account at <https://khipu.com>

## Install via Composer

You can install Magento 2.4.7 khipu plugin via [Composer](http://getcomposer.org/). Run the following command in your terminal:
You can install Magento 2.4.8 khipu plugin via [Composer](http://getcomposer.org/). Run the following command in your terminal:

1. Go to your Magento 2 root folder.

Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "khipu/magento2-khipu",
"type": "magento2-module",
"description": "khipu integration for Magento 2",
"version": "2.4.7",
"version": "2.4.8",
"homepage": "https://khipu.com",
"license": [
"OSL-3.0"
Expand Down
4 changes: 4 additions & 0 deletions etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
<field id="merchant_secret" translate="label" type="obscure" sortOrder="5" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Secret</label>
</field>
<field id="payment_complete_status" translate="label" type="select" sortOrder="7" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Estado del pago</label>
<source_model>Magento\Sales\Model\Config\Source\Order\Status</source_model>
</field>
<field id="sort_order" translate="label" type="text" sortOrder="100" showInDefault="1" showInWebsite="1" showInStore="0">
<label>Sort Order</label>
</field>
Expand Down
2 changes: 1 addition & 1 deletion 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:noTestSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Khipu_Payment" setup_version="2.4.7" active="true">
<module name="Khipu_Payment" setup_version="2.4.8" active="true">
<sequence>
<module name="Magento_Sales"/>
<module name="Magento_Checkout"/>
Expand Down

0 comments on commit 6f7f665

Please sign in to comment.